From 08ccffcc828a008b760e878f0f228d7d97e2183a Mon Sep 17 00:00:00 2001 From: jankratochvil <> Date: Sun, 25 Dec 2005 17:09:36 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create tag 'bp_HEAD'. Sprout from master 2005-12-25 17:09:35 UTC lace 'Initial original import from: fuse-2.4.2-2.fc4' Delete: .gdbinit .vimrc AUTHORS COPYING INSTALL Makefile-head.am Makefile.am NEWS README THANKS TODO autogen.pl build-static captive.spec.in configure.ac cvs2cl-usermap debian/captive-install.conffiles debian/captive-install.files debian/captive-install.postinst debian/captive-install.prerm debian/captive-lufs.files debian/captive.conffiles debian/captive.docs debian/captive.files debian/captive.postinst debian/captive.postrm debian/changelog.in debian/control debian/copyright debian/rules doc/Makefile.am doc/apiref/Makefile.am doc/apiref/captive-apiref.types doc/apiref/captive-apiref.xml fonts/Makefile.am fonts/fonts.conf.in fonts/l048013t.pfa gnome_vfs_read_entire_file.c include_test.c po/cs.po src/Makefile.am src/TraceFS/Makefile.am src/TraceFS/TraceFS-W32/Sources src/TraceFS/TraceFS-W32/TraceFS.c src/TraceFS/TraceFS-W32/TraceFS.def src/TraceFS/TraceFS-W32/TraceFS.reg src/TraceFS/TraceFS-W32/TraceFS.sys src/TraceFS/TraceFS-W32/makeFile src/TraceFS/checktrace.pl src/TraceFS/hookfs.pl src/client/Makefile.am src/client/bug-replay/Makefile.am src/client/bug-replay/main.c src/client/cmdline/Makefile.am src/client/cmdline/captive-cmdline.pod.pl.in src/client/cmdline/cmd_cd.c src/client/cmdline/cmd_cd.h src/client/cmdline/cmd_close.c src/client/cmdline/cmd_close.h src/client/cmdline/cmd_commit.c src/client/cmdline/cmd_commit.h src/client/cmdline/cmd_create.c src/client/cmdline/cmd_create.h src/client/cmdline/cmd_get.c src/client/cmdline/cmd_get.h src/client/cmdline/cmd_help.c src/client/cmdline/cmd_help.h src/client/cmdline/cmd_info.c src/client/cmdline/cmd_info.h src/client/cmdline/cmd_lcd.c src/client/cmdline/cmd_lcd.h src/client/cmdline/cmd_ls.c src/client/cmdline/cmd_ls.h src/client/cmdline/cmd_mkdir.c src/client/cmdline/cmd_mkdir.h src/client/cmdline/cmd_mv.c src/client/cmdline/cmd_mv.h src/client/cmdline/cmd_open.c src/client/cmdline/cmd_open.h src/client/cmdline/cmd_put.c src/client/cmdline/cmd_put.h src/client/cmdline/cmd_quit.c src/client/cmdline/cmd_quit.h src/client/cmdline/cmd_rm.c src/client/cmdline/cmd_rm.h src/client/cmdline/cmd_rmdir.c src/client/cmdline/cmd_rmdir.h src/client/cmdline/cmd_shell.c src/client/cmdline/cmd_shell.h src/client/cmdline/cmd_volume.c src/client/cmdline/cmd_volume.h src/client/cmdline/file_info.c src/client/cmdline/file_info.h src/client/cmdline/handle.c src/client/cmdline/handle.h src/client/cmdline/main.c src/client/cmdline/main.h src/client/cmdline/utf8.c src/client/cmdline/utf8.h src/client/fuse/Makefile.am src/client/fuse/captive.init src/client/fuse/gnomevfsfileinfo.c src/client/fuse/gnomevfsfileinfo.h src/client/fuse/gnomevfsresult.c src/client/fuse/gnomevfsresult.h src/client/fuse/main.c src/client/fuse/main.h src/client/fuse/mount.captive.pod.pl.in src/client/fuse/op_chmod.c src/client/fuse/op_chmod.h src/client/fuse/op_fsync.c src/client/fuse/op_fsync.h src/client/fuse/op_fsyncdir.c src/client/fuse/op_fsyncdir.h src/client/fuse/op_getattr.c src/client/fuse/op_getattr.h src/client/fuse/op_mkdir.c src/client/fuse/op_mkdir.h src/client/fuse/op_mknod.c src/client/fuse/op_mknod.h src/client/fuse/op_open.c src/client/fuse/op_open.h src/client/fuse/op_opendir.c src/client/fuse/op_opendir.h src/client/fuse/op_read.c src/client/fuse/op_read.h src/client/fuse/op_readdir.c src/client/fuse/op_readdir.h src/client/fuse/op_release.c src/client/fuse/op_release.h src/client/fuse/op_releasedir.c src/client/fuse/op_releasedir.h src/client/fuse/op_rename.c src/client/fuse/op_rename.h src/client/fuse/op_rmdir.c src/client/fuse/op_rmdir.h src/client/fuse/op_statfs.c src/client/fuse/op_statfs.h src/client/fuse/op_truncate.c src/client/fuse/op_truncate.h src/client/fuse/op_unlink.c src/client/fuse/op_unlink.h src/client/fuse/op_utime.c src/client/fuse/op_utime.h src/client/fuse/op_write.c src/client/fuse/op_write.h src/client/gnomevfs/Makefile.am src/client/gnomevfs/captive.conf.in src/client/gnomevfs/giognomevfs.c src/client/gnomevfs/giognomevfs.h src/client/gnomevfs/gnome-vfs-method.c src/client/gnomevfs/gnome-vfs-method.h src/client/gnomevfs/gnome-vfs-module.c src/client/gnomevfs/gnome-vfs-module.h src/client/lufs/Makefile.am src/client/lufs/captivefs-attr.c src/client/lufs/captivefs-attr.h src/client/lufs/captivefs-directory.c src/client/lufs/captivefs-file.c src/client/lufs/captivefs-misc.c src/client/lufs/captivefs-misc.h src/client/lufs/captivefs-vfs.c src/client/lufs/captivefs-vfs.h src/client/lufs/lufs-captivefs.pod.pl.in src/client/lufs/mount.captive.in src/client/lufs/mount.captive.pod.pl.in src/client/sandbox-server/.gdbinit src/client/sandbox-server/Makefile.am src/client/sandbox-server/captive-sandbox-server.pod.pl.in src/client/sandbox-server/main.c src/install/Makefile.am src/install/acquire/Makefile.am src/install/acquire/cabextract/AUTHORS src/install/acquire/cabextract/COPYING src/install/acquire/cabextract/ChangeLog src/install/acquire/cabextract/INSTALL src/install/acquire/cabextract/Makefile.am src/install/acquire/cabextract/Makefile.in src/install/acquire/cabextract/NEWS src/install/acquire/cabextract/README src/install/acquire/cabextract/TODO src/install/acquire/cabextract/aclocal.m4 src/install/acquire/cabextract/cabextract.1 src/install/acquire/cabextract/cabextract.c src/install/acquire/cabextract/cabextract.spec src/install/acquire/cabextract/cabextract.spec.in src/install/acquire/cabextract/cabinfo.c src/install/acquire/cabextract/config.h.in src/install/acquire/cabextract/configure src/install/acquire/cabextract/configure.in src/install/acquire/cabextract/debian/README.Debian src/install/acquire/cabextract/debian/changelog src/install/acquire/cabextract/debian/control src/install/acquire/cabextract/debian/copyright src/install/acquire/cabextract/debian/dirs src/install/acquire/cabextract/debian/docs src/install/acquire/cabextract/debian/rules src/install/acquire/cabextract/getopt.c src/install/acquire/cabextract/getopt.h src/install/acquire/cabextract/getopt1.c src/install/acquire/cabextract/install-sh src/install/acquire/cabextract/ja/cabextract.1 src/install/acquire/cabextract/magic.cabinet src/install/acquire/cabextract/missing src/install/acquire/cabextract/mkinstalldirs src/install/acquire/cabextract/mktime.c src/install/acquire/cabextract/stamp-h.in src/install/acquire/cabinet-memory.c src/install/acquire/cabinet-memory.h src/install/acquire/cabinet.c src/install/acquire/cabinet.h src/install/acquire/captive-install-acquire.pod.pl.in src/install/acquire/captivemodid-list.pl src/install/acquire/captivemodid-print.pl src/install/acquire/captivemodid.c src/install/acquire/captivemodid.h src/install/acquire/compatibility-test.sh src/install/acquire/diskscan.c src/install/acquire/diskscan.h src/install/acquire/final.c src/install/acquire/final.h src/install/acquire/main.c src/install/acquire/main.h src/install/acquire/microsoftcom.c src/install/acquire/microsoftcom.h src/install/acquire/moduriload.c src/install/acquire/moduriload.h src/install/acquire/ui-gnome.c src/install/acquire/ui-gnome.glade src/install/acquire/ui-gnome.gladep src/install/acquire/ui-gnome.h src/install/acquire/ui-line.c src/install/acquire/ui-line.h src/install/acquire/w32-mod-id.captivemodid.xml src/install/fstab/Makefile.am src/install/fstab/captive-install-fstab.pod.pl.in src/install/fstab/main.c src/install/libcaptive-install/Makefile.am src/install/libcaptive-install/proc_partitions.c src/install/libcaptive-install/proc_partitions.h src/libcaptive/Makefile-libcaptive.am src/libcaptive/Makefile.am src/libcaptive/captive.pod.pl.in src/libcaptive/cc/Makefile.am src/libcaptive/cc/bcbmap.c src/libcaptive/cc/bcbowner.c src/libcaptive/cc/bcbpin.c src/libcaptive/cc/bcbrepin.c src/libcaptive/cc/bcbunpin.c src/libcaptive/cc/cache.c src/libcaptive/cc/copy.c src/libcaptive/cc/dirtypages.c src/libcaptive/cc/init.c src/libcaptive/cc/io.c src/libcaptive/cc/io.h src/libcaptive/cc/loghandle.c src/libcaptive/cc/marshallers.list src/libcaptive/cc/misc.c src/libcaptive/cc/mm.c src/libcaptive/cc/privatebcb-priv.h src/libcaptive/cc/privatebcb.c src/libcaptive/cc/privatebcb.h src/libcaptive/cc/privatebcbmap.c src/libcaptive/cc/privatebcbmap.h src/libcaptive/cc/privatebcbpin.c src/libcaptive/cc/privatebcbpin.h src/libcaptive/cc/sharedcachemap-priv.h src/libcaptive/cc/sharedcachemap.c src/libcaptive/cc/sharedcachemap.h src/libcaptive/client/Makefile.am src/libcaptive/client/directory-parent.c src/libcaptive/client/directory-parent.h src/libcaptive/client/directory-slave.c src/libcaptive/client/directory-slave.h src/libcaptive/client/directory.c src/libcaptive/client/directory.h src/libcaptive/client/file-parent.c src/libcaptive/client/file-parent.h src/libcaptive/client/file-slave.c src/libcaptive/client/file-slave.h src/libcaptive/client/file.c src/libcaptive/client/file.h src/libcaptive/client/giochannel-blind.c src/libcaptive/client/giochannel-blind.h src/libcaptive/client/giochannel-subrange.c src/libcaptive/client/giochannel-subrange.h src/libcaptive/client/init.c src/libcaptive/client/init.h src/libcaptive/client/leave.c src/libcaptive/client/lib.c src/libcaptive/client/lib.h src/libcaptive/client/libxml.c src/libcaptive/client/marshallers.list src/libcaptive/client/options-module.c src/libcaptive/client/options.c src/libcaptive/client/options.pod.pl.in src/libcaptive/client/parent-connector.c src/libcaptive/client/parent-connector.h src/libcaptive/client/result.c src/libcaptive/client/result.h src/libcaptive/client/standalone-gnome.c src/libcaptive/client/standalone-gnome.h src/libcaptive/client/standalone.c src/libcaptive/client/standalone.h src/libcaptive/client/usecount.c src/libcaptive/client/vfs-parent.c src/libcaptive/client/vfs-parent.h src/libcaptive/client/vfs-slave.c src/libcaptive/client/vfs-slave.h src/libcaptive/client/vfs.c src/libcaptive/client/vfs.h src/libcaptive/cm/Makefile.am src/libcaptive/cm/ntfunc.c src/libcaptive/cm/rtlfunc.c src/libcaptive/ex/Makefile.am src/libcaptive/ex/list.c src/libcaptive/ex/lookas.c src/libcaptive/ex/resource.c src/libcaptive/ex/time.c src/libcaptive/ex/work.c src/libcaptive/fs/Makefile.am src/libcaptive/fs/dbcsname.c src/libcaptive/fs/filelock.c src/libcaptive/fs/mcb.c src/libcaptive/fs/name.c src/libcaptive/fs/name_pass.c src/libcaptive/fs/notify.c src/libcaptive/fs/oplock.c src/libcaptive/fs/stream.c src/libcaptive/fs/tunnel.c src/libcaptive/fs/util.c src/libcaptive/halcaptive/Makefile.am src/libcaptive/halcaptive/intrlck.c src/libcaptive/halcaptive/perfcnt.c src/libcaptive/halcaptive/queuedspinlock.c src/libcaptive/halcaptive/spinlock.c src/libcaptive/include/Makefile.am src/libcaptive/include/captive/Makefile.am src/libcaptive/include/captive/calltype_reactos.h src/libcaptive/include/captive/client-directory.h src/libcaptive/include/captive/client-file.h src/libcaptive/include/captive/client-vfs.h src/libcaptive/include/captive/client.h src/libcaptive/include/captive/config2.h src/libcaptive/include/captive/ldr.h src/libcaptive/include/captive/ldr_exports.h src/libcaptive/include/captive/leave.h src/libcaptive/include/captive/libxml.h src/libcaptive/include/captive/macros.h src/libcaptive/include/captive/mm.h src/libcaptive/include/captive/options-module.h src/libcaptive/include/captive/options.h src/libcaptive/include/captive/ps_reactos.h src/libcaptive/include/captive/rtl-file.h src/libcaptive/include/captive/signal.h src/libcaptive/include/captive/storage.h src/libcaptive/include/captive/unicode.h src/libcaptive/include/captive/unicode_reactos.h src/libcaptive/include/captive/usecount.h src/libcaptive/include/reactos/Makefile.am src/libcaptive/include/reactos/base.h src/libcaptive/include/reactos/compat.h src/libcaptive/include/reactos/ddk/Makefile.am src/libcaptive/include/reactos/ddk/ccfuncs.h src/libcaptive/include/reactos/ddk/cctypes.h src/libcaptive/include/reactos/ddk/class2.h src/libcaptive/include/reactos/ddk/cmtypes.h src/libcaptive/include/reactos/ddk/defines.h src/libcaptive/include/reactos/ddk/exfuncs.h src/libcaptive/include/reactos/ddk/extypes.h src/libcaptive/include/reactos/ddk/fsfuncs.h src/libcaptive/include/reactos/ddk/fstypes.h src/libcaptive/include/reactos/ddk/i386/Makefile.am src/libcaptive/include/reactos/ddk/iofuncs.h src/libcaptive/include/reactos/ddk/iotypes.h src/libcaptive/include/reactos/ddk/kefuncs.h src/libcaptive/include/reactos/ddk/ketypes.h src/libcaptive/include/reactos/ddk/mmfuncs.h src/libcaptive/include/reactos/ddk/mmtypes.h src/libcaptive/include/reactos/ddk/ntddk.h src/libcaptive/include/reactos/ddk/ntddscsi.h src/libcaptive/include/reactos/ddk/ntdef.h src/libcaptive/include/reactos/ddk/ntifs.h src/libcaptive/include/reactos/ddk/obfuncs.h src/libcaptive/include/reactos/ddk/pnptypes.h src/libcaptive/include/reactos/ddk/potypes.h src/libcaptive/include/reactos/ddk/psfuncs.h src/libcaptive/include/reactos/ddk/pstypes.h src/libcaptive/include/reactos/ddk/scsi.h src/libcaptive/include/reactos/ddk/sefuncs.h src/libcaptive/include/reactos/ddk/setypes.h src/libcaptive/include/reactos/ddk/srb.h src/libcaptive/include/reactos/ddk/status.h src/libcaptive/include/reactos/ddk/types.h src/libcaptive/include/reactos/defines.h src/libcaptive/include/reactos/internal/Makefile.am src/libcaptive/include/reactos/internal/cc.h src/libcaptive/include/reactos/internal/debug.h src/libcaptive/include/reactos/internal/ex.h src/libcaptive/include/reactos/internal/i386/Makefile.am src/libcaptive/include/reactos/internal/i386/ps.h src/libcaptive/include/reactos/internal/io.h src/libcaptive/include/reactos/internal/kd.h src/libcaptive/include/reactos/internal/ke.h src/libcaptive/include/reactos/internal/ldr.h src/libcaptive/include/reactos/internal/mm.h src/libcaptive/include/reactos/internal/module.h src/libcaptive/include/reactos/internal/ntoskrnl.h src/libcaptive/include/reactos/internal/ps.h src/libcaptive/include/reactos/internal/safe.h src/libcaptive/include/reactos/internal/se.h src/libcaptive/include/reactos/napi/Makefile.am src/libcaptive/include/reactos/napi/teb.h src/libcaptive/include/reactos/napi/types.h src/libcaptive/include/reactos/ntos/Makefile.am src/libcaptive/include/reactos/ntos/disk.h src/libcaptive/include/reactos/ntos/except.h src/libcaptive/include/reactos/ntos/haltypes.h src/libcaptive/include/reactos/ntos/ntdef.h src/libcaptive/include/reactos/ntos/obtypes.h src/libcaptive/include/reactos/ntos/rtl.h src/libcaptive/include/reactos/ntos/rtltypes.h src/libcaptive/include/reactos/ntos/security.h src/libcaptive/include/reactos/ntos/time.h src/libcaptive/include/reactos/ntos/tss.h src/libcaptive/include/reactos/ntos/types.h src/libcaptive/include/reactos/ntos/zw.h src/libcaptive/include/reactos/ntos/zwtypes.h src/libcaptive/include/reactos/structs.h src/libcaptive/include/reactos/unicode.h src/libcaptive/io/Makefile.am src/libcaptive/io/create.c src/libcaptive/io/device.c src/libcaptive/io/iowork.c src/libcaptive/io/irp.c src/libcaptive/io/process.c src/libcaptive/io/symlink.c src/libcaptive/kd/Makefile.am src/libcaptive/kd/kdebug.c src/libcaptive/ke/Makefile.am src/libcaptive/ke/apc.c src/libcaptive/ke/brkpoint.c src/libcaptive/ke/bug.c src/libcaptive/ke/captivesym.pl src/libcaptive/ke/catch.c src/libcaptive/ke/event.c src/libcaptive/ke/exports.captivesym src/libcaptive/ke/exports.def src/libcaptive/ke/kthread.c src/libcaptive/ke/main.c src/libcaptive/ke/sem.c src/libcaptive/ke/spinlock.c src/libcaptive/ke/timer.c src/libcaptive/ke/wait.c src/libcaptive/ldr/Makefile.am src/libcaptive/ldr/loader.c src/libcaptive/mm/Makefile.am src/libcaptive/mm/marea.c src/libcaptive/mm/mdl.c src/libcaptive/mm/memsafe.c src/libcaptive/mm/mminit.c src/libcaptive/mm/page.c src/libcaptive/mm/pool.c src/libcaptive/mm/routine.c src/libcaptive/mm/section.c src/libcaptive/nt/Makefile.am src/libcaptive/nt/ntevent.c src/libcaptive/ob/Makefile.am src/libcaptive/ob/dirobj.c src/libcaptive/ob/handle.c src/libcaptive/ob/object.c src/libcaptive/po/Makefile.am src/libcaptive/po/shutdownwork.c src/libcaptive/ps/Makefile.am src/libcaptive/ps/calltype.S src/libcaptive/ps/create.c src/libcaptive/ps/math.c src/libcaptive/ps/ps_reactos.c src/libcaptive/ps/signal.c src/libcaptive/ps/thread.c src/libcaptive/reactos/Makefile-reactos.am src/libcaptive/reactos/Makefile.am src/libcaptive/reactos/hal/Makefile-hal.am src/libcaptive/reactos/hal/Makefile.am src/libcaptive/reactos/hal/halx86/Makefile.am src/libcaptive/reactos/include/Makefile.am src/libcaptive/reactos/include/roscfg.h src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am src/libcaptive/reactos/ntoskrnl/Makefile.am src/libcaptive/reactos/ntoskrnl/dbg/Makefile.am src/libcaptive/reactos/ntoskrnl/ex/Makefile.am src/libcaptive/reactos/ntoskrnl/fs/Makefile.am src/libcaptive/reactos/ntoskrnl/io/Makefile.am src/libcaptive/reactos/ntoskrnl/ke/Makefile.am src/libcaptive/reactos/ntoskrnl/ldr/Makefile.am src/libcaptive/reactos/ntoskrnl/mm/Makefile.am src/libcaptive/reactos/ntoskrnl/nt/Makefile.am src/libcaptive/reactos/ntoskrnl/ob/Makefile.am src/libcaptive/reactos/ntoskrnl/ps/Makefile.am src/libcaptive/reactos/ntoskrnl/rtl/Makefile.am src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile.am src/libcaptive/reactos/ntoskrnl/se/Makefile.am src/libcaptive/rtl/Makefile.am src/libcaptive/rtl/ctype.c src/libcaptive/rtl/error.c src/libcaptive/rtl/except.c src/libcaptive/rtl/file.c src/libcaptive/rtl/generictable.c src/libcaptive/rtl/mem.c src/libcaptive/rtl/memcpy.c src/libcaptive/rtl/memmove.c src/libcaptive/rtl/memset.c src/libcaptive/rtl/splaylinks.c src/libcaptive/rtl/string.c src/libcaptive/rtl/unicode.c src/libcaptive/rtl/unicode_reactos.c src/libcaptive/rtl/version.c src/libcaptive/sandbox/FileInfo.c src/libcaptive/sandbox/FileInfo.h src/libcaptive/sandbox/Makefile.am src/libcaptive/sandbox/client-CaptiveIOChannel.c src/libcaptive/sandbox/client-CaptiveIOChannel.h src/libcaptive/sandbox/parent-Directory.c src/libcaptive/sandbox/parent-Directory.h src/libcaptive/sandbox/parent-File.c src/libcaptive/sandbox/parent-File.h src/libcaptive/sandbox/parent-Vfs.c src/libcaptive/sandbox/parent-Vfs.h src/libcaptive/sandbox/sandbox.idl src/libcaptive/sandbox/server-CaptiveIOChannel.c src/libcaptive/sandbox/server-CaptiveIOChannel.h src/libcaptive/sandbox/server-Directory.c src/libcaptive/sandbox/server-Directory.h src/libcaptive/sandbox/server-File.c src/libcaptive/sandbox/server-File.h src/libcaptive/sandbox/server-GLogFunc.c src/libcaptive/sandbox/server-GLogFunc.h src/libcaptive/sandbox/server-Vfs.c src/libcaptive/sandbox/server-Vfs.h src/libcaptive/sandbox/split.c src/libcaptive/sandbox/split.h src/libcaptive/se/Makefile.am src/libcaptive/se/audit.c src/libcaptive/se/priv.c src/libcaptive/se/sd.c src/libcaptive/se/semgr.c src/libcaptive/storage/Makefile.am src/libcaptive/storage/cdrom.c src/libcaptive/storage/disk.c src/libcaptive/storage/iounixchannel.c src/libcaptive/storage/iounixchannel.h src/libcaptive/storage/media.c src/libcaptive/storage/media.h src/libcaptive/storage/relastblock.c src/libcaptive/storage/relastblock.h src/libcaptive/storage/size.c src/libcaptive/storage/size.h src/w32-mod/Makefile.am src/w32-mod/ext2fsd.so-build.sh src/w32-mod/ext2fsd.sys --- .gdbinit | 30 - .vimrc | 2 - AUTHORS | 25 - COPYING | 340 - INSTALL | 229 - Makefile-head.am | 156 - Makefile.am | 88 - NEWS | 186 - README | 251 - THANKS | 26 - TODO | 51 - autogen.pl | 106 - build-static | 74 - captive.spec.in | 294 - configure.ac | 565 -- cvs2cl-usermap | 2 - debian/captive-install.conffiles | 1 - debian/captive-install.files | 5 - debian/captive-install.postinst | 22 - debian/captive-install.prerm | 21 - debian/captive-lufs.files | 5 - debian/captive.conffiles | 1 - debian/captive.docs | 5 - debian/captive.files | 10 - debian/captive.postinst | 27 - debian/captive.postrm | 31 - debian/changelog.in | 3 - debian/control | 67 - debian/copyright | 39 - debian/rules | 115 - doc/Makefile.am | 46 - doc/apiref/Makefile.am | 86 - doc/apiref/captive-apiref.types | 16 - doc/apiref/captive-apiref.xml | 24 - fonts/Makefile.am | 34 - fonts/fonts.conf.in | 22 - fonts/l048013t.pfa | 1233 ---- gnome_vfs_read_entire_file.c | 112 - include_test.c | 23 - po/cs.po | 1290 ---- src/Makefile.am | 21 - src/TraceFS/Makefile.am | 48 - src/TraceFS/TraceFS-W32/Sources | 30 - src/TraceFS/TraceFS-W32/TraceFS.c | 1630 ----- src/TraceFS/TraceFS-W32/TraceFS.def | 58 - src/TraceFS/TraceFS-W32/TraceFS.reg | 28 - src/TraceFS/TraceFS-W32/TraceFS.sys | Bin 63872 -> 0 bytes src/TraceFS/TraceFS-W32/makeFile | 22 - src/TraceFS/checktrace.pl | 1424 ----- src/TraceFS/hookfs.pl | 381 -- src/client/Makefile.am | 21 - src/client/bug-replay/Makefile.am | 29 - src/client/bug-replay/main.c | 538 -- src/client/cmdline/Makefile.am | 76 - src/client/cmdline/captive-cmdline.pod.pl.in | 71 - src/client/cmdline/cmd_cd.c | 123 - src/client/cmdline/cmd_cd.h | 46 - src/client/cmdline/cmd_close.c | 58 - src/client/cmdline/cmd_close.h | 41 - src/client/cmdline/cmd_commit.c | 63 - src/client/cmdline/cmd_commit.h | 41 - src/client/cmdline/cmd_create.c | 110 - src/client/cmdline/cmd_create.h | 41 - src/client/cmdline/cmd_get.c | 171 - src/client/cmdline/cmd_get.h | 46 - src/client/cmdline/cmd_help.c | 72 - src/client/cmdline/cmd_help.h | 41 - src/client/cmdline/cmd_info.c | 88 - src/client/cmdline/cmd_info.h | 42 - src/client/cmdline/cmd_lcd.c | 74 - src/client/cmdline/cmd_lcd.h | 41 - src/client/cmdline/cmd_ls.c | 95 - src/client/cmdline/cmd_ls.h | 42 - src/client/cmdline/cmd_mkdir.c | 72 - src/client/cmdline/cmd_mkdir.h | 41 - src/client/cmdline/cmd_mv.c | 84 - src/client/cmdline/cmd_mv.h | 42 - src/client/cmdline/cmd_open.c | 96 - src/client/cmdline/cmd_open.h | 41 - src/client/cmdline/cmd_put.c | 167 - src/client/cmdline/cmd_put.h | 46 - src/client/cmdline/cmd_quit.c | 54 - src/client/cmdline/cmd_quit.h | 41 - src/client/cmdline/cmd_rm.c | 80 - src/client/cmdline/cmd_rm.h | 42 - src/client/cmdline/cmd_rmdir.c | 79 - src/client/cmdline/cmd_rmdir.h | 42 - src/client/cmdline/cmd_shell.c | 127 - src/client/cmdline/cmd_shell.h | 41 - src/client/cmdline/cmd_volume.c | 68 - src/client/cmdline/cmd_volume.h | 41 - src/client/cmdline/file_info.c | 129 - src/client/cmdline/file_info.h | 40 - src/client/cmdline/handle.c | 129 - src/client/cmdline/handle.h | 45 - src/client/cmdline/main.c | 337 - src/client/cmdline/main.h | 76 - src/client/cmdline/utf8.c | 59 - src/client/cmdline/utf8.h | 60 - src/client/fuse/Makefile.am | 119 - src/client/fuse/captive.init | 59 - src/client/fuse/gnomevfsfileinfo.c | 118 - src/client/fuse/gnomevfsfileinfo.h | 31 - src/client/fuse/gnomevfsresult.c | 77 - src/client/fuse/gnomevfsresult.h | 30 - src/client/fuse/main.c | 279 - src/client/fuse/main.h | 30 - src/client/fuse/mount.captive.pod.pl.in | 148 - src/client/fuse/op_chmod.c | 65 - src/client/fuse/op_chmod.h | 31 - src/client/fuse/op_fsync.c | 36 - src/client/fuse/op_fsync.h | 30 - src/client/fuse/op_fsyncdir.c | 36 - src/client/fuse/op_fsyncdir.h | 30 - src/client/fuse/op_getattr.c | 59 - src/client/fuse/op_getattr.h | 31 - src/client/fuse/op_mkdir.c | 54 - src/client/fuse/op_mkdir.h | 31 - src/client/fuse/op_mknod.c | 53 - src/client/fuse/op_mknod.h | 31 - src/client/fuse/op_open.c | 56 - src/client/fuse/op_open.h | 30 - src/client/fuse/op_opendir.c | 50 - src/client/fuse/op_opendir.h | 30 - src/client/fuse/op_read.c | 54 - src/client/fuse/op_read.h | 30 - src/client/fuse/op_readdir.c | 75 - src/client/fuse/op_readdir.h | 30 - src/client/fuse/op_release.c | 44 - src/client/fuse/op_release.h | 30 - src/client/fuse/op_releasedir.c | 44 - src/client/fuse/op_releasedir.h | 30 - src/client/fuse/op_rename.c | 57 - src/client/fuse/op_rename.h | 31 - src/client/fuse/op_rmdir.c | 49 - src/client/fuse/op_rmdir.h | 31 - src/client/fuse/op_statfs.c | 56 - src/client/fuse/op_statfs.h | 30 - src/client/fuse/op_truncate.c | 52 - src/client/fuse/op_truncate.h | 31 - src/client/fuse/op_unlink.c | 51 - src/client/fuse/op_unlink.h | 31 - src/client/fuse/op_utime.c | 67 - src/client/fuse/op_utime.h | 31 - src/client/fuse/op_write.c | 54 - src/client/fuse/op_write.h | 30 - src/client/gnomevfs/Makefile.am | 38 - src/client/gnomevfs/captive.conf.in | 69 - src/client/gnomevfs/giognomevfs.c | 233 - src/client/gnomevfs/giognomevfs.h | 38 - src/client/gnomevfs/gnome-vfs-method.c | 785 --- src/client/gnomevfs/gnome-vfs-method.h | 35 - src/client/gnomevfs/gnome-vfs-module.c | 79 - src/client/gnomevfs/gnome-vfs-module.h | 31 - src/client/lufs/Makefile.am | 91 - src/client/lufs/captivefs-attr.c | 130 - src/client/lufs/captivefs-attr.h | 40 - src/client/lufs/captivefs-directory.c | 189 - src/client/lufs/captivefs-file.c | 615 -- src/client/lufs/captivefs-misc.c | 126 - src/client/lufs/captivefs-misc.h | 55 - src/client/lufs/captivefs-vfs.c | 272 - src/client/lufs/captivefs-vfs.h | 46 - src/client/lufs/lufs-captivefs.pod.pl.in | 58 - src/client/lufs/mount.captive.in | 136 - src/client/lufs/mount.captive.pod.pl.in | 149 - src/client/sandbox-server/.gdbinit | 27 - src/client/sandbox-server/Makefile.am | 51 - .../captive-sandbox-server.pod.pl.in | 65 - src/client/sandbox-server/main.c | 659 -- src/install/Makefile.am | 21 - src/install/acquire/Makefile.am | 127 - src/install/acquire/cabextract/AUTHORS | 13 - src/install/acquire/cabextract/COPYING | 340 - src/install/acquire/cabextract/ChangeLog | 261 - src/install/acquire/cabextract/INSTALL | 182 - src/install/acquire/cabextract/Makefile.am | 10 - src/install/acquire/cabextract/Makefile.in | 403 -- src/install/acquire/cabextract/NEWS | 69 - src/install/acquire/cabextract/README | 32 - src/install/acquire/cabextract/TODO | 1 - src/install/acquire/cabextract/aclocal.m4 | 127 - src/install/acquire/cabextract/cabextract.1 | 60 - src/install/acquire/cabextract/cabextract.c | 3033 --------- src/install/acquire/cabextract/cabextract.spec | 35 - src/install/acquire/cabextract/cabextract.spec.in | 35 - src/install/acquire/cabextract/cabinfo.c | 497 -- src/install/acquire/cabextract/config.h.in | 89 - src/install/acquire/cabextract/configure | 2302 ------- src/install/acquire/cabextract/configure.in | 34 - .../acquire/cabextract/debian/README.Debian | 6 - src/install/acquire/cabextract/debian/changelog | 45 - src/install/acquire/cabextract/debian/control | 14 - src/install/acquire/cabextract/debian/copyright | 13 - src/install/acquire/cabextract/debian/dirs | 5 - src/install/acquire/cabextract/debian/docs | 3 - src/install/acquire/cabextract/debian/rules | 83 - src/install/acquire/cabextract/getopt.c | 1055 --- src/install/acquire/cabextract/getopt.h | 169 - src/install/acquire/cabextract/getopt1.c | 188 - src/install/acquire/cabextract/install-sh | 251 - src/install/acquire/cabextract/ja/cabextract.1 | 70 - src/install/acquire/cabextract/magic.cabinet | 6 - src/install/acquire/cabextract/missing | 198 - src/install/acquire/cabextract/mkinstalldirs | 40 - src/install/acquire/cabextract/mktime.c | 541 -- src/install/acquire/cabextract/stamp-h.in | 1 - src/install/acquire/cabinet-memory.c | 217 - src/install/acquire/cabinet-memory.h | 57 - src/install/acquire/cabinet.c | 438 -- src/install/acquire/cabinet.h | 70 - .../acquire/captive-install-acquire.pod.pl.in | 162 - src/install/acquire/captivemodid-list.pl | 139 - src/install/acquire/captivemodid-print.pl | 692 -- src/install/acquire/captivemodid.c | 332 - src/install/acquire/captivemodid.h | 54 - src/install/acquire/compatibility-test.sh | 124 - src/install/acquire/diskscan.c | 158 - src/install/acquire/diskscan.h | 35 - src/install/acquire/final.c | 81 - src/install/acquire/final.h | 34 - src/install/acquire/main.c | 296 - src/install/acquire/main.h | 43 - src/install/acquire/microsoftcom.c | 85 - src/install/acquire/microsoftcom.h | 35 - src/install/acquire/moduriload.c | 395 -- src/install/acquire/moduriload.h | 51 - src/install/acquire/ui-gnome.c | 809 --- src/install/acquire/ui-gnome.glade | 450 -- src/install/acquire/ui-gnome.gladep | 18 - src/install/acquire/ui-gnome.h | 34 - src/install/acquire/ui-line.c | 301 - src/install/acquire/ui-line.h | 34 - src/install/acquire/w32-mod-id.captivemodid.xml | 6699 -------------------- src/install/fstab/Makefile.am | 39 - src/install/fstab/captive-install-fstab.pod.pl.in | 93 - src/install/fstab/main.c | 331 - src/install/libcaptive-install/Makefile.am | 28 - src/install/libcaptive-install/proc_partitions.c | 115 - src/install/libcaptive-install/proc_partitions.h | 36 - src/libcaptive/Makefile-libcaptive.am | 24 - src/libcaptive/Makefile.am | 67 - src/libcaptive/captive.pod.pl.in | 57 - src/libcaptive/cc/Makefile.am | 63 - src/libcaptive/cc/bcbmap.c | 152 - src/libcaptive/cc/bcbowner.c | 87 - src/libcaptive/cc/bcbpin.c | 294 - src/libcaptive/cc/bcbrepin.c | 100 - src/libcaptive/cc/bcbunpin.c | 49 - src/libcaptive/cc/cache.c | 142 - src/libcaptive/cc/copy.c | 191 - src/libcaptive/cc/dirtypages.c | 77 - src/libcaptive/cc/init.c | 167 - src/libcaptive/cc/io.c | 102 - src/libcaptive/cc/io.h | 37 - src/libcaptive/cc/loghandle.c | 48 - src/libcaptive/cc/marshallers.list | 20 - src/libcaptive/cc/misc.c | 134 - src/libcaptive/cc/mm.c | 45 - src/libcaptive/cc/privatebcb-priv.h | 45 - src/libcaptive/cc/privatebcb.c | 150 - src/libcaptive/cc/privatebcb.h | 52 - src/libcaptive/cc/privatebcbmap.c | 127 - src/libcaptive/cc/privatebcbmap.h | 50 - src/libcaptive/cc/privatebcbpin.c | 371 -- src/libcaptive/cc/privatebcbpin.h | 62 - src/libcaptive/cc/sharedcachemap-priv.h | 92 - src/libcaptive/cc/sharedcachemap.c | 1075 ---- src/libcaptive/cc/sharedcachemap.h | 81 - src/libcaptive/client/Makefile.am | 90 - src/libcaptive/client/directory-parent.c | 333 - src/libcaptive/client/directory-parent.h | 66 - src/libcaptive/client/directory-slave.c | 513 -- src/libcaptive/client/directory-slave.h | 83 - src/libcaptive/client/directory.c | 159 - src/libcaptive/client/directory.h | 50 - src/libcaptive/client/file-parent.c | 602 -- src/libcaptive/client/file-parent.h | 66 - src/libcaptive/client/file-slave.c | 893 --- src/libcaptive/client/file-slave.h | 53 - src/libcaptive/client/file.c | 236 - src/libcaptive/client/file.h | 61 - src/libcaptive/client/giochannel-blind.c | 798 --- src/libcaptive/client/giochannel-blind.h | 46 - src/libcaptive/client/giochannel-subrange.c | 277 - src/libcaptive/client/giochannel-subrange.h | 37 - src/libcaptive/client/init.c | 597 -- src/libcaptive/client/init.h | 37 - src/libcaptive/client/leave.c | 73 - src/libcaptive/client/lib.c | 157 - src/libcaptive/client/lib.h | 38 - src/libcaptive/client/libxml.c | 95 - src/libcaptive/client/marshallers.list | 19 - src/libcaptive/client/options-module.c | 141 - src/libcaptive/client/options.c | 475 -- src/libcaptive/client/options.pod.pl.in | 185 - src/libcaptive/client/parent-connector.c | 530 -- src/libcaptive/client/parent-connector.h | 123 - src/libcaptive/client/result.c | 48 - src/libcaptive/client/result.h | 36 - src/libcaptive/client/standalone-gnome.c | 70 - src/libcaptive/client/standalone-gnome.h | 35 - src/libcaptive/client/standalone.c | 79 - src/libcaptive/client/standalone.h | 37 - src/libcaptive/client/usecount.c | 37 - src/libcaptive/client/vfs-parent.c | 322 - src/libcaptive/client/vfs-parent.h | 86 - src/libcaptive/client/vfs-slave.c | 210 - src/libcaptive/client/vfs-slave.h | 46 - src/libcaptive/client/vfs.c | 164 - src/libcaptive/client/vfs.h | 64 - src/libcaptive/cm/Makefile.am | 25 - src/libcaptive/cm/ntfunc.c | 43 - src/libcaptive/cm/rtlfunc.c | 100 - src/libcaptive/ex/Makefile.am | 28 - src/libcaptive/ex/list.c | 74 - src/libcaptive/ex/lookas.c | 180 - src/libcaptive/ex/resource.c | 341 - src/libcaptive/ex/time.c | 64 - src/libcaptive/ex/work.c | 85 - src/libcaptive/fs/Makefile.am | 30 - src/libcaptive/fs/dbcsname.c | 90 - src/libcaptive/fs/filelock.c | 81 - src/libcaptive/fs/mcb.c | 814 --- src/libcaptive/fs/name.c | 192 - src/libcaptive/fs/name_pass.c | 57 - src/libcaptive/fs/notify.c | 63 - src/libcaptive/fs/oplock.c | 79 - src/libcaptive/fs/stream.c | 41 - src/libcaptive/fs/tunnel.c | 138 - src/libcaptive/fs/util.c | 43 - src/libcaptive/halcaptive/Makefile.am | 27 - src/libcaptive/halcaptive/intrlck.c | 106 - src/libcaptive/halcaptive/perfcnt.c | 56 - src/libcaptive/halcaptive/queuedspinlock.c | 151 - src/libcaptive/halcaptive/spinlock.c | 51 - src/libcaptive/include/Makefile.am | 23 - src/libcaptive/include/captive/Makefile.am | 46 - src/libcaptive/include/captive/calltype_reactos.h | 85 - src/libcaptive/include/captive/client-directory.h | 56 - src/libcaptive/include/captive/client-file.h | 67 - src/libcaptive/include/captive/client-vfs.h | 63 - src/libcaptive/include/captive/client.h | 36 - src/libcaptive/include/captive/config2.h | 105 - src/libcaptive/include/captive/ldr.h | 55 - src/libcaptive/include/captive/ldr_exports.h | 101 - src/libcaptive/include/captive/leave.h | 37 - src/libcaptive/include/captive/libxml.h | 47 - src/libcaptive/include/captive/macros.h | 367 -- src/libcaptive/include/captive/mm.h | 38 - src/libcaptive/include/captive/options-module.h | 62 - src/libcaptive/include/captive/options.h | 84 - src/libcaptive/include/captive/ps_reactos.h | 57 - src/libcaptive/include/captive/rtl-file.h | 37 - src/libcaptive/include/captive/signal.h | 34 - src/libcaptive/include/captive/storage.h | 58 - src/libcaptive/include/captive/unicode.h | 102 - src/libcaptive/include/captive/unicode_reactos.h | 76 - src/libcaptive/include/captive/usecount.h | 34 - src/libcaptive/include/reactos/Makefile.am | 35 - src/libcaptive/include/reactos/base.h | 51 - src/libcaptive/include/reactos/compat.h | 378 -- src/libcaptive/include/reactos/ddk/Makefile.am | 54 - src/libcaptive/include/reactos/ddk/ccfuncs.h | 49 - src/libcaptive/include/reactos/ddk/cctypes.h | 47 - src/libcaptive/include/reactos/ddk/class2.h | 49 - src/libcaptive/include/reactos/ddk/cmtypes.h | 46 - src/libcaptive/include/reactos/ddk/defines.h | 46 - src/libcaptive/include/reactos/ddk/exfuncs.h | 48 - src/libcaptive/include/reactos/ddk/extypes.h | 48 - src/libcaptive/include/reactos/ddk/fsfuncs.h | 48 - src/libcaptive/include/reactos/ddk/fstypes.h | 49 - .../include/reactos/ddk/i386/Makefile.am | 22 - src/libcaptive/include/reactos/ddk/iofuncs.h | 54 - src/libcaptive/include/reactos/ddk/iotypes.h | 51 - src/libcaptive/include/reactos/ddk/kefuncs.h | 49 - src/libcaptive/include/reactos/ddk/ketypes.h | 49 - src/libcaptive/include/reactos/ddk/mmfuncs.h | 48 - src/libcaptive/include/reactos/ddk/mmtypes.h | 46 - src/libcaptive/include/reactos/ddk/ntddk.h | 46 - src/libcaptive/include/reactos/ddk/ntddscsi.h | 46 - src/libcaptive/include/reactos/ddk/ntdef.h | 50 - src/libcaptive/include/reactos/ddk/ntifs.h | 50 - src/libcaptive/include/reactos/ddk/obfuncs.h | 47 - src/libcaptive/include/reactos/ddk/pnptypes.h | 48 - src/libcaptive/include/reactos/ddk/potypes.h | 46 - src/libcaptive/include/reactos/ddk/psfuncs.h | 49 - src/libcaptive/include/reactos/ddk/pstypes.h | 48 - src/libcaptive/include/reactos/ddk/scsi.h | 46 - src/libcaptive/include/reactos/ddk/sefuncs.h | 49 - src/libcaptive/include/reactos/ddk/setypes.h | 46 - src/libcaptive/include/reactos/ddk/srb.h | 47 - src/libcaptive/include/reactos/ddk/status.h | 46 - src/libcaptive/include/reactos/ddk/types.h | 46 - src/libcaptive/include/reactos/defines.h | 51 - .../include/reactos/internal/Makefile.am | 37 - src/libcaptive/include/reactos/internal/cc.h | 47 - src/libcaptive/include/reactos/internal/debug.h | 47 - src/libcaptive/include/reactos/internal/ex.h | 46 - .../include/reactos/internal/i386/Makefile.am | 23 - src/libcaptive/include/reactos/internal/i386/ps.h | 50 - src/libcaptive/include/reactos/internal/io.h | 46 - src/libcaptive/include/reactos/internal/kd.h | 47 - src/libcaptive/include/reactos/internal/ke.h | 49 - src/libcaptive/include/reactos/internal/ldr.h | 47 - src/libcaptive/include/reactos/internal/mm.h | 46 - src/libcaptive/include/reactos/internal/module.h | 46 - src/libcaptive/include/reactos/internal/ntoskrnl.h | 46 - src/libcaptive/include/reactos/internal/ps.h | 50 - src/libcaptive/include/reactos/internal/safe.h | 46 - src/libcaptive/include/reactos/internal/se.h | 47 - src/libcaptive/include/reactos/napi/Makefile.am | 24 - src/libcaptive/include/reactos/napi/teb.h | 46 - src/libcaptive/include/reactos/napi/types.h | 47 - src/libcaptive/include/reactos/ntos/Makefile.am | 35 - src/libcaptive/include/reactos/ntos/disk.h | 46 - src/libcaptive/include/reactos/ntos/except.h | 46 - src/libcaptive/include/reactos/ntos/haltypes.h | 48 - src/libcaptive/include/reactos/ntos/ntdef.h | 46 - src/libcaptive/include/reactos/ntos/obtypes.h | 49 - src/libcaptive/include/reactos/ntos/rtl.h | 50 - src/libcaptive/include/reactos/ntos/rtltypes.h | 49 - src/libcaptive/include/reactos/ntos/security.h | 46 - src/libcaptive/include/reactos/ntos/time.h | 46 - src/libcaptive/include/reactos/ntos/tss.h | 47 - src/libcaptive/include/reactos/ntos/types.h | 46 - src/libcaptive/include/reactos/ntos/zw.h | 47 - src/libcaptive/include/reactos/ntos/zwtypes.h | 49 - src/libcaptive/include/reactos/structs.h | 51 - src/libcaptive/include/reactos/unicode.h | 52 - src/libcaptive/io/Makefile.am | 29 - src/libcaptive/io/create.c | 76 - src/libcaptive/io/device.c | 63 - src/libcaptive/io/iowork.c | 140 - src/libcaptive/io/irp.c | 66 - src/libcaptive/io/process.c | 62 - src/libcaptive/io/symlink.c | 54 - src/libcaptive/kd/Makefile.am | 24 - src/libcaptive/kd/kdebug.c | 108 - src/libcaptive/ke/Makefile.am | 53 - src/libcaptive/ke/apc.c | 39 - src/libcaptive/ke/brkpoint.c | 37 - src/libcaptive/ke/bug.c | 39 - src/libcaptive/ke/captivesym.pl | 393 -- src/libcaptive/ke/catch.c | 42 - src/libcaptive/ke/event.c | 100 - src/libcaptive/ke/exports.captivesym | 464 -- src/libcaptive/ke/exports.def | 144 - src/libcaptive/ke/kthread.c | 42 - src/libcaptive/ke/main.c | 33 - src/libcaptive/ke/sem.c | 44 - src/libcaptive/ke/spinlock.c | 38 - src/libcaptive/ke/timer.c | 147 - src/libcaptive/ke/wait.c | 61 - src/libcaptive/ldr/Makefile.am | 24 - src/libcaptive/ldr/loader.c | 676 -- src/libcaptive/mm/Makefile.am | 31 - src/libcaptive/mm/marea.c | 95 - src/libcaptive/mm/mdl.c | 155 - src/libcaptive/mm/memsafe.c | 84 - src/libcaptive/mm/mminit.c | 40 - src/libcaptive/mm/page.c | 240 - src/libcaptive/mm/pool.c | 159 - src/libcaptive/mm/routine.c | 35 - src/libcaptive/mm/section.c | 95 - src/libcaptive/nt/Makefile.am | 24 - src/libcaptive/nt/ntevent.c | 48 - src/libcaptive/ob/Makefile.am | 26 - src/libcaptive/ob/dirobj.c | 48 - src/libcaptive/ob/handle.c | 53 - src/libcaptive/ob/object.c | 105 - src/libcaptive/po/Makefile.am | 24 - src/libcaptive/po/shutdownwork.c | 91 - src/libcaptive/ps/Makefile.am | 29 - src/libcaptive/ps/calltype.S | 66 - src/libcaptive/ps/create.c | 61 - src/libcaptive/ps/math.c | 138 - src/libcaptive/ps/ps_reactos.c | 52 - src/libcaptive/ps/signal.c | 443 -- src/libcaptive/ps/thread.c | 44 - src/libcaptive/reactos/Makefile-reactos.am | 32 - src/libcaptive/reactos/Makefile.am | 37 - src/libcaptive/reactos/hal/Makefile-hal.am | 19 - src/libcaptive/reactos/hal/Makefile.am | 32 - src/libcaptive/reactos/hal/halx86/Makefile.am | 29 - src/libcaptive/reactos/include/Makefile.am | 24 - src/libcaptive/reactos/include/roscfg.h | 39 - .../reactos/ntoskrnl/Makefile-ntoskrnl.am | 19 - src/libcaptive/reactos/ntoskrnl/Makefile.am | 43 - src/libcaptive/reactos/ntoskrnl/dbg/Makefile.am | 27 - src/libcaptive/reactos/ntoskrnl/ex/Makefile.am | 28 - src/libcaptive/reactos/ntoskrnl/fs/Makefile.am | 29 - src/libcaptive/reactos/ntoskrnl/io/Makefile.am | 43 - src/libcaptive/reactos/ntoskrnl/ke/Makefile.am | 33 - src/libcaptive/reactos/ntoskrnl/ldr/Makefile.am | 28 - src/libcaptive/reactos/ntoskrnl/mm/Makefile.am | 28 - src/libcaptive/reactos/ntoskrnl/nt/Makefile.am | 27 - src/libcaptive/reactos/ntoskrnl/ob/Makefile.am | 31 - src/libcaptive/reactos/ntoskrnl/ps/Makefile.am | 30 - src/libcaptive/reactos/ntoskrnl/rtl/Makefile.am | 37 - .../reactos/ntoskrnl/rtl/i386/Makefile.am | 33 - src/libcaptive/reactos/ntoskrnl/se/Makefile.am | 34 - src/libcaptive/rtl/Makefile.am | 35 - src/libcaptive/rtl/ctype.c | 40 - src/libcaptive/rtl/error.c | 49 - src/libcaptive/rtl/except.c | 76 - src/libcaptive/rtl/file.c | 200 - src/libcaptive/rtl/generictable.c | 877 --- src/libcaptive/rtl/mem.c | 85 - src/libcaptive/rtl/memcpy.c | 51 - src/libcaptive/rtl/memmove.c | 51 - src/libcaptive/rtl/memset.c | 49 - src/libcaptive/rtl/splaylinks.c | 83 - src/libcaptive/rtl/string.c | 106 - src/libcaptive/rtl/unicode.c | 681 -- src/libcaptive/rtl/unicode_reactos.c | 56 - src/libcaptive/rtl/version.c | 89 - src/libcaptive/sandbox/FileInfo.c | 129 - src/libcaptive/sandbox/FileInfo.h | 41 - src/libcaptive/sandbox/Makefile.am | 69 - src/libcaptive/sandbox/client-CaptiveIOChannel.c | 230 - src/libcaptive/sandbox/client-CaptiveIOChannel.h | 40 - src/libcaptive/sandbox/parent-Directory.c | 274 - src/libcaptive/sandbox/parent-Directory.h | 44 - src/libcaptive/sandbox/parent-File.c | 524 -- src/libcaptive/sandbox/parent-File.h | 57 - src/libcaptive/sandbox/parent-Vfs.c | 298 - src/libcaptive/sandbox/parent-Vfs.h | 42 - src/libcaptive/sandbox/sandbox.idl | 171 - src/libcaptive/sandbox/server-CaptiveIOChannel.c | 173 - src/libcaptive/sandbox/server-CaptiveIOChannel.h | 45 - src/libcaptive/sandbox/server-Directory.c | 223 - src/libcaptive/sandbox/server-Directory.h | 48 - src/libcaptive/sandbox/server-File.c | 355 -- src/libcaptive/sandbox/server-File.h | 48 - src/libcaptive/sandbox/server-GLogFunc.c | 204 - src/libcaptive/sandbox/server-GLogFunc.h | 48 - src/libcaptive/sandbox/server-Vfs.c | 236 - src/libcaptive/sandbox/server-Vfs.h | 44 - src/libcaptive/sandbox/split.c | 1032 --- src/libcaptive/sandbox/split.h | 58 - src/libcaptive/se/Makefile.am | 27 - src/libcaptive/se/audit.c | 56 - src/libcaptive/se/priv.c | 47 - src/libcaptive/se/sd.c | 52 - src/libcaptive/se/semgr.c | 250 - src/libcaptive/storage/Makefile.am | 35 - src/libcaptive/storage/cdrom.c | 59 - src/libcaptive/storage/disk.c | 68 - src/libcaptive/storage/iounixchannel.c | 64 - src/libcaptive/storage/iounixchannel.h | 36 - src/libcaptive/storage/media.c | 567 -- src/libcaptive/storage/media.h | 51 - src/libcaptive/storage/relastblock.c | 204 - src/libcaptive/storage/relastblock.h | 36 - src/libcaptive/storage/size.c | 217 - src/libcaptive/storage/size.h | 34 - src/w32-mod/Makefile.am | 27 - src/w32-mod/ext2fsd.so-build.sh | 49 - src/w32-mod/ext2fsd.sys | Bin 171325 -> 0 bytes 560 files changed, 77678 deletions(-) delete mode 100644 .gdbinit delete mode 100644 .vimrc delete mode 100644 AUTHORS delete mode 100644 COPYING delete mode 100644 INSTALL delete mode 100644 Makefile-head.am delete mode 100644 Makefile.am delete mode 100644 NEWS delete mode 100644 README delete mode 100644 THANKS delete mode 100644 TODO delete mode 100755 autogen.pl delete mode 100755 build-static delete mode 100644 captive.spec.in delete mode 100644 configure.ac delete mode 100644 cvs2cl-usermap delete mode 100644 debian/captive-install.conffiles delete mode 100644 debian/captive-install.files delete mode 100755 debian/captive-install.postinst delete mode 100755 debian/captive-install.prerm delete mode 100644 debian/captive-lufs.files delete mode 100644 debian/captive.conffiles delete mode 100644 debian/captive.docs delete mode 100644 debian/captive.files delete mode 100755 debian/captive.postinst delete mode 100755 debian/captive.postrm delete mode 100644 debian/changelog.in delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100755 debian/rules delete mode 100644 doc/Makefile.am delete mode 100644 doc/apiref/Makefile.am delete mode 100644 doc/apiref/captive-apiref.types delete mode 100644 doc/apiref/captive-apiref.xml delete mode 100644 fonts/Makefile.am delete mode 100644 fonts/fonts.conf.in delete mode 100644 fonts/l048013t.pfa delete mode 100644 gnome_vfs_read_entire_file.c delete mode 100644 include_test.c delete mode 100644 po/cs.po delete mode 100644 src/Makefile.am delete mode 100644 src/TraceFS/Makefile.am delete mode 100644 src/TraceFS/TraceFS-W32/Sources delete mode 100644 src/TraceFS/TraceFS-W32/TraceFS.c delete mode 100644 src/TraceFS/TraceFS-W32/TraceFS.def delete mode 100644 src/TraceFS/TraceFS-W32/TraceFS.reg delete mode 100644 src/TraceFS/TraceFS-W32/TraceFS.sys delete mode 100644 src/TraceFS/TraceFS-W32/makeFile delete mode 100755 src/TraceFS/checktrace.pl delete mode 100755 src/TraceFS/hookfs.pl delete mode 100644 src/client/Makefile.am delete mode 100644 src/client/bug-replay/Makefile.am delete mode 100644 src/client/bug-replay/main.c delete mode 100644 src/client/cmdline/Makefile.am delete mode 100644 src/client/cmdline/captive-cmdline.pod.pl.in delete mode 100644 src/client/cmdline/cmd_cd.c delete mode 100644 src/client/cmdline/cmd_cd.h delete mode 100644 src/client/cmdline/cmd_close.c delete mode 100644 src/client/cmdline/cmd_close.h delete mode 100644 src/client/cmdline/cmd_commit.c delete mode 100644 src/client/cmdline/cmd_commit.h delete mode 100644 src/client/cmdline/cmd_create.c delete mode 100644 src/client/cmdline/cmd_create.h delete mode 100644 src/client/cmdline/cmd_get.c delete mode 100644 src/client/cmdline/cmd_get.h delete mode 100644 src/client/cmdline/cmd_help.c delete mode 100644 src/client/cmdline/cmd_help.h delete mode 100644 src/client/cmdline/cmd_info.c delete mode 100644 src/client/cmdline/cmd_info.h delete mode 100644 src/client/cmdline/cmd_lcd.c delete mode 100644 src/client/cmdline/cmd_lcd.h delete mode 100644 src/client/cmdline/cmd_ls.c delete mode 100644 src/client/cmdline/cmd_ls.h delete mode 100644 src/client/cmdline/cmd_mkdir.c delete mode 100644 src/client/cmdline/cmd_mkdir.h delete mode 100644 src/client/cmdline/cmd_mv.c delete mode 100644 src/client/cmdline/cmd_mv.h delete mode 100644 src/client/cmdline/cmd_open.c delete mode 100644 src/client/cmdline/cmd_open.h delete mode 100644 src/client/cmdline/cmd_put.c delete mode 100644 src/client/cmdline/cmd_put.h delete mode 100644 src/client/cmdline/cmd_quit.c delete mode 100644 src/client/cmdline/cmd_quit.h delete mode 100644 src/client/cmdline/cmd_rm.c delete mode 100644 src/client/cmdline/cmd_rm.h delete mode 100644 src/client/cmdline/cmd_rmdir.c delete mode 100644 src/client/cmdline/cmd_rmdir.h delete mode 100644 src/client/cmdline/cmd_shell.c delete mode 100644 src/client/cmdline/cmd_shell.h delete mode 100644 src/client/cmdline/cmd_volume.c delete mode 100644 src/client/cmdline/cmd_volume.h delete mode 100644 src/client/cmdline/file_info.c delete mode 100644 src/client/cmdline/file_info.h delete mode 100644 src/client/cmdline/handle.c delete mode 100644 src/client/cmdline/handle.h delete mode 100644 src/client/cmdline/main.c delete mode 100644 src/client/cmdline/main.h delete mode 100644 src/client/cmdline/utf8.c delete mode 100644 src/client/cmdline/utf8.h delete mode 100644 src/client/fuse/Makefile.am delete mode 100755 src/client/fuse/captive.init delete mode 100644 src/client/fuse/gnomevfsfileinfo.c delete mode 100644 src/client/fuse/gnomevfsfileinfo.h delete mode 100644 src/client/fuse/gnomevfsresult.c delete mode 100644 src/client/fuse/gnomevfsresult.h delete mode 100644 src/client/fuse/main.c delete mode 100644 src/client/fuse/main.h delete mode 100644 src/client/fuse/mount.captive.pod.pl.in delete mode 100644 src/client/fuse/op_chmod.c delete mode 100644 src/client/fuse/op_chmod.h delete mode 100644 src/client/fuse/op_fsync.c delete mode 100644 src/client/fuse/op_fsync.h delete mode 100644 src/client/fuse/op_fsyncdir.c delete mode 100644 src/client/fuse/op_fsyncdir.h delete mode 100644 src/client/fuse/op_getattr.c delete mode 100644 src/client/fuse/op_getattr.h delete mode 100644 src/client/fuse/op_mkdir.c delete mode 100644 src/client/fuse/op_mkdir.h delete mode 100644 src/client/fuse/op_mknod.c delete mode 100644 src/client/fuse/op_mknod.h delete mode 100644 src/client/fuse/op_open.c delete mode 100644 src/client/fuse/op_open.h delete mode 100644 src/client/fuse/op_opendir.c delete mode 100644 src/client/fuse/op_opendir.h delete mode 100644 src/client/fuse/op_read.c delete mode 100644 src/client/fuse/op_read.h delete mode 100644 src/client/fuse/op_readdir.c delete mode 100644 src/client/fuse/op_readdir.h delete mode 100644 src/client/fuse/op_release.c delete mode 100644 src/client/fuse/op_release.h delete mode 100644 src/client/fuse/op_releasedir.c delete mode 100644 src/client/fuse/op_releasedir.h delete mode 100644 src/client/fuse/op_rename.c delete mode 100644 src/client/fuse/op_rename.h delete mode 100644 src/client/fuse/op_rmdir.c delete mode 100644 src/client/fuse/op_rmdir.h delete mode 100644 src/client/fuse/op_statfs.c delete mode 100644 src/client/fuse/op_statfs.h delete mode 100644 src/client/fuse/op_truncate.c delete mode 100644 src/client/fuse/op_truncate.h delete mode 100644 src/client/fuse/op_unlink.c delete mode 100644 src/client/fuse/op_unlink.h delete mode 100644 src/client/fuse/op_utime.c delete mode 100644 src/client/fuse/op_utime.h delete mode 100644 src/client/fuse/op_write.c delete mode 100644 src/client/fuse/op_write.h delete mode 100644 src/client/gnomevfs/Makefile.am delete mode 100644 src/client/gnomevfs/captive.conf.in delete mode 100644 src/client/gnomevfs/giognomevfs.c delete mode 100644 src/client/gnomevfs/giognomevfs.h delete mode 100644 src/client/gnomevfs/gnome-vfs-method.c delete mode 100644 src/client/gnomevfs/gnome-vfs-method.h delete mode 100644 src/client/gnomevfs/gnome-vfs-module.c delete mode 100644 src/client/gnomevfs/gnome-vfs-module.h delete mode 100644 src/client/lufs/Makefile.am delete mode 100644 src/client/lufs/captivefs-attr.c delete mode 100644 src/client/lufs/captivefs-attr.h delete mode 100644 src/client/lufs/captivefs-directory.c delete mode 100644 src/client/lufs/captivefs-file.c delete mode 100644 src/client/lufs/captivefs-misc.c delete mode 100644 src/client/lufs/captivefs-misc.h delete mode 100644 src/client/lufs/captivefs-vfs.c delete mode 100644 src/client/lufs/captivefs-vfs.h delete mode 100644 src/client/lufs/lufs-captivefs.pod.pl.in delete mode 100755 src/client/lufs/mount.captive.in delete mode 100644 src/client/lufs/mount.captive.pod.pl.in delete mode 100644 src/client/sandbox-server/.gdbinit delete mode 100644 src/client/sandbox-server/Makefile.am delete mode 100644 src/client/sandbox-server/captive-sandbox-server.pod.pl.in delete mode 100644 src/client/sandbox-server/main.c delete mode 100644 src/install/Makefile.am delete mode 100644 src/install/acquire/Makefile.am delete mode 100644 src/install/acquire/cabextract/AUTHORS delete mode 100644 src/install/acquire/cabextract/COPYING delete mode 100644 src/install/acquire/cabextract/ChangeLog delete mode 100644 src/install/acquire/cabextract/INSTALL delete mode 100644 src/install/acquire/cabextract/Makefile.am delete mode 100644 src/install/acquire/cabextract/Makefile.in delete mode 100644 src/install/acquire/cabextract/NEWS delete mode 100644 src/install/acquire/cabextract/README delete mode 100644 src/install/acquire/cabextract/TODO delete mode 100644 src/install/acquire/cabextract/aclocal.m4 delete mode 100644 src/install/acquire/cabextract/cabextract.1 delete mode 100644 src/install/acquire/cabextract/cabextract.c delete mode 100644 src/install/acquire/cabextract/cabextract.spec delete mode 100644 src/install/acquire/cabextract/cabextract.spec.in delete mode 100644 src/install/acquire/cabextract/cabinfo.c delete mode 100644 src/install/acquire/cabextract/config.h.in delete mode 100755 src/install/acquire/cabextract/configure delete mode 100644 src/install/acquire/cabextract/configure.in delete mode 100644 src/install/acquire/cabextract/debian/README.Debian delete mode 100644 src/install/acquire/cabextract/debian/changelog delete mode 100644 src/install/acquire/cabextract/debian/control delete mode 100644 src/install/acquire/cabextract/debian/copyright delete mode 100644 src/install/acquire/cabextract/debian/dirs delete mode 100644 src/install/acquire/cabextract/debian/docs delete mode 100755 src/install/acquire/cabextract/debian/rules delete mode 100644 src/install/acquire/cabextract/getopt.c delete mode 100644 src/install/acquire/cabextract/getopt.h delete mode 100644 src/install/acquire/cabextract/getopt1.c delete mode 100755 src/install/acquire/cabextract/install-sh delete mode 100644 src/install/acquire/cabextract/ja/cabextract.1 delete mode 100644 src/install/acquire/cabextract/magic.cabinet delete mode 100755 src/install/acquire/cabextract/missing delete mode 100755 src/install/acquire/cabextract/mkinstalldirs delete mode 100644 src/install/acquire/cabextract/mktime.c delete mode 100644 src/install/acquire/cabextract/stamp-h.in delete mode 100644 src/install/acquire/cabinet-memory.c delete mode 100644 src/install/acquire/cabinet-memory.h delete mode 100644 src/install/acquire/cabinet.c delete mode 100644 src/install/acquire/cabinet.h delete mode 100644 src/install/acquire/captive-install-acquire.pod.pl.in delete mode 100755 src/install/acquire/captivemodid-list.pl delete mode 100755 src/install/acquire/captivemodid-print.pl delete mode 100644 src/install/acquire/captivemodid.c delete mode 100644 src/install/acquire/captivemodid.h delete mode 100755 src/install/acquire/compatibility-test.sh delete mode 100644 src/install/acquire/diskscan.c delete mode 100644 src/install/acquire/diskscan.h delete mode 100644 src/install/acquire/final.c delete mode 100644 src/install/acquire/final.h delete mode 100644 src/install/acquire/main.c delete mode 100644 src/install/acquire/main.h delete mode 100644 src/install/acquire/microsoftcom.c delete mode 100644 src/install/acquire/microsoftcom.h delete mode 100644 src/install/acquire/moduriload.c delete mode 100644 src/install/acquire/moduriload.h delete mode 100644 src/install/acquire/ui-gnome.c delete mode 100644 src/install/acquire/ui-gnome.glade delete mode 100644 src/install/acquire/ui-gnome.gladep delete mode 100644 src/install/acquire/ui-gnome.h delete mode 100644 src/install/acquire/ui-line.c delete mode 100644 src/install/acquire/ui-line.h delete mode 100644 src/install/acquire/w32-mod-id.captivemodid.xml delete mode 100644 src/install/fstab/Makefile.am delete mode 100644 src/install/fstab/captive-install-fstab.pod.pl.in delete mode 100644 src/install/fstab/main.c delete mode 100644 src/install/libcaptive-install/Makefile.am delete mode 100644 src/install/libcaptive-install/proc_partitions.c delete mode 100644 src/install/libcaptive-install/proc_partitions.h delete mode 100644 src/libcaptive/Makefile-libcaptive.am delete mode 100644 src/libcaptive/Makefile.am delete mode 100644 src/libcaptive/captive.pod.pl.in delete mode 100644 src/libcaptive/cc/Makefile.am delete mode 100644 src/libcaptive/cc/bcbmap.c delete mode 100644 src/libcaptive/cc/bcbowner.c delete mode 100644 src/libcaptive/cc/bcbpin.c delete mode 100644 src/libcaptive/cc/bcbrepin.c delete mode 100644 src/libcaptive/cc/bcbunpin.c delete mode 100644 src/libcaptive/cc/cache.c delete mode 100644 src/libcaptive/cc/copy.c delete mode 100644 src/libcaptive/cc/dirtypages.c delete mode 100644 src/libcaptive/cc/init.c delete mode 100644 src/libcaptive/cc/io.c delete mode 100644 src/libcaptive/cc/io.h delete mode 100644 src/libcaptive/cc/loghandle.c delete mode 100644 src/libcaptive/cc/marshallers.list delete mode 100644 src/libcaptive/cc/misc.c delete mode 100644 src/libcaptive/cc/mm.c delete mode 100644 src/libcaptive/cc/privatebcb-priv.h delete mode 100644 src/libcaptive/cc/privatebcb.c delete mode 100644 src/libcaptive/cc/privatebcb.h delete mode 100644 src/libcaptive/cc/privatebcbmap.c delete mode 100644 src/libcaptive/cc/privatebcbmap.h delete mode 100644 src/libcaptive/cc/privatebcbpin.c delete mode 100644 src/libcaptive/cc/privatebcbpin.h delete mode 100644 src/libcaptive/cc/sharedcachemap-priv.h delete mode 100644 src/libcaptive/cc/sharedcachemap.c delete mode 100644 src/libcaptive/cc/sharedcachemap.h delete mode 100644 src/libcaptive/client/Makefile.am delete mode 100644 src/libcaptive/client/directory-parent.c delete mode 100644 src/libcaptive/client/directory-parent.h delete mode 100644 src/libcaptive/client/directory-slave.c delete mode 100644 src/libcaptive/client/directory-slave.h delete mode 100644 src/libcaptive/client/directory.c delete mode 100644 src/libcaptive/client/directory.h delete mode 100644 src/libcaptive/client/file-parent.c delete mode 100644 src/libcaptive/client/file-parent.h delete mode 100644 src/libcaptive/client/file-slave.c delete mode 100644 src/libcaptive/client/file-slave.h delete mode 100644 src/libcaptive/client/file.c delete mode 100644 src/libcaptive/client/file.h delete mode 100644 src/libcaptive/client/giochannel-blind.c delete mode 100644 src/libcaptive/client/giochannel-blind.h delete mode 100644 src/libcaptive/client/giochannel-subrange.c delete mode 100644 src/libcaptive/client/giochannel-subrange.h delete mode 100644 src/libcaptive/client/init.c delete mode 100644 src/libcaptive/client/init.h delete mode 100644 src/libcaptive/client/leave.c delete mode 100644 src/libcaptive/client/lib.c delete mode 100644 src/libcaptive/client/lib.h delete mode 100644 src/libcaptive/client/libxml.c delete mode 100644 src/libcaptive/client/marshallers.list delete mode 100644 src/libcaptive/client/options-module.c delete mode 100644 src/libcaptive/client/options.c delete mode 100644 src/libcaptive/client/options.pod.pl.in delete mode 100644 src/libcaptive/client/parent-connector.c delete mode 100644 src/libcaptive/client/parent-connector.h delete mode 100644 src/libcaptive/client/result.c delete mode 100644 src/libcaptive/client/result.h delete mode 100644 src/libcaptive/client/standalone-gnome.c delete mode 100644 src/libcaptive/client/standalone-gnome.h delete mode 100644 src/libcaptive/client/standalone.c delete mode 100644 src/libcaptive/client/standalone.h delete mode 100644 src/libcaptive/client/usecount.c delete mode 100644 src/libcaptive/client/vfs-parent.c delete mode 100644 src/libcaptive/client/vfs-parent.h delete mode 100644 src/libcaptive/client/vfs-slave.c delete mode 100644 src/libcaptive/client/vfs-slave.h delete mode 100644 src/libcaptive/client/vfs.c delete mode 100644 src/libcaptive/client/vfs.h delete mode 100644 src/libcaptive/cm/Makefile.am delete mode 100644 src/libcaptive/cm/ntfunc.c delete mode 100644 src/libcaptive/cm/rtlfunc.c delete mode 100644 src/libcaptive/ex/Makefile.am delete mode 100644 src/libcaptive/ex/list.c delete mode 100644 src/libcaptive/ex/lookas.c delete mode 100644 src/libcaptive/ex/resource.c delete mode 100644 src/libcaptive/ex/time.c delete mode 100644 src/libcaptive/ex/work.c delete mode 100644 src/libcaptive/fs/Makefile.am delete mode 100644 src/libcaptive/fs/dbcsname.c delete mode 100644 src/libcaptive/fs/filelock.c delete mode 100644 src/libcaptive/fs/mcb.c delete mode 100644 src/libcaptive/fs/name.c delete mode 100644 src/libcaptive/fs/name_pass.c delete mode 100644 src/libcaptive/fs/notify.c delete mode 100644 src/libcaptive/fs/oplock.c delete mode 100644 src/libcaptive/fs/stream.c delete mode 100644 src/libcaptive/fs/tunnel.c delete mode 100644 src/libcaptive/fs/util.c delete mode 100644 src/libcaptive/halcaptive/Makefile.am delete mode 100644 src/libcaptive/halcaptive/intrlck.c delete mode 100644 src/libcaptive/halcaptive/perfcnt.c delete mode 100644 src/libcaptive/halcaptive/queuedspinlock.c delete mode 100644 src/libcaptive/halcaptive/spinlock.c delete mode 100644 src/libcaptive/include/Makefile.am delete mode 100644 src/libcaptive/include/captive/Makefile.am delete mode 100644 src/libcaptive/include/captive/calltype_reactos.h delete mode 100644 src/libcaptive/include/captive/client-directory.h delete mode 100644 src/libcaptive/include/captive/client-file.h delete mode 100644 src/libcaptive/include/captive/client-vfs.h delete mode 100644 src/libcaptive/include/captive/client.h delete mode 100644 src/libcaptive/include/captive/config2.h delete mode 100644 src/libcaptive/include/captive/ldr.h delete mode 100644 src/libcaptive/include/captive/ldr_exports.h delete mode 100644 src/libcaptive/include/captive/leave.h delete mode 100644 src/libcaptive/include/captive/libxml.h delete mode 100644 src/libcaptive/include/captive/macros.h delete mode 100644 src/libcaptive/include/captive/mm.h delete mode 100644 src/libcaptive/include/captive/options-module.h delete mode 100644 src/libcaptive/include/captive/options.h delete mode 100644 src/libcaptive/include/captive/ps_reactos.h delete mode 100644 src/libcaptive/include/captive/rtl-file.h delete mode 100644 src/libcaptive/include/captive/signal.h delete mode 100644 src/libcaptive/include/captive/storage.h delete mode 100644 src/libcaptive/include/captive/unicode.h delete mode 100644 src/libcaptive/include/captive/unicode_reactos.h delete mode 100644 src/libcaptive/include/captive/usecount.h delete mode 100644 src/libcaptive/include/reactos/Makefile.am delete mode 100644 src/libcaptive/include/reactos/base.h delete mode 100644 src/libcaptive/include/reactos/compat.h delete mode 100644 src/libcaptive/include/reactos/ddk/Makefile.am delete mode 100644 src/libcaptive/include/reactos/ddk/ccfuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/cctypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/class2.h delete mode 100644 src/libcaptive/include/reactos/ddk/cmtypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/defines.h delete mode 100644 src/libcaptive/include/reactos/ddk/exfuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/extypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/fsfuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/fstypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/i386/Makefile.am delete mode 100644 src/libcaptive/include/reactos/ddk/iofuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/iotypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/kefuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/ketypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/mmfuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/mmtypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/ntddk.h delete mode 100644 src/libcaptive/include/reactos/ddk/ntddscsi.h delete mode 100644 src/libcaptive/include/reactos/ddk/ntdef.h delete mode 100644 src/libcaptive/include/reactos/ddk/ntifs.h delete mode 100644 src/libcaptive/include/reactos/ddk/obfuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/pnptypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/potypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/psfuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/pstypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/scsi.h delete mode 100644 src/libcaptive/include/reactos/ddk/sefuncs.h delete mode 100644 src/libcaptive/include/reactos/ddk/setypes.h delete mode 100644 src/libcaptive/include/reactos/ddk/srb.h delete mode 100644 src/libcaptive/include/reactos/ddk/status.h delete mode 100644 src/libcaptive/include/reactos/ddk/types.h delete mode 100644 src/libcaptive/include/reactos/defines.h delete mode 100644 src/libcaptive/include/reactos/internal/Makefile.am delete mode 100644 src/libcaptive/include/reactos/internal/cc.h delete mode 100644 src/libcaptive/include/reactos/internal/debug.h delete mode 100644 src/libcaptive/include/reactos/internal/ex.h delete mode 100644 src/libcaptive/include/reactos/internal/i386/Makefile.am delete mode 100644 src/libcaptive/include/reactos/internal/i386/ps.h delete mode 100644 src/libcaptive/include/reactos/internal/io.h delete mode 100644 src/libcaptive/include/reactos/internal/kd.h delete mode 100644 src/libcaptive/include/reactos/internal/ke.h delete mode 100644 src/libcaptive/include/reactos/internal/ldr.h delete mode 100644 src/libcaptive/include/reactos/internal/mm.h delete mode 100644 src/libcaptive/include/reactos/internal/module.h delete mode 100644 src/libcaptive/include/reactos/internal/ntoskrnl.h delete mode 100644 src/libcaptive/include/reactos/internal/ps.h delete mode 100644 src/libcaptive/include/reactos/internal/safe.h delete mode 100644 src/libcaptive/include/reactos/internal/se.h delete mode 100644 src/libcaptive/include/reactos/napi/Makefile.am delete mode 100644 src/libcaptive/include/reactos/napi/teb.h delete mode 100644 src/libcaptive/include/reactos/napi/types.h delete mode 100644 src/libcaptive/include/reactos/ntos/Makefile.am delete mode 100644 src/libcaptive/include/reactos/ntos/disk.h delete mode 100644 src/libcaptive/include/reactos/ntos/except.h delete mode 100644 src/libcaptive/include/reactos/ntos/haltypes.h delete mode 100644 src/libcaptive/include/reactos/ntos/ntdef.h delete mode 100644 src/libcaptive/include/reactos/ntos/obtypes.h delete mode 100644 src/libcaptive/include/reactos/ntos/rtl.h delete mode 100644 src/libcaptive/include/reactos/ntos/rtltypes.h delete mode 100644 src/libcaptive/include/reactos/ntos/security.h delete mode 100644 src/libcaptive/include/reactos/ntos/time.h delete mode 100644 src/libcaptive/include/reactos/ntos/tss.h delete mode 100644 src/libcaptive/include/reactos/ntos/types.h delete mode 100644 src/libcaptive/include/reactos/ntos/zw.h delete mode 100644 src/libcaptive/include/reactos/ntos/zwtypes.h delete mode 100644 src/libcaptive/include/reactos/structs.h delete mode 100644 src/libcaptive/include/reactos/unicode.h delete mode 100644 src/libcaptive/io/Makefile.am delete mode 100644 src/libcaptive/io/create.c delete mode 100644 src/libcaptive/io/device.c delete mode 100644 src/libcaptive/io/iowork.c delete mode 100644 src/libcaptive/io/irp.c delete mode 100644 src/libcaptive/io/process.c delete mode 100644 src/libcaptive/io/symlink.c delete mode 100644 src/libcaptive/kd/Makefile.am delete mode 100644 src/libcaptive/kd/kdebug.c delete mode 100644 src/libcaptive/ke/Makefile.am delete mode 100644 src/libcaptive/ke/apc.c delete mode 100644 src/libcaptive/ke/brkpoint.c delete mode 100644 src/libcaptive/ke/bug.c delete mode 100755 src/libcaptive/ke/captivesym.pl delete mode 100644 src/libcaptive/ke/catch.c delete mode 100644 src/libcaptive/ke/event.c delete mode 100644 src/libcaptive/ke/exports.captivesym delete mode 100644 src/libcaptive/ke/exports.def delete mode 100644 src/libcaptive/ke/kthread.c delete mode 100644 src/libcaptive/ke/main.c delete mode 100644 src/libcaptive/ke/sem.c delete mode 100644 src/libcaptive/ke/spinlock.c delete mode 100644 src/libcaptive/ke/timer.c delete mode 100644 src/libcaptive/ke/wait.c delete mode 100644 src/libcaptive/ldr/Makefile.am delete mode 100644 src/libcaptive/ldr/loader.c delete mode 100644 src/libcaptive/mm/Makefile.am delete mode 100644 src/libcaptive/mm/marea.c delete mode 100644 src/libcaptive/mm/mdl.c delete mode 100644 src/libcaptive/mm/memsafe.c delete mode 100644 src/libcaptive/mm/mminit.c delete mode 100644 src/libcaptive/mm/page.c delete mode 100644 src/libcaptive/mm/pool.c delete mode 100644 src/libcaptive/mm/routine.c delete mode 100644 src/libcaptive/mm/section.c delete mode 100644 src/libcaptive/nt/Makefile.am delete mode 100644 src/libcaptive/nt/ntevent.c delete mode 100644 src/libcaptive/ob/Makefile.am delete mode 100644 src/libcaptive/ob/dirobj.c delete mode 100644 src/libcaptive/ob/handle.c delete mode 100644 src/libcaptive/ob/object.c delete mode 100644 src/libcaptive/po/Makefile.am delete mode 100644 src/libcaptive/po/shutdownwork.c delete mode 100644 src/libcaptive/ps/Makefile.am delete mode 100644 src/libcaptive/ps/calltype.S delete mode 100644 src/libcaptive/ps/create.c delete mode 100644 src/libcaptive/ps/math.c delete mode 100644 src/libcaptive/ps/ps_reactos.c delete mode 100644 src/libcaptive/ps/signal.c delete mode 100644 src/libcaptive/ps/thread.c delete mode 100644 src/libcaptive/reactos/Makefile-reactos.am delete mode 100644 src/libcaptive/reactos/Makefile.am delete mode 100644 src/libcaptive/reactos/hal/Makefile-hal.am delete mode 100644 src/libcaptive/reactos/hal/Makefile.am delete mode 100644 src/libcaptive/reactos/hal/halx86/Makefile.am delete mode 100644 src/libcaptive/reactos/include/Makefile.am delete mode 100644 src/libcaptive/reactos/include/roscfg.h delete mode 100644 src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/dbg/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/ex/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/fs/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/io/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/ke/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/ldr/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/mm/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/nt/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/ob/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/ps/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/rtl/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile.am delete mode 100644 src/libcaptive/reactos/ntoskrnl/se/Makefile.am delete mode 100644 src/libcaptive/rtl/Makefile.am delete mode 100644 src/libcaptive/rtl/ctype.c delete mode 100644 src/libcaptive/rtl/error.c delete mode 100644 src/libcaptive/rtl/except.c delete mode 100644 src/libcaptive/rtl/file.c delete mode 100644 src/libcaptive/rtl/generictable.c delete mode 100644 src/libcaptive/rtl/mem.c delete mode 100644 src/libcaptive/rtl/memcpy.c delete mode 100644 src/libcaptive/rtl/memmove.c delete mode 100644 src/libcaptive/rtl/memset.c delete mode 100644 src/libcaptive/rtl/splaylinks.c delete mode 100644 src/libcaptive/rtl/string.c delete mode 100644 src/libcaptive/rtl/unicode.c delete mode 100644 src/libcaptive/rtl/unicode_reactos.c delete mode 100644 src/libcaptive/rtl/version.c delete mode 100644 src/libcaptive/sandbox/FileInfo.c delete mode 100644 src/libcaptive/sandbox/FileInfo.h delete mode 100644 src/libcaptive/sandbox/Makefile.am delete mode 100644 src/libcaptive/sandbox/client-CaptiveIOChannel.c delete mode 100644 src/libcaptive/sandbox/client-CaptiveIOChannel.h delete mode 100644 src/libcaptive/sandbox/parent-Directory.c delete mode 100644 src/libcaptive/sandbox/parent-Directory.h delete mode 100644 src/libcaptive/sandbox/parent-File.c delete mode 100644 src/libcaptive/sandbox/parent-File.h delete mode 100644 src/libcaptive/sandbox/parent-Vfs.c delete mode 100644 src/libcaptive/sandbox/parent-Vfs.h delete mode 100644 src/libcaptive/sandbox/sandbox.idl delete mode 100644 src/libcaptive/sandbox/server-CaptiveIOChannel.c delete mode 100644 src/libcaptive/sandbox/server-CaptiveIOChannel.h delete mode 100644 src/libcaptive/sandbox/server-Directory.c delete mode 100644 src/libcaptive/sandbox/server-Directory.h delete mode 100644 src/libcaptive/sandbox/server-File.c delete mode 100644 src/libcaptive/sandbox/server-File.h delete mode 100644 src/libcaptive/sandbox/server-GLogFunc.c delete mode 100644 src/libcaptive/sandbox/server-GLogFunc.h delete mode 100644 src/libcaptive/sandbox/server-Vfs.c delete mode 100644 src/libcaptive/sandbox/server-Vfs.h delete mode 100644 src/libcaptive/sandbox/split.c delete mode 100644 src/libcaptive/sandbox/split.h delete mode 100644 src/libcaptive/se/Makefile.am delete mode 100644 src/libcaptive/se/audit.c delete mode 100644 src/libcaptive/se/priv.c delete mode 100644 src/libcaptive/se/sd.c delete mode 100644 src/libcaptive/se/semgr.c delete mode 100644 src/libcaptive/storage/Makefile.am delete mode 100644 src/libcaptive/storage/cdrom.c delete mode 100644 src/libcaptive/storage/disk.c delete mode 100644 src/libcaptive/storage/iounixchannel.c delete mode 100644 src/libcaptive/storage/iounixchannel.h delete mode 100644 src/libcaptive/storage/media.c delete mode 100644 src/libcaptive/storage/media.h delete mode 100644 src/libcaptive/storage/relastblock.c delete mode 100644 src/libcaptive/storage/relastblock.h delete mode 100644 src/libcaptive/storage/size.c delete mode 100644 src/libcaptive/storage/size.h delete mode 100644 src/w32-mod/Makefile.am delete mode 100755 src/w32-mod/ext2fsd.so-build.sh delete mode 100644 src/w32-mod/ext2fsd.sys diff --git a/.gdbinit b/.gdbinit deleted file mode 100644 index 8424929..0000000 --- a/.gdbinit +++ /dev/null @@ -1,30 +0,0 @@ -# $Id$ -# gdb init script for convenient debugging -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# for $(top_srcdir)/src/libcaptive/ps/signal.c -handle SIGSEGV nostop noprint pass -set env LD_PRELOAD=/usr/lib/libefence.so -# FIXME: _append_ to the previous LD_LIBRARY_PATH value -set env LD_LIBRARY_PATH ./src/libcaptive/.libs/ -file ./src/client/cmdline/.libs/captive-cmdline -set args --load-module=$HOME/.captive/ntoskrnl.exe --filesystem=$HOME/.captive/fs.sys --disk --blind /tmp/captive.bin #--debug-messages -b main -run -# break when the W32 fs module is already loaded -#b captive_signal_init -cont diff --git a/.vimrc b/.vimrc deleted file mode 100644 index a847f58..0000000 --- a/.vimrc +++ /dev/null @@ -1,2 +0,0 @@ -set ts=2 -set sw=2 diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index b8160d9..0000000 --- a/AUTHORS +++ /dev/null @@ -1,25 +0,0 @@ -Author of "captive" - libcaptive and libcaptive clients: -Jan Kratochvil - http://www.jankratochvil.net/ - -captive is based on ReactOS - ReactOS authors are listed in reactos/CREDITS -file if not specified by ReactOS otherwise. - http://www.reactos.com/ - -GPL patches for GPL-ed ReactOS compatibility with the GPL-ed project "captive" -have authorship of Jan Kratochvil. Some of those patches were alrady integrated -into ReactOS CVS repository ":pserver:cvsanon@osexperts.com:/CVS/ReactOS", the -others remain maintained in my "reactos" repository branch "captive" -against branchpoint "bp_captive". - http://cvs.jankratochvil.net/viewcvs/reactos/?only_with_tag=captive - -Integrated small parts of Wine are originally covered by LGPL-2.1. -According to point 3 of LGPL-2.1 it was chosen to apply the terms of GPL-2.0 -instead to get fully compatible license with captive project. - http://www.winehq.com/ - -Integrated cabextract by Stuart Caie licensed according to GPL-2.0. - http://www.kyz.uklinux.net/cabextract.php - -Supplied Ext2fsd by Matt Wu licensed according to GPL-2.0. - http://sys.xiloo.com/projects/projects.htm#ext2fsd diff --git a/COPYING b/COPYING deleted file mode 100644 index 5b6e7c6..0000000 --- a/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, 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 or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -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 give any other recipients of the Program a copy of this License -along with the Program. - -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 Program or any portion -of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -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 Program, 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 Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) 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; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, 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 executable. However, as a -special exception, the source code 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. - -If distribution of executable or 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 counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program 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. - - 5. 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 Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program 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 to -this License. - - 7. 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 Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program 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 Program. - -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. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program 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. - - 9. The Free Software Foundation may publish revised and/or new versions -of the 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 Program -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 Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, 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 - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), 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 Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. 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 program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/INSTALL b/INSTALL deleted file mode 100644 index a4b3414..0000000 --- a/INSTALL +++ /dev/null @@ -1,229 +0,0 @@ -Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the `--target=TYPE' option to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/Makefile-head.am b/Makefile-head.am deleted file mode 100644 index 3df623b..0000000 --- a/Makefile-head.am +++ /dev/null @@ -1,156 +0,0 @@ -# $Id$ -# automake source include to the begin of all Makefile.am's -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# defined WANT_GTK_DOC if you plan to include macros/Makefile-gtk-doc.am - - -# Set all needed variables to their empty values to prevent "variable `...' not defined" -# Any further settings should be done exclusively by += operator -EXTRA_DIST= -BUILT_SOURCES= -CLEANFILES= -MAINTAINERCLEANFILES= -PHONY= -# default DEFAULT_INCLUDES=' -I. -I$(srcdir)'.(dirnames of 'CONFIG_HEADER') , -# we neeed such $(DEFAULT_INCLUDES) but we need to prefer our $(INCLUDES) -# thus we postpone them later by moving them to $(AM_CPPFLAGS). -# It prevent us the inclusion of own wrappers -# when we want direct include during (test) compilations -# in $(top_srcdir)/src/libcaptive/include/reactos/ -# as -I. is always as one of the first '-I's in $(INCLUDES). -# It will be utilized in $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am . -# It would be also possible to use some #include_next's but it is pretty -# hassle to guess the right ordering in such case. -# FIXME: $(addprefix ) and $(dir /) are GNU make dependent! -AM_CPPFLAGS=-I. -I$(srcdir) $(addprefix -I,$(dir $(CONFIG_HEADER))) -# 'DEFAULT_INCLUDES=' will drop its contents. -# 'DEFAULT_INCLUDES:=' will cause: automake-X.Y/am/compile.am: DEFAULT_INCLUDES was set with `:=' and is now set with `=' -# %DEFAULT_INCLUDES% is permitted only in automake system files. -# No possibility to keep its state therefore we generate -# (I hope) the same contents in 'AM_CPPFLAGS=...' line above -DEFAULT_INCLUDES= -INCLUDES= -lib_LTLIBRARIES= -pkginclude_HEADERS= -bin_PROGRAMS= -sbin_PROGRAMS= -noinst_HEADERS= -# Prevent: noinst_DATA was already defined in condition TRUE, which implies condition MAINTAINER_MODE_TRUE -# You should only unconditionally do: noinst_DATA+=... -noinst_DATA=$(noinst_DATA__include_test_all_stamp) - -# Custom variables -captive_library=$(top_builddir)/src/libcaptive/libcaptive.la -localedir=$(datadir)/locale - -# Standard settings -INCLUDES+=-DLOCALEDIR=\"$(localedir)\" -INCLUDES+=-I$(top_srcdir)/src/libcaptive/include -INCLUDES+=-I$(top_srcdir)/intl - -# Force delete of target file if command fails. -# Generally better behaviour but it requires GNU make. Harmless otherwise. -.DELETE_ON_ERROR: - -.PHONY: $(PHONY) - -# This target is used during ./autogen.pl POTFILES.in generation -PHONY+=distfiles -distfiles: $(DISTFILES) - @if test -n "$(DISTFILES_PRINT)";then \ - echo -n ":DISTFILES:"; \ - for distfile in . $(DISTFILES);do \ - if test -n 1 \ - -a "$$distfile" '!=' . \ - -a "$$distfile" '!=' Makefile.am \ - -a "$$distfile" '!=' Makefile.in \ - ;then \ - if echo " $(BUILT_SOURCES) "|grep -q " $$distfile ";then :;else \ - echo -n " $(subdir)/$$distfile"; \ - fi; \ - fi; \ - done; \ - echo; \ - fi; - @for subdir in . $(SUBDIRS);do \ - if test "$$subdir" = . -o "$$subdir" = intl -o "$$subdir" = po -o "$$subdir" = m4;then :;else \ - (cd "$$subdir" && $(MAKE) $(AM_MAKEFLAGS) distfiles) || exit 1; \ - fi; \ - done - -# check for macros/Makefile-gtk-doc.am inclusion -# FIXME: GNU make dependent! -# use to bypass automake but apply to GNU make - ifdef WANT_GTK_DOC -dist-hook-local: - else -dist-hook: - endif - for i in _built_sources_pad $(BUILT_SOURCES);do \ - $(RM) -r $(distdir)/$$i; \ - done - - -# Test compilability of all local separate include files -CLEANFILES+=.include_test.o .include_test_all.stamp -if MAINTAINER_MODE -noinst_DATA__include_test_all_stamp=.include_test_all.stamp -else -noinst_DATA__include_test_all_stamp= -endif - -# FIXME: Use separate .stamp file for each of $(noinst_HEADERS) -# we would need some pattern substituion which means GNU make dependency -.include_test_all.stamp: $(HEADERS) $(top_srcdir)/include_test.c - @set -e;for header in . $(HEADERS);do \ - if test "$$header" '!=' .;then \ - $(COMPILE) -include "$$header" -o .include_test.o -c $(top_srcdir)/include_test.c; \ - fi; \ - done - @rm -f include_test.o - @touch $@ - - -# Unfortunately we need to use this never-invocated target -# to get $(COMPILE) variable definition. -# Do not: .include_test_false.c -# as automake-1.9.5-1 would produce invalid rules for file: .c -MAINTAINERCLEANFILES+=_include_test_false.c -BUILT_SOURCES+=_include_test_false.c -if NEVER -noinst_PROGRAMS=_include_test_false -endif -_include_test_false.c: - @touch $@ - -if HAVE_PERL -%.pod: %.pod.pl - $(PERL) $< >$@ - -endif -if HAVE_POD2MAN -%.1: %.pod - $(POD2MAN) --section=1 $< >$@ - -%.7: %.pod - $(POD2MAN) --section=7 $< >$@ - -%.8: %.pod - $(POD2MAN) --section=8 $< >$@ - -endif diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 9617e7f..0000000 --- a/Makefile.am +++ /dev/null @@ -1,88 +0,0 @@ -# $Id$ -# automake source for the toplevel Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -AUTOMAKE_OPTIONS=gnu -ACLOCAL_AMFLAGS=-I macros -SUBDIRS=macros src doc fonts po -## to automatically rebuild aclocal.m4 if any of the macros in -## `macros/' change -@MAINT@include macros/macros.dep -@MAINT@macros/macros.dep: macros/Makefile.am -@MAINT@ cd macros && $(MAKE) macros.dep - -REACTOS_SOURCES= \ - reactos/hal \ - reactos/include \ - reactos/ntoskrnl - -EXTRA_DIST+= \ - INSTALL \ - THANKS \ - mkinstalldirs \ - captive.spec.in \ - Makefile-head.am \ - include_test.c \ - autogen.pl \ - .vimrc \ - .gdbinit \ - ChangeLog \ - $(REACTOS_SOURCES) \ - debian/captive-lufs.files \ - debian/captive-install.conffiles \ - debian/captive-install.files \ - debian/captive-install.postinst \ - debian/captive-install.prerm \ - debian/captive.conffiles \ - debian/captive.docs \ - debian/captive.files \ - debian/captive.postinst \ - debian/captive.postrm \ - debian/changelog.in \ - debian/control \ - debian/copyright \ - debian/rules \ - cvs2cl-usermap \ - gnome_vfs_read_entire_file.c \ - build-static - -ROS_CVS:= \ - $(foreach rosdir,$(REACTOS_SOURCES),$(shell find $(rosdir) -name CVS -type d)) - -BUILT_SOURCES+= \ - $(ROS_CVS) - -# Needed for dpkg-buildpackage(1): -EXTRA_DIST+=debian/changelog - -MAINTAINERCLEANFILES+= \ - ChangeLog - -CLEANFILES+= \ - ChangeLog.bak - -if MAINTAINER_MODE -ChangeLog: - cvs2cl --usermap cvs2cl-usermap --window 3600 --separate-header --no-wrap --file $@ . $(REACTOS_SOURCES) - -else -ChangeLog: - touch $@ - -endif diff --git a/NEWS b/NEWS deleted file mode 100644 index 75493a1..0000000 --- a/NEWS +++ /dev/null @@ -1,186 +0,0 @@ -$Id$ - - -NEWS for captive-1.1.6 ----------------------- - - - -NEWS for captive-1.1.5 (2004-01-18) ----------------------- - -* Fixed ignorance of the file truncate operation via LUFS (Matthias R.) -* Support for reading of HIDDEN SYSTEM NTFS files via LUFS -* Fixed refusal to mount some NT4.0 NTFSes (Nerijus Baliunas, Scott Chevalley) -* Support /dev/ataraid devices (Ivan Tonov) - - -NEWS for captive-1.1.4 (2003-12-13) ----------------------- - -* Unicode/UTF8 localized filenames conversion for GNU/Linux is now supported -* Various GNU/Linux distributions compatibility fixes -* Fixed omitted captive-install-acquire(1) --microsoft-com progress bar -* Fixed captive-install-acquire(1) --scan-disks* memory leaks (Steve Wampler) -* Fixed captive-install-acquire(1) --scan-disks* performance - - -NEWS for captive-1.1.3.2 (2003-12-07) ------------------------- - -* Proper unmount: no auto-chkdsk and no W2K BSOD (Geoff Talvola/Marek Koch) -* Prevent "mv dir dir/subdir" (Ulrich Mueller) -* Workaround Linux kernel bug wrt update of NTFS last sector superblock-backup -* Fixed directory listings of files with invalid timestamps (Graeme/Unit3) -* Fixed refusal of filesystem ops related to NTFS security (Tonda Nebuzelsky) -* Fixed refusal of mounting some NTFS drives -* Identify German W32 XP (No Service Pack) Free Build (Moritz Moeller-Herrmann) - - -(captive-1.1.3.1 was never released) -(captive-1.1.3 was never released) - - -NEWS for captive-1.1.2 (2003-12-01) ----------------------- - -* Fixed false identification of MS-Windows XP driver cabinets as drivers -* Extended the set of MS-Windows XP drivers identified as Captive compatible - - -NEWS for captive-1.1.1.2 (2003-11-30) ------------------------- - -* Mounted NTFS partitions are now public readable: rwx------ is now rwxr-xr-x -* Fixed refusal (crash) to mount some kind of NTFS disk drives (Nir Misgav) -* Fixed refusal to write >64MB files on some NTFS disk drives (Charles Duffy) -* Fixed crash (=>no disk changes) during unmount of some NTFSes (Nir Misgav) -* Extended the set of MS-Windows XP drivers identified as Captive compatible -* Compatibility with SMP MS-Windows XP kernel binaries - - -(captive-1.1.1.1 was never released) -(captive-1.1.1 was never released) - - -NEWS for captive-1.1 (2003-11-27) --------------------- - -* Distributed as 'captive-static' fully independent single package -* Allow concurrent file access by multiple handles - fixes scp(1) copying -* Installer now features MS-Windows drivers download retries from microsoft.com -* Installer compatibility and UI lockup fixes -* Fixed SUSE-9.0 package installation compatibility (Christian Kristukat) - - -NEWS for captive-1.0.2 (2003-11-06) ----------------------- - -* Fixed sandbox chroot(2) compatibility bug (debugging by Christian Kristukat) -* Fixed serious sandbox-server spawn memory leak for big files copying to NTFS -* Improved performance - 1GHz CPU: read 1.5MB/s, write 500KB/s, 20MB of RAM -* Various GNU/Linux distributions compatibility fixes - - -NEWS for captive-1.0.1 (2003-10-28) ----------------------- - -* Fixed (harmless) crash/hang of lufsd during post-unmount cleanup -* Fixed captive-install-acquire Gnome UI responsiveness during network outage -* Support for LUFS options such as uid/gid/fmask/dmask (reqd by Javier Urien) -* New captive-cmdline(1) 'get'/'put' options -b|--buffer-size -* Improved performance - - -NEWS for captive-1.0 (2003-10-20) --------------------- - -* First public release - - -NEWS for captive-0.9.7 (2003-10-15) ----------------------- - -* Fixed NTFS crash on journalling file (?) extension (bugreport by Martin Drab) - - -NEWS for captive-0.9.6 (2003-10-13) ----------------------- - -* Fixed /etc/fstab updating by 'install' package - - -NEWS for captive-0.9.5 (2003-10-11) ----------------------- - -* Retained ntfs.sys mounting back again (bugreport by Martin Drab) -* Avoid /tmp to solve crossdeviced /tmp and /var/... (bugreport by Martin Drab) - - -NEWS for captive-0.9.4 (2003-10-10) ----------------------- - -* Fixed FAT32 bootability after any file written (bugreport by Pavouk) -* Fixed mc(1) file copy to destination Captive filesystem (bugreport by Pavouk) - - -NEWS for captive-0.9.3 (2003-10-06) ----------------------- - -* Fixed deployment issues -* Fixed crash of parent on crash of slave during its shutdown -* Fixed Cache Manager flush-related crash affecting FAT32 by fastfat.sys -* Fixed memory consumption by non-journalled filesystems (fastfat.sys) - - -NEWS for captive-0.9.2 (2003-10-03) ----------------------- - -* Fixed read-only media mounting - - -NEWS for captive-0.9.1 (2003-09-29) ----------------------- - -* Package deployment nuances fixed; 'ntfs' disks are no longer auto-mounted -* Fixed ORBit chroot(2)ing permissions failure - - -NEWS for captive-0.9 (2003-09-23) --------------------- - -* Multifilesystem capability by new CaptiveVfsObject -* Finished and deployed CORBA sandbox separation -* Implemented filesystem unmount to successfuly remount ntfs volume -* Generates --bug-pathname resources file for sandbox crash bugreport -* Implemented TraceFS W32 Cache Manager debug tracer -* Rewritten Cache Manager to better match its W32 original behaviour -* LUFS (Linux Userland File System) module to be Linux kernel filesystem -* Written fstab & W32 modules installer as package 'install' - - -NEWS for captive-0.8 (2003-05-02) --------------------- - -* ntfs.sys working incl. readwrite mode (0.9 update: very buggy access) - - -NEWS for captive-0.2 (2003-04-17) --------------------- - -* Implemented cdecl/stdcall/fastcall function calling types -* Implemented Gnome-VFS-2.0 module interface -* cdfs.sys working -* Implemented readwrite mode -* fastfat.sys working incl. readwrite mode -* W32 binary ntoskrnl.exe is now a mandatory requirement -* ext2fsd.sys working incl. readwrite mode -* Implemented real cmdline client -* Implemented non-fatal W32 Structured Exception Handlers (SEH) - - -NEWS for captive-0.1 (2002-10-31) --------------------- - -* Project build framework done -* W32 binary module loading success diff --git a/README b/README deleted file mode 100644 index fcdcaea..0000000 --- a/README +++ /dev/null @@ -1,251 +0,0 @@ -$Id$ - - -Operation Captive ------------------ - -Existing binary Microsoft Windows file system drivers were exploited -for accessing drives with possibly proprietary file system data structures. -Open file system API is provided to access these file system drivers. -Microsoft Windows system components required by these drivers -were analyzed and successfuly emulated in the GNU/Linux operating system. - -The implementation allows applications running under the GNU/Linux operating -system to access NTFS drives. File system driver compatibility with VFAT, -ISO9660 and EXT2 is also provided. - - -Project Home ------------- - -http://www.jankratochvil.net/ - - -Overview --------- - -Any errors from 'captive-lufs' are written to '/var/log/messages'. - -Needed drivers (at least ntoskrnl.exe+ntfs.sys) must be in '/var/lib/captive'. - -'captive' package creates 'captive' user and 'captive' group on your system. - - -Drivers Availability --------------------- - -All the source packages involved in this project are GNU General Public License -2.0 (GPL-2.0) compatible (see the file "AUTHORS" for details). The purpose of -this project is to run the original Microsoft Windows drivers to get the best -filesystem compatibility and safety ever reachable. This is the method known -most by the Wine http://www.winehq.com/ project. Required driver files: - - ntoskrnl.exe - Windows NT kernel; required for ANY use of this project. - ntfs.sys - NTFS filesystem driver; required to access NTFS disk drives. - -Run captive-install-acquire(1) installer for proper guided steps. - - -Packaged Installations ----------------------- - -Required W32 drivers were automatically found if Microsoft Windows XP is -installed on any NTFS or FAT partitions. FAT partitions must be already -mounted. You may want to run captive-install-acquire(1) to check the drivers -state and possibly update them. Installer uses X Windows or console -automatically. - -Any NTFS disk partitions were automatically added to /etc/fstab. -These partitions are now available for mount by - mount /mnt/captive-DISK_LABEL - -NTFS disk drives can be also mounted by - mkdir /mnt/drive-c - mount -t captive-ntfs /dev/hda1 /mnt/drive-c - - -If you do not use the captive-install-acquire(1) installer you may also -copy the drivers yourself - at least "ntoskrnl.exe" and "ntfs.sys". -They should be stored in '/var/lib/captive' directory (lowercased filenames). -These driver must be from Microsoft Windows XP while -Service Pack 1 Check Build U.S. is their preferred version: - http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/checkedbuild.asp - - -Command-line client access only: - -NTFS disk drives can be also accessed without Linux kernel support by: - captive-cmdline \ - --load-module=/var/lib/captive/ntoskrnl.exe \ - --filesystem=/var/lib/captive/ntfs.sys \ - --sandbox-server=/usr/sbin/captive-sandbox-server \ - --bug-pathname=/tmp/captive-bug-%FT%T.captivebug.xml.gz \ - --disk --rw /dev/hda1 - (Backslash end-of-line characters '\' to be omitted for line continuation.) - -In the case of 'sandbox' invocation error it can be also run directly but -read/write (--rw) mode is definitely discouraged in such case: - captive-cmdline \ - --load-module=/var/lib/captive/ntoskrnl.exe \ - --filesystem=/var/lib/captive/ntfs.sys \ - --disk --rw /dev/hda1 - (Backslash end-of-line characters '\' to be omitted for line continuation.) - - -Gnome-VFS aware applications can access NTFS disk drives by: - gnomevfs-info file:///dev/hda1#captive-ntfs:/config.sys - gnomevfs-copy file:///dev/hda1#captive-ntfs:/config.sys /tmp/ -You can replace 'captive-ntfs' by other supported methods, see: - /etc/gnome-vfs-2.0/modules/captive.conf - -(Gnome-VFS client is not contained in 'captive-static' package.) - - - -Source Installations --------------------- - -Case #1 - All packages installed: - ./configure --enable-lufs --enable-install-pkg -Case #2 - Packages without installer: - ./configure --enable-lufs -Case #3 - Command-line client (or Gnome-VFS) access only: - ./configure -'configure' will compile 'Case #1' or 'Case #2' automatically if possible -when run with no arguments. For generic instructions see the file 'INSTALL' -otherwise run: - ./configure --help - -Compile by: - make - -Now you have './src/client/cmdline/captive-cmdline' available for testing. - -Manual addition of user and group 'captive' is required for '--sandbox-server'. -User 'captive' should have its group 'captive'. Login should be forbidden. -Commands may vary on your system, please consult groupadd(8) and useradd(8): - groupadd captive - useradd -g captive -r -s /sbin/nologin captive - -Later you may invoke standard: - make install - -Both these steps will be suggested during 'make install' if appropriate: -You may need to add '/usr/local/lib' line (without quotes) to your -'/etc/ld.so.conf' file. You may also need to run as 'root' user: - ldconfig - - -Bug Reporting -------------- - -Captive produces its bugreports automatically in '/var/lib/captive' directory -named by 'bug-yyyy-mm-ddThh:mm:ss.captivebug.xml.gz' template. Microsoft -Windows subsystem emulation failures should be reproducible from this snapshot -file. You should attempt to minimize the number of operations from the mount -operation till the expected crash to minimize the snapshot file size. - - !!! Be aware '.captivebug.xml.gz' will contain data from your disk drive !!! - - -CVS Bleeding Edge ------------------ - -cvs -d :pserver:pserver@cvs.jankratochvil.net:/cvs login - Just hit ENTER (empty password) -cvs -d :pserver:pserver@cvs.jankratochvil.net:/cvs -z3 checkout captive -cd captive -cvs -d :pserver:pserver@cvs.jankratochvil.net:/cvs -z3 checkout -r captive -kk reactos -./autogen.pl -make -./src/client/cmdline/captive-cmdline --load-module=/var/lib/captive/ntoskrnl.exe --filesystem=/var/lib/captive/ntfs.sys --disk --blind /dev/hda1 - - -Files Overview --------------- - -User: -src/client/lufs - Linux Userland File System module to access NTFS filesystem. -src/client/sandbox-server - Security+safety wrapper of emulated W32 environment. - Disable during debugging sessions. -src/client/cmdline - Simple ftp(1)-like client. - Fallback if LUFS client not usable; also useful during debugging. -src/install - 'captive-install' package contents -src/install/fstab - Search and add/remove 'captive-ntfs' /etc/fstab entries. -src/install/acquire - Search/download needed MS Windows XP driver files. -src/install/acquire/w32-mod-id.captivemodid.xml - List of supported W32 drivers. - -Developer: -src/client/gnomevfs - gnomevfs-copy(1) file:///dev/hda1#captive-ntfs:/config.sys -src/client/bug-replay - Debugging engine for files by --bug-pathname. -src/libcaptive/ke/exports.captivesym - List of implemented W32 API functions. -src/libcaptive/cc - Windows NT Cache Manager. -src/TraceFS - TraceFS W32 Cache Manager debug tracer utilities. -src/TraceFS/TraceFS-W32 - TraceFS native W32 Cache Manager debug tracer. -src/libcaptive/sandbox - CORBA/ORBit security+safety sandbox-server separation. -src/libcaptive/client - Code for interfacing libcaptive to its clients. -src/libcaptive/halcaptive - W32 hal.dll of captive. -src/libcaptive/include/captive - Include files for future 3rd party clients. -src/libcaptive/include/reactos - ReactOS include wrappers for UNIX gcc(1). -src/libcaptive/reactos - Build skeleton for gcc(1) compilation of ReactOS. -src/libcaptive/reactos/ntoskrnl - Compatible parts of ReactOS ntoskrnl.exe. -src/libcaptive/reactos/hal - Compatible parts of ReactOS hal.dll. -src/libcaptive/rtl/unicode.c - Interface UNIX UCS4/UTF8 vs. W32 UCS2 unicode. -src/libcaptive/storage - HDD/CD-ROM virtual block device UNIX<->W32 drivers. -src/libcaptive/se - Void security manager granting everything to everyone. -src/install/acquire/cabextract - Modified cabextract(1) for 'acquire'. -src/w32-mod - Supplied W32 driver module files. -macros - Generic AutoGen framework used by './autogen.pl' CVS bootstrapper. -captive.spec.in - Red Hat Linux packaging. -debian - Debian GNU/Linux packaging. - - -Linux-NTFS Project ------------------- - -http://linux-ntfs.sourceforge.net/ is the most serious competitive NTFS driver -implementation. It is fully GPL-2.0 licensed and it needs no proprietary -drivers requirements. It should be now fully reliable for read/only operations. -Read/write operations are supported only for rewriting existing data blocks of -existing files - no file/directory create/delete operations possible. - -'captive-install' package of this project uses 'Linux-NTFS' driver to obtain -the original drivers from Microsoft Windows XP already installed on existing -NTFS disk partition by 'ntfsprogs' NTFS read/only access. 'ntfsprogs' are no -longer used afterwards. - -Although Linux-NTFS Project contains a lot of valuable reverse-engineering work -it is completely separated effort from Captive project, no knowledge can be -shared. Linux-NTFS revere-engineers on-disk data structures while Captive -reverse-engineers internal Windows NT kernel API. - - -Drivers Availability Details ----------------------------- - -Microsoft Windows driver files are copyrighted by Microsoft corporation and -therefore they were not supplied along with this project. It is expected you -already have valid Microsoft Windows license if you need NTFS disk drive access -at all. Currently this project supports only driver files of Microsoft Windows -XP; other versions (such as NT-4.0, 2000 or 2003 Server) are currently not yet -supported. You still may safely access your NTFS disk drive of a different -MS-Windows version although depending on your country you may not have legal -rights to download the needed Microsoft Windows XP drivers if not owning -exactly the XP version license. - -These drivers have only debugging meaning as such disks are well supported: - ext2fsd.sys - GNU/Linux EXT2 filesystem driver; supplied in: src/w32-mod/ - fastfat.sys - FAT filesystem driver; required for (V)FAT-12/16/32 drives. - cdfs.sys - CDFS/ISO-9660 filesystem driver; required for CD-ROM media. - - -Installation ------------- - -See the file 'INSTALL'. - - -Copyright ---------- - -See the file 'COPYING' and 'AUTHORS'. diff --git a/THANKS b/THANKS deleted file mode 100644 index 59d36f8..0000000 --- a/THANKS +++ /dev/null @@ -1,26 +0,0 @@ -$Id$ - - -Thanks ------- - - * Karel Zatoukal, Sun Microsystems - * Tim Boudreau, Sun Microsystems - * Jiri Cermak, Baker & McKenzie - preflight IT law analysis - http://www.bakernet.com/ - * Martin "MJ" Mares - http://www.ucw.cz/~mj/ - * Lubomir Bulej - * Tomas Bures - * Lukas "Klokan" Horalek - services hosting - * Martin Drab - betatesting, LUFS patches - * Pavel "Pavouk" Ruzicka, GTS - betatesting - http://www.pavouk.org/ - * Christian Kristukat - SUSE support - * Jesse Glick, Sun Microsystems - betatesting - * Michal "MIKC" Conos - betatesting - * Matt Wu, Ext2fsd developer - W32 tips - http://sys.xiloo.com/ - http://sys.xiloo.com/projects/projects.htm#ext2fsd - * Steven Edwards, ReactOS developer - W32 tips - * Casper Hornstrup, ReactOS developer - W32 tips diff --git a/TODO b/TODO deleted file mode 100644 index bca806d..0000000 --- a/TODO +++ /dev/null @@ -1,51 +0,0 @@ -$Id$ - - -Known Bugs ----------- - -Machine shutdown does not commit NTFS during unmount (Fred Kulack) -'liblufs-captivefs'+'libcaptive-gnomevfs' broken '-release' (Miklos Szeredi) -XMMS playing from NTFS crashes Captive (Marek Koch, Daniel Wagner) -Memory leaks during NTFS disks scanning by *-acquire (caused by libntfs?) -STATUS_LOG_FILE_FULL should be handled everywhere; not just file_write(). -NFS export of captive directory fails - LUFS bug (Gustavo Michels) -libcaptive/cc/ mmap(2)s whole SharedCacheMap; ext2fsd maps whole disk area! -Debian: 'Conflicts: liborbit2 (<< 2.8.2)' vs. '2.6.1-1' => use Debian static. -MDK-9.2: libORBit2-2.8.2 is not sufficient, 2.8.3 is OK -GID of chroot element should not be important if r/o (Aurore Totoche) -Unhandled mount of non-NTFS disk by ntfs.sys (Sebastian Werner) -captive-static-1.1.5-0.i386.rpm: captive:x:100:101:Captive Sandbox:/var/lib/@PACKAGE@:/sbin/nologin -configure.ac: check LUFS: could not parse options! -LUFS: prepmod: SuSE: <200408191322.12920.thawes@althusius.net> -implement RtlGetOwnerSecurityDescriptor; <412DB407.15436.97BCB@localhost> -mount(8) as non-root first fails prepmod <9fb8d649f646ee7ac97039863b9f67f0@62.123.129.59> -LUFS rename() does not overwrite the target object <423029BE.5020405@hanneslau.de> - - -TODO ----- - -Microsoft Windows 2000, NT-4.0, 2003-Server drivers compatibility. -User-specifiable proxy for captive-install-acquire (not just the GConf one). -Microsoft Windows RAID not supported - another driver would be required. -Check function calling convention types in *.def files. -Better BLKGETSIZE64 vs. BLKGETSIZE run-time availability compatibility. -'src/client/gnomevfs/captive.conf' should be generated. -'src/install/acquire/cabextract/' should be GnomeVFS cabextract:// module. -Fix 'src/install/acquire/' GTK+ compiler warning - see its 'Makefile.am'. -Unify options parsing by captive_options_parse(). -Rename 'CAPTIVE_XXX_IS_OBJECT' to 'CAPTIVE_IS_XXX_OBJECT'. -Move sandbox master 'directory_read' bufering from sandbox/ to client/. -Move sandbox master 'file_seek' 'offset' maintenance from sandbox/ to client/. -Replace cabextract for the newer and LGPLed libmspack. -'captive_options' and 'captive_options_module' should be referencible GObject. -Performance (currently 1GHz CPU: read 1.5MB/s, write 500KB/s, 20MB of RAM). -AutoGen: Use specific automake-1.6 / aclocal-1.6. -LUFS: Support also "umask" instead of just "fmask"/"dmask". -captive-install-acquire --scan-disks-quick for deadlock for inaccessible NFSes. -captive_file_parent_move(): Check dir/subdir move in 'file-slave' instead. -client/gnomevfs g_filename_*_utf8() support. -*/g_filename_*_utf8() -> LUFS Linux kernel NLS support, load_nls_default(). -Replace popt by GOption. -autogen.pl: Check libtoolize(1) version - >=1.5 is not enough (Steven N. Hirsch) diff --git a/autogen.pl b/autogen.pl deleted file mode 100755 index 7b7c1de..0000000 --- a/autogen.pl +++ /dev/null @@ -1,106 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# Run to generate the initial Makefiles etc. after CVS checkout. -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - -use lib "./macros/"; -use AutoGen; - -use Carp qw(cluck confess); - - -AutoGen->run( - "name"=>"captive", - "COPYRIGHT_HOLDER"=>'Jan Kratochvil ', - "ARGV"=>\@ARGV, - "gtk-doc-dir"=>"./doc/apiref/", - "clean"=>[qw( - _include_test_false.c - .include_test_all.stamp - *.pod.pl *.pod *.[0-9] - ./ChangeLog.bak - ./debian/changelog - ./doc/*-pod.* - ./doc/pod2htm[di].tmp - ./doc/apiref/gtk-doc.make - ./doc/apiref/gtk-doc.make-captive - ./fonts/fonts.conf - ./src/client/bug-replay/captive-bug-replay - ./src/client/cmdline/captive-cmdline - ./src/client/lufs/mount.captive - ./src/client/fuse/mount.captive - ./src/client/fuse/captive - ./src/client/sandbox-server/captive-sandbox-server - ./src/client/gnomevfs/captive.conf - ./src/install/fstab/captive-install-fstab - ./src/install/acquire/captive-install-acquire - ./src/install/acquire/ui-gnome-callbacks.[ch] - ./src/install/acquire/ui-gnome-interface.[ch] - ./src/install/acquire/ui-gnome-support.[ch] - ./src/install/acquire/ui-gnome.glade.bak - ./src/install/acquire/ui-gnome.gladep.bak - ./src/install/acquire/gnome_vfs_read_entire_file.c - ./src/libcaptive/cc/marshallers.[ch] - ./src/libcaptive/client/marshallers.[ch] - ./src/libcaptive/ke/exports.c - ./src/libcaptive/reactos/*/*.[cS] - ./src/libcaptive/sandbox/sandbox-common.c - ./src/libcaptive/sandbox/sandbox-skels.c - ./src/libcaptive/sandbox/sandbox-stubs.c - ./src/libcaptive/sandbox/sandbox.h - ./src/libcaptive/sandbox/sandbox-skelimpl.c - ./src/TraceFS/TraceFS-W32/obj - ./src/TraceFS/TraceFS-W32/objchk - ./src/TraceFS/TraceFS-W32/objfre - ./src/TraceFS/TraceFS-W32/buildchk.log - ./src/TraceFS/TraceFS-W32/buildchk.wrn - ./src/TraceFS/TraceFS-W32/buildchk.err - ./src/TraceFS/TraceFS-W32/buildfre.log - ./src/TraceFS/TraceFS-W32/buildfre.wrn - ./src/TraceFS/TraceFS-W32/buildfre.err - )], - "prep"=>sub { - # For conflicting object basenames in convenient libraries: - AutoGen->checkcommandversion("libtoolize","1.5"); - # 1.5 for AM_PROG_AS. - # 1.6 to prevent weird error wrt 'SANDBOX_IDL_SOURCES': - AutoGen->checkcommandversion("automake","1.6"); - - AutoGen::_system "gtkdocize --copy --docdir doc/apiref/"; - for my $fname ("doc/apiref/gtk-doc.make") { - my $gtk_doc_make=AutoGen::_readfile $fname; - for my $keyword (qw(EXTRA_DIST CLEANFILES)) { - $gtk_doc_make=~s/^$keyword =/$keyword +=/m or confess "$keyword not found in $fname"; - } - $gtk_doc_make=~s/^(dist-hook): dist-check-gtkdoc (dist-hook-local)$/$1: $2\n\nDISABLED_$&/m; - AutoGen::_writefile "$fname-captive",$gtk_doc_make; - } - for my $dir ("./src/install/acquire/cabextract") { - if (!-f "$dir/cabextract.c" || -f "$dir/configure.in") { - do { system $_ and die "$_: $!"; } for ("cvs update -kk -r captive $dir"); - } - } - 1; - }, - ); diff --git a/build-static b/build-static deleted file mode 100755 index 0eae6b8..0000000 --- a/build-static +++ /dev/null @@ -1,74 +0,0 @@ -#! /bin/bash -# -# $Id$ -# Relink already built package fully statically. -# Copyright (C) 2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# It is not possible to just redefine Makefile variables as there are pushed -# various threading libraries etc. all the time. - -# Designed+tested only for Fedora Core 4 (+updates). The list of libraries will -# definitely need to be changed for other distributions. - -# Required precompiled static libraries .a and some .c stubs: -STATIC_PATH=/usr/local/devel-static - - -set -e -if test "$1" != link;then - set -x - ./autogen.pl --dist - (set -x;CFLAGS="-O2" ./configure --enable-maintainer-mode --disable-shared --enable-static --enable-install-pkg \ - --enable-standalone \ - --enable-standalone-fonts=/usr/local/share/captive/fonts \ - ) 2>&1|tee errs1 - make clean - make 2>&1|tee errs2 - set +x - fi - -targets=" - src/client/fuse/mount.captive - src/client/sandbox-server/captive-sandbox-server - src/client/cmdline/captive-cmdline - src/install/acquire/captive-install-acquire - src/install/fstab/captive-install-fstab - " -# FIXME: Make all the other relinks also properly conditional. -if grep -q 's,@ENABLE_BUG_REPLAY_TRUE@,,' config.status;then - targets="$targets - src/client/bug-replay/captive-bug-replay - " - fi -(for target in $targets;do - dir=`dirname $target` - base=`basename $target` - rm -f $target - # If you want to be really bad: s/-n// and s/_OBJ/OBJ/ - objects="$(make -s -C $dir -f Makefile -f - print_objects <&1|tee errs2 -echo OK -ls -l $targets diff --git a/captive.spec.in b/captive.spec.in deleted file mode 100644 index b163f72..0000000 --- a/captive.spec.in +++ /dev/null @@ -1,294 +0,0 @@ -# $Id$ -# rpm package description file for building -# Copyright (C) 2002-2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# Build fully statically. -# /usr/local/devel-static is required to contain static libraries. -%define static 1 - - -# Temporary cludge before full 'devel' package gets deployed -%define _unpackaged_files_terminate_build 0 - -Summary: Microsoft Windows platform filesystem access. -%if %{static} -Name: @PACKAGE@-static -%else -Name: @PACKAGE@ -%endif -%define release 0 -Version: @VERSION@ -Release: %{release} -Group: System Environment/Base -Packager: Jan Kratochvil -Source: http://www.jankratochvil.net/project/captive/dist/@PACKAGE@-@VERSION@.tar.gz -License: GPL -BuildRoot: /var/tmp/@PACKAGE@-@VERSION@-%{release}-root -BuildRequires: ORBit2-devel -# Due to --with-orbit-line=link -%if ! %{static} -Requires: ORBit2 >= 2.7.0 -%endif -BuildRequires: openssl-devel -%if ! %{static} -Requires: openssl -%endif -BuildRequires: gnome-vfs2-devel -%if ! %{static} -Requires: gnome-vfs2 -%endif -BuildRequires: libxml2-devel -%if ! %{static} -Requires: libxml2 -%endif -BuildRequires: popt -%if ! %{static} -Requires: popt -%endif -BuildRequires: glib2-devel -%if ! %{static} -Requires: glib2 -%endif -BuildRequires: readline-devel -%if ! %{static} -Requires: readline -%endif -BuildRequires: gcc >= 3.0 -Obsoletes: gnome-vfs-httpcaptive -%if %{static} -BuildRequires: fuse-devel -BuildRequires: ntfsprogs-devel >= 1.8.0 -BuildRequires: libgnomeui-devel -Obsoletes: @PACKAGE@ -Obsoletes: @PACKAGE@-lufs -Obsoletes: @PACKAGE@-install -# FIXME: ?: ntfsprogs-gnomevfs < 1.1 -%else -Conflicts: @PACKAGE@-static -%endif - -%description -Existing binary Microsoft Windows file system drivers were exploited -for accessing drives with possibly proprietary file system data structures. -Open file system API is provided to access these file system drivers. -Microsoft Windows system components required by these drivers -were analyzed and successfuly emulated in the GNU/Linux operating system. - -The implementation allows applications running under the GNU/Linux operating -system to access NTFS drives. File system driver compatibility with VFAT, -ISO9660 and EXT2 is also provided. -%if %{static} -This packaging is a standalone static version, no other packages are needed. - -%else - -%package fuse -Summary: FUSE module for Microsoft Windows platform filesystem access. -Group: System Environment/Base -Requires: captive = %{PACKAGE_VERSION} -BuildRequires: fuse-devel -Requires: fuse fuse-libs - -%description fuse -FUSE is a userspace filesystem framework. - -Package provides FUSE filesystem module to access Microsoft Windows platform -filesystems such as NTFS. Use filesystem type 'captive-ntfs' for NTFS disks. - -%package install -Summary: Instant installer for Microsoft Windows platform filesystem access. -Group: System Environment/Base -Requires: captive-fuse = %{PACKAGE_VERSION} -# Versions before 1.8.0 were too buggy -BuildRequires: ntfsprogs-devel >= 1.8.0 -# 'PreReq' needed for Mandrake-9.1 otherwise '%preun install' fails -# during 'rpm -e ntfsprogs captive-install': -PreReq: ntfsprogs >= 1.8.0 -Requires: ntfsprogs >= 1.8.0 -Requires: ntfsprogs-gnomevfs -Requires: gnome-vfs-httpcaptive -BuildRequires: gnome-vfs2-devel -Requires: gnome-vfs2 -BuildRequires: libgnomeui-devel -Requires: libgnomeui -BuildRequires: readline-devel -Requires: readline -BuildRequires: libxml2-devel >= 2.4.29 -Requires: libxml2 >= 2.4.29 - -%description install -Package provides easy enough unattended installation of Microsoft Windows -platform filesystem access. Installer finds available NTFS partitions and -tries to acquire needed Microsoft Windows filesystem driver files. - -You may need to run 'captive-install-acquire' to answer several questions. -NTFS disks will become mount(8)able at directories: /mnt/captive-VOLUME_NAME - -%endif - -#% %package devel -#% Summary: Microsoft Windows platform filesystem access development support. -#% Group: Development/System -#% Requires: surprise = %{PACKAGE_VERSION} -#% -#% %description devel -#% Development package containing libraries for static linking together with -#% header files needed for any linking. -#% -#% Microsoft Windows platform filesystem access. -#% TODO - -%prep -%setup -n @PACKAGE@-%{version} - -%build -# Never disable debug for captive, see FAQ -# "How to check valid input arguments? Invalid processing state assumptions?" -%if 0 -# For AutoGen: -%configure -%endif -# 'define' of rpm(1) does not accept line-continuation backslashes ('\'). -%if %{static} -%configure \ - --disable-shared --enable-static \ - --enable-standalone \ - --enable-standalone-fonts=%{_datadir}/@PACKAGE@/fonts \ -%else -%configure \ - --enable-shared --disable-static \ - --disable-standalone \ - --disable-standalone-fonts \ -%endif - --with-readline \ - --disable-bug-replay \ - --disable-lufs \ - --enable-fuse \ - --enable-install-pkg \ - --enable-sandbox-setuid=@PACKAGE@ \ - --enable-sandbox-setgid=@PACKAGE@ \ - --enable-sandbox-chroot=%{_var}/lib/@PACKAGE@ \ - --enable-man-pages \ - --enable-sbin-mountdir=/sbin \ - --enable-sbin-mount-fs=ntfs:fastfat:cdfs:ext2fsd \ - --with-initddir=%{_initrddir} \ - --disable-gtk-doc \ - --with-orbit-line=link - -make -%if %{static} -./build-static link -%endif - -%install -make DESTDIR=$RPM_BUILD_ROOT install-strip - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -/sbin/ldconfig -/usr/sbin/groupadd -r captive 2>/dev/null || \ - /usr/sbin/groupadd captive 2>/dev/null || \ - true -/usr/sbin/useradd -r -c "Captive Sandbox" -s /sbin/nologin -g captive -d %{_var}/lib/@PACKAGE@ captive 2>/dev/null || \ - /usr/sbin/useradd -c "Captive Sandbox" -s /sbin/nologin -g captive -d %{_var}/lib/@PACKAGE@ captive 2>/dev/null || \ - true - -%if ! %{static} -%post fuse -%endif -/usr/lib/lsb/install_initd @PACKAGE@ 2>/dev/null || \ - /sbin/chkconfig --add @PACKAGE@ -touch %{_var}/lock/subsys/@PACKAGE@ - -%if ! %{static} -%post install -%endif -%{_sbindir}/captive-install-fstab --add -%{_sbindir}/captive-install-acquire --text --scan-disks-quick - -%preun - -%if ! %{static} -%preun fuse -%endif -/usr/lib/lsb/remove_initd @PACKAGE@ 2>/dev/null || \ - /sbin/chkconfig --del @PACKAGE@ -%{_initrddir}/@PACKAGE@ stop -rm -f %{_var}/lock/subsys/@PACKAGE@ - -%if ! %{static} -%preun install -%endif -%{_sbindir}/captive-install-fstab --remove - -%postun -/sbin/ldconfig -# Remove stale sandbox chroot directories owned by 'captive.captive': -rm -rf %{_var}/lib/@PACKAGE@/s-* -rm -rf %{_var}/lib/@PACKAGE@/tmp/* - -%files -%defattr(-,root,root) -%doc README NEWS AUTHORS THANKS TODO -%if ! %{static} -%{_libdir}/lib@PACKAGE@-@VERSION@.so -%{_libdir}/gnome-vfs-2.0/modules/lib@PACKAGE@-gnomevfs-@VERSION@.so -%{_libdir}/gnome-vfs-2.0/modules/lib@PACKAGE@-gnomevfs.so -%endif -%attr(644,root,root) %{_mandir}/man?/@PACKAGE@.* -%{_bindir}/@PACKAGE@-cmdline -%attr(644,root,root) %{_mandir}/man?/@PACKAGE@-cmdline.* -%attr(4755,root,root) %{_libexecdir}/@PACKAGE@-sandbox-server -%attr(644,root,root) %{_mandir}/man?/@PACKAGE@-sandbox-server.* -%config %{_sysconfdir}/gnome-vfs-2.0/modules/@PACKAGE@.conf -%{_datadir}/locale/*/LC_MESSAGES/@PACKAGE@.mo -%{_var}/lib/@PACKAGE@ - -%if ! %{static} -%files fuse -%endif -%defattr(-,root,root) -%{_initrddir}/@PACKAGE@ -/sbin/mount.@PACKAGE@ -/sbin/mount.@PACKAGE@-* -%attr(644,root,root) %{_mandir}/man?/mount.@PACKAGE@.* - -%if ! %{static} -%files install -%endif -%defattr(-,root,root) -%config %{_sysconfdir}/w32-mod-id.captivemodid.xml -%{_sbindir}/captive-install-fstab -%attr(644,root,root) %{_mandir}/man?/captive-install-fstab.* -%{_sbindir}/captive-install-acquire -%attr(644,root,root) %{_mandir}/man?/captive-install-acquire.* -%if %{static} -%{_datadir}/@PACKAGE@ -%endif - -# %files devel -# %defattr(-,root,root) -# %doc ChangeLog -# /usr/include/@PACKAGE@ -# /usr/share/aclocal/* -# %{_libdir}/gnome-vfs-2.0/modules/libcaptive-gnomevfs.la -# /usr/lib/*.a -# /usr/lib/*.la -# ###for --disable-shared/(--enable-static-link disable): -# /usr/lib/*[a-z].so diff --git a/configure.ac b/configure.ac deleted file mode 100644 index e189390..0000000 --- a/configure.ac +++ /dev/null @@ -1,565 +0,0 @@ -# $Id$ -# Source file to generate "./configure" to prepare package for compilation -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -AC_INIT(src/libcaptive/Makefile-libcaptive.am) -dnl 2.53 for AM_GLIB_GNU_GETTEXT: -AC_PREREQ(2.53) -dnl Not yet present in: Red Hat autoconf-2.57-3 -dnl AC_CONFIG_MACRO_DIR(macros) -AM_INIT_AUTOMAKE(captive,1.1.6cvs) -AM_CONFIG_HEADER(config.h) -AM_MAINTAINER_MODE -dnl Call AC_PROG_CC before AC_ISC_POSIX. -AC_PROG_CC(gcc3 gcc-3.0 gcc cc) -AC_TRY_CPP([ -#if __GNUC__ >= 3 -#else -#error "GCC version 3.0+ required at least for ReactOS anonymous unions" -#endif -],,[AC_MSG_ERROR([Captive requires GCC version 3.0+.])]) -dnl Prevent "AC_TRY_COMPILE was called before AC_ISC_POSIX": -AC_ISC_POSIX -AC_SYS_LARGEFILE -AM_PROG_AS -AM_DISABLE_STATIC -AM_ENABLE_SHARED -AM_PROG_LIBTOOL - -dnl Workaround for autoconf-2.57: -m4_pattern_allow([AC_MSG_WARN]) -m4_pattern_allow([AC_CHECK_LIB]) -m4_pattern_allow([AC_CHECK_HEADERS]) - -dnl gettext localization. -dnl Use simpler AM_GLIB_GNU_GETTEXT instead of AM_GNU_GETTEXT -dnl as we depend on glib and glib requires system installed gettext anyway. -dnl http://lists.gnome.org/archives/gtk-devel-list/2003-April/msg00066.html -dnl Special 'GETTEXT_PACKAGE' is required by glib gettext. -ALL_LINGUAS="cs" -GETTEXT_PACKAGE="$PACKAGE" -AC_SUBST(GETTEXT_PACKAGE) -AM_GLIB_GNU_GETTEXT - -GTK_DOC_CHECK -dnl AM_CONDITIONAL needs to be here explicitely for doc/apiref/Makefile rebuild -AM_CONDITIONAL(ENABLE_GTK_DOC,[test x$enable_gtk_doc = xyes]) -AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL,[test -n "$LIBTOOL"]) - -dnl Do not discard 'CFLAGS' settings as they may have been passed us by rpmbuild(8) - -dnl Define MAINTAINER_MODE in config.h. -if test "$USE_MAINTAINER_MODE" = "yes";then - AC_DEFINE(MAINTAINER_MODE,,[Turn even some software behaviour according to MAINTAINER_MODE.]) - CFLAGS="$CFLAGS -ggdb3 -Wall -Wstrict-prototypes -Wsign-compare" ## FIXME: fix all sources: -Wsign-compare - fi -dnl Some Makefiles use additional tests etc. -AM_CONDITIONAL(MAINTAINER_MODE,[test "$USE_MAINTAINER_MODE" = "yes"]) - - -AC_ARG_ENABLE(man-pages, - [ --enable-man-pages=no/yes/auto pod2man(1) required for man pages (def.=yes)],,enable_man_pages=yes) -AC_ARG_ENABLE(sbin-mountdir, - [ --enable-sbin-mountdir=DIR mount(8) 'mount.captive' directory (def.=/sbin)],, - [ enable_sbin_mountdir="/sbin" ]) -AC_ARG_ENABLE(sbin-mount-fs, - [ --enable-sbin-mount-fs=FS1:FS2 sbin-mount pre-installed symlinks (def.=ntfs:fastfat:cdfs:ext2fsd)],, - [ enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd" ]) -AC_ARG_WITH(initddir, - [ --with-initddir=DIR directory for captive FUSE shutdown (def.=/etc/rc.d/init.d)],,with_initddir=/etc/rc.d/init.d) -AC_ARG_ENABLE(sandbox-setuid, - [ --enable-sandbox-setuid=USER non-privileged user for captive-sandbox-server (def.=captive)], - [ CAPTIVE_SANDBOX_SETUID="$enableval" ],[ CAPTIVE_SANDBOX_SETUID="captive" ]) -AC_ARG_ENABLE(sandbox-setgid, - [ --enable-sandbox-setgid=GROUP non-privileged group for captive-sandbox-server (def.=captive)], - [ CAPTIVE_SANDBOX_SETGID="$enableval" ],[ CAPTIVE_SANDBOX_SETGID="captive" ]) -AC_ARG_ENABLE(sandbox-chroot, - [ --enable-sandbox-chroot=DIR root-owned directory for captive-sandbox-server (def.=/var/lib/captive)], - [ CAPTIVE_SANDBOX_CHROOT="$enableval" ],[ CAPTIVE_SANDBOX_CHROOT="/var/lib/captive" ]) -AC_ARG_ENABLE(bug-replay, - [ --enable-bug-replay=no/yes/auto compile debugging tool (def.=auto)],,enable_bug_replay=auto) -AC_ARG_ENABLE(lufs, - [ --enable-lufs=no/yes/auto compile LUFS filesystem module - DEPRECATED (def.=no)],,enable_lufs=no) -AC_ARG_ENABLE(fuse, - [ --enable-fuse=no/yes/auto compile FUSE filesystem module (def.=auto)],,enable_fuse=auto) -AC_ARG_ENABLE(install-pkg, - [ --enable-install-pkg=no/yes/auto compile installation utils (def.=auto)],,enable_install_pkg=auto) -AC_ARG_ENABLE(standalone, - [ --enable-standalone=no/yes provide initialization for static-build (def.=no)],,enable_standalone=no) -AC_ARG_ENABLE(standalone-fonts, - [ --enable-standalone-fonts=DIR provide bundled Gnome fonts in directory (def.=no)],,enable_standalone_fonts=no) - - -# AC_ARG_ENABLE(sbin-mountdir,[--enable-sbin-mountdir=DIR],,[enable_sbin_mountdir="/sbin"]) -AM_CONDITIONAL(ENABLE_SBIN_MOUNT,[test "$enable_sbin_mount" != "no"]) -AC_SUBST(enable_sbin_mountdir) - -# AC_ARG_ENABLE(sbin-mount-fs,[--enable-sbin-mount-fs=FS1:FS2],,[enable_sbin_mount_fs="ntfs:fastfat:cdfs:ext2fsd"]) -AC_SUBST(enable_sbin_mount_fs) - -# AC_ARG_ENABLE(sandbox-setuid,[--enable-sandbox-setuid=USER],,[CAPTIVE_SANDBOX_SETUID="captive"]) -AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETUID,"$CAPTIVE_SANDBOX_SETUID", - [non-privileged user for captive-sandbox-server]) -AC_SUBST(CAPTIVE_SANDBOX_SETUID) - -# AC_ARG_ENABLE(sandbox-setgid,[--enable-sandbox-setgid=GROUP],,[CAPTIVE_SANDBOX_SETGID="captive"]) -AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_SETGID,"$CAPTIVE_SANDBOX_SETGID", - [non-privileged group for captive-sandbox-server]) -AC_SUBST(CAPTIVE_SANDBOX_SETGID) - -# AC_ARG_ENABLE(sandbox-chroot,[--enable-sandbox-chroot=DIR],,[CAPTIVE_SANDBOX_CHROOT="/var/lib/captive"]) -AC_DEFINE_UNQUOTED(CAPTIVE_SANDBOX_CHROOT,"$CAPTIVE_SANDBOX_CHROOT", - [root-owned directory for captive-sandbox-server]) -AC_SUBST(CAPTIVE_SANDBOX_CHROOT) - -dnl Permit 'if NEVER' for Makefile.am-s; symbol 'FALSE' forbidden by automake -AM_CONDITIONAL(NEVER,false) - -PERL= -AC_PATH_PROGS(PERL,perl5 perl) -if test '!' -f ./src/libcaptive/ke/exports.c -a -z "$PERL";then - AC_MSG_ERROR([perl(1) required as './src/libcaptive/ke/exports.c' is not found.]) -fi -AM_CONDITIONAL(HAVE_PERL,test -n "$PERL") - -POD2MAN= -AC_PATH_PROGS(POD2MAN,pod2man) -AM_CONDITIONAL(HAVE_POD2MAN,[ test -n "$POD2MAN" ]) -if test x$enable_man_pages = xyes;then - if test -z "$POD2MAN";then - AC_MSG_ERROR([captive requires pod2man(1) for man pages; try --disable-man-pages.]) - fi - if test -z "$PERL";then - AC_MSG_ERROR([captive requires perl(1) for man pages; try --disable-man-pages.]) - fi -elif test x$enable_man_pages != xno;then - if test -z "$POD2MAN";then - AC_MSG_WARN([captive requires pod2man(1) for man pages by --enable-man-pages; mans will not be installed.]) - fi - if test -z "$PERL";then - AC_MSG_WARN([captive requires perl(1) for man pages by --enable-man-pages; mans will not be installed.]) - fi -fi -AM_CONDITIONAL(ENABLE_MAN_PAGES,[ test x$enable_man_pages != xno -a -n "$POD2MAN" -a -n "$PERL" ]) - -dnl Separate 'acconfig.h' is no longer recommended by autoconf -AH_TOP([ -#ifndef _CAPTIVE_CONFIG_H -#define _CAPTIVE_CONFIG_H 1 -]) -AH_BOTTOM([ -/* Do not place any stuff to AH_TOP as some of its includes - * would discard the effect of _FILE_OFFSET_BITS by AC_SYS_LARGEFILE. - */ - -/* Supplemental definitions not possible in this file. */ -#include "captive/config2.h" - -#endif /* !_CAPTIVE_CONFIG_H */ -]) - -dnl Do not use PKG_CHECK_MODULES() as it would not set 'GLIB_GENMARSHAL' etc. -AM_PATH_GLIB_2_0(,,[AC_MSG_ERROR([Captive requires glib-2.0 library.])],[gmodule gobject gthread]) -dnl Force glib for the whole package -CFLAGS="$CFLAGS $GLIB_CFLAGS" -LIBS="$LIBS $GLIB_LIBS" - -dnl popt -AC_CHECK_LIB(popt,poptParseArgvString,[POPT_LIBS="-lpopt"],[AC_MSG_ERROR([Captive requires popt library.])]) -AC_SUBST(POPT_LIBS) - -AC_ARG_WITH(readline,[ --with-readline=[no/yes/auto] clients with line editing (def.=auto)],,with_readline=auto) -AC_CHECK_HEADERS(readline/history.h) -dnl Check for libraries, if needed by configuration options. -if test "$with_readline" != "no" -then - if test -d "/usr/lib/termcap" - then - READLINE_LDFLAGS="$READLINE_LDFLAGS -L/usr/lib/termcap" - fi - have_libreadline=false - need_failed="" - for need in "" termcap ncurses; do - if test "x$need" != "x" - then - captive_save_LIBS="$LIBS" - AC_CHECK_LIB($need,main,, - [ need_failed="$need_failed $need" - continue ] - ) - LIBS="$captive_save_LIBS" - lneed="-l$need" - else - lneed="" - fi - dnl Prevent AC_CHECK_LIB() here as it would _cache_ the value ignoring - dnl our ever-changing "additiona libraries" parameter - captive_save_LIBS="$LIBS" - LIBS="-lreadline $lneed $READLINE_LIBS" - AC_TRY_LINK(,[ main() ], - [ have_libreadline=true - READLINE_LIBS="$LIBS" ]) - LIBS="$captive_save_LIBS" - if $have_libreadline - then - break - fi - done - if $have_libreadline - then - AC_DEFINE(HAVE_LIBREADLINE,,[Use functions from libreadline?]) - AC_CHECK_LIB(readline,add_history, - AC_DEFINE(HAVE_ADD_HISTORY,,[Use 'history' extension of libreadline?]),, - $READLINE_LIBS) - else - for need in $need_failed; do - AC_MSG_WARN(captive recommends $need library as your readline library - probably needs it.) - done - if test "$with_readline" = "yes" - then - AC_MSG_ERROR([captive did not find the requested readline library for its client line editing capability.]) - else - AC_MSG_WARN([captive recommends readline library for its client line editing capability.]) - fi - fi -fi -AC_SUBST(READLINE_LIBS) -AC_SUBST(READLINE_LDFLAGS) - -PKG_CHECK_MODULES(GNOME_VFS_MODULE,gnome-vfs-module-2.0) -GNOME_VFS_MODULE_CFLAGS="$GNOME_VFS_MODULE_CFLAGS -DCAPTIVE_USE_GNOME_VFS_MODULE=1" -AC_SUBST(GNOME_VFS_MODULE_CFLAGS) -AC_SUBST(GNOME_VFS_MODULE_LIBS) -PKG_CHECK_MODULES(GNOME_VFS,gnome-vfs-2.0) -GNOME_VFS_CFLAGS="$GNOME_VFS_CFLAGS -DCAPTIVE_USE_GNOME_VFS=1" -AC_SUBST(GNOME_VFS_CFLAGS) -AC_SUBST(GNOME_VFS_LIBS) - -# AC_ARG_ENABLE(bug-replay,[--enable-bug-replay=[no/yes/auto]],,enable_bug_replay=auto) -dnl Check for 2.5.9 for: http://bugzilla.gnome.org/show_bug.cgi?id=117702 -dnl Check the version - impossible to reliably check the missing feature. -PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.5.9,[ have_libxml_buffering=true ],[ - dnl Disable bug-replay(1) build if not met; --bug-pathname would be still OK. - PKG_CHECK_MODULES(LIBXML,libxml-2.0,[ have_libxml_buffering=false ]) - ]) -dnl We also condition 'HAVE_LIBXML_XMLREADER_H' by 'HAVE_LIBXML_BUFFERING' -dnl as we have no use for xmlreader without working libxml buffering of 2.5.9. -AM_CONDITIONAL(ENABLE_BUG_REPLAY,[$have_libxml_buffering && test x$enable_bug_replay != xno]) -if $have_libxml_buffering;then - AC_DEFINE(HAVE_LIBXML_BUFFERING,,[libxml2 correctly reads textnodes by its xmlTextReader.]) -else - if test x$enable_bug_replay = xyes;then - AC_MSG_ERROR([captive require libxml2 at least 2.5.9 for --enable-bug-replay feature.]) - elif test x$enable_bug_replay != xno;then - AC_MSG_WARN([libxml2 at least 2.5.9 required --enable-bug-replay feature; disabled now.]) - fi -fi -AC_SUBST(LIBXML_CFLAGS) -AC_SUBST(LIBXML_LIBS) - -PKG_CHECK_MODULES(OPENSSL,openssl,,[ - dnl At least Debian-3.0r1 has openssl but without its .pc module. - AC_CHECK_LIB(crypto,MD5,[ - OPENSSL_CFLAGS="" - OPENSSL_LIBS="-lcrypto" - ],[AC_MSG_ERROR([Captive requires crypto library (of openssl).])]) - ]) -AC_SUBST(OPENSSL_CFLAGS) -AC_SUBST(OPENSSL_LIBS) - -# AC_ARG_ENABLE(lufs,[--enable-lufs=[no/yes/auto]],,enable_lufs=no) -have_lufs_includes=false -# Although it would be more appropriate to use lufsmount(1) instead of lufsd(1) -# we use lufsd(1) as lufsmount(1) is just a dumb wrapper and it would cost us -# another big binary file for the static build package version. -PATH_LUFSD="" -if test x$enable_lufs != xno;then - have_lufs_includes=true - dnl If ACTION-IF-NOT-FOUND is given, it is executed when one of the header - dnl files is not found. - AC_CHECK_HEADERS(lufs/fs.h lufs/proto.h,,[ have_lufs_includes=false ]) - if test x$have_lufs_includes = xfalse;then - if test x$enable_lufs = xyes;then - AC_MSG_ERROR([LUFS client was requested (--enable-lufs) but no LUFS include files were found. Install 'lufs-*-*captive*' package.]) - else - AC_MSG_WARN([LUFS client not being compiled as no LUFS include files were found. Install 'lufs-*-*captive*' package.]) - fi - fi - AC_CHECK_TYPES([struct lufs_sbattr],,[ - dnl FIXME: Include 'lufs' version when 'lufs_sbattr' gets integrated: - if $have_lufs_includes && test x$enable_lufs = xyes;then - AC_MSG_ERROR([Although LUFS include files were found they are too old. You may also use --enable-lufs=auto.]) - else - AC_MSG_WARN([Although LUFS include files were found they are too old. df(1) will not show available NTFS disk space.]) - fi - ],[#include ]) - AC_PATH_PROGS(PATH_LUFSD,lufsd) - if test x$PATH_LUFSD = x;then - if test x$enable_lufs = xyes;then - AC_MSG_ERROR([LUFS client was requested (--enable-lufs) but no lufsd(1) binary was found. Install 'lufs-*-*captive*' package.]) - else - AC_MSG_WARN([LUFS client not being compiled as no lufsd(1) binary was found. Install 'lufs-*-*captive*' package.]) - fi - fi -fi -AM_CONDITIONAL(ENABLE_LUFS,[ $have_lufs_includes && test x$PATH_LUFSD != x -a x$enable_lufs != no ]) -if test x$ENABLE_LUFS_TRUE = x;then - AC_MSG_WARN([LUFS client is going to be compiled - LUFS is deprecated, FUSE module is recommended instead.]) -fi -AC_SUBST(PATH_LUFSD) - -# AC_ARG_ENABLE(fuse,[--enable-fuse=[no/yes/auto]],,enable_fuse=auto) -have_fuse=false -if test x$enable_fuse != xno;then - PKG_CHECK_MODULES(FUSE,fuse,[ have_fuse=true ],[ - if test x$enable_fuse = xyes;then - AC_MSG_ERROR([FUSE client was requested (--enable-fuse) but no FUSE pkg-config(1) module was found. Install 'fuse-devel' package.]) - else - AC_MSG_WARN([FUSE client not being compiled as no FUSE pkg-config(1) module was found. Install 'fuse-devel' package.]) - fi - ]) -fi -AM_CONDITIONAL(ENABLE_FUSE,[ $have_fuse ]) -# Avoid default backward compatibility mode - see the heading of: -FUSE_CFLAGS="$FUSE_CFLAGS -DFUSE_USE_VERSION=22" -AC_SUBST(FUSE_CFLAGS) -AC_SUBST(FUSE_LIBS) - -initddir= -if test x$with_initddir != xno;then - initddir="$with_initddir" -fi -AM_CONDITIONAL(WITH_INITDDIR,[ test x$with_initddir != xno ]) -AC_SUBST(initddir) - -if test x$ENABLE_LUFS_TRUE = x -a x$ENABLE_FUSE_TRUE = x;then - # mount.captive(8) file installation would conflict, that's all. - AC_MSG_ERROR([Compilation of both FUSE and LUFS modules is currently not supported - use '--disable-lufs'.]) -fi - -dnl for $(top_srcdir)/src/libcaptive/client/ -dnl Do not use '[client server]' as $4 to prevent: configure: test: too many arguments -dnl - currently this argument is not used by 'orbit2-config' in any way anyway -dnl Do not use PKG_CHECK_MODULES() as it would not set 'ORBIT_IDL' etc. -AM_PATH_ORBIT2(,,[AC_MSG_ERROR([Captive requires ORBit2 library.])]) - -AC_ARG_WITH(orbit-line,[ --with-orbit-line=[link/linc/auto] Use 'link' for ORBit2 >=2.7.x+ (def.=auto)],,with_orbit_line=auto) -captive_save_CFLAGS="$CFLAGS" -captive_save_LIBS="$LIBS" -CFLAGS="$CFLAGS $ORBIT_CFLAGS" -LIBS="$LIBS $ORBIT_LIBS" -AC_CHECK_FUNC(link_get_tmpdir,[ - AC_DEFINE(HAVE_ORBIT_LINK,,[ORBit2 is 2.7.x+ and therefore includes its own 'link' library]) - found_orbit_line=link - ], - found_orbit_line=linc - ) -CFLAGS="$captive_save_CFLAGS" -LIBS="$captive_save_LIBS" -if test "x$with_orbit_line" != "xauto" -a "x$with_orbit_line" != "x$found_orbit_line";then - AC_MSG_ERROR([--with-orbit-line=$with_orbit_line specified but the detected line is $found_orbit_line]) -fi - -if test "x$found_orbit_line" = "xlinc";then - PKG_CHECK_MODULES(LINC,linc) -fi - -# AC_ARG_ENABLE(install-pkg,[--enable-install-pkg=[no/yes/auto]],,enable_install_pkg=auto) -GLADE_W_INIT([ - ./src/install/acquire/ui-gnome-interface.c - ./src/install/acquire/ui-gnome-interface.h - ./src/install/acquire/ui-gnome-callbacks.h - ./src/install/acquire/ui-gnome-support.c - ./src/install/acquire/ui-gnome-support.h - ],[$enable_install_pkg],[ - AC_CHECK_LIB(ntfs,ntfs_mount,[ - LIBNTFS_LIBS="-lntfs" - - have_libntfs_includes=true - AC_CHECK_HEADERS - # '#include "config.h"' may be required by include files. - # "config.h" may be already present while not yet being compilable. - rm -f config.h-ntfs_save - mv -f config.h config.h-ntfs_save 2>/dev/null - touch config.h - captive_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I." # for "config.h" touched above - AC_CHECK_HEADERS(ntfs/types.h ntfs/volume.h,,[ have_libntfs_includes=false ]) - CPPFLAGS="$captive_save_CPPFLAGS" - rm -f config.h - mv -f config.h-ntfs_save config.h 2>/dev/null - if $have_libntfs_includes;then - - captive_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS" - AC_CHECK_HEADERS(libxml/xmlreader.h, - [ glade_addon=yes ], - [ AC_MSG_WARN([Captive requires libxml >= 2.4.29 for --enable-install-pkg.]) ]) - CPPFLAGS="$captive_save_CPPFLAGS" - - else - AC_MSG_WARN([Captive requires ntfs/* include files (of ntfsprogs-devel) for --enable-install-pkg.]) - fi - ],[ AC_MSG_WARN([Captive requires libntfs (of ntfsprogs-devel) for --enable-install-pkg.]) ]) - ]) -if $have_gnome;then - GNOMEUI_CFLAGS="$GNOMEUI_CFLAGS -DCAPTIVE_USING_GNOMEUI" -fi -AC_SUBST(GNOMEUI_CFLAGS) -AC_SUBST(GNOMEUI_LIBS) -AC_SUBST(LIBNTFS_LIBS) -dnl Do not: AM_CONDITIONAL(HAVE_LIBNTFS,[ test -n "$LIBNTFS_LIBS" ]) -dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG -AM_CONDITIONAL(HAVE_GLADE_WRITESOURCE,[ test "x$PATH_GLADE" != "x" ]) -dnl Do not: AM_CONDITIONAL(BUILD_GLADESRC,[ test "xyes" = "x$BUILD_GLADESRC" ]) -dnl as we do not need it as we are conditioned by ENABLE_INSTALL_PKG -GNOME_ADDON_LIBS="" -if test "x$BUILD_GLADESRC_TRUE" = "x" -then - AC_CHECK_LIB(Xi,XOpenDevice,GNOME_ADDON_LIBS="$GNOME_ADDON_LIBS -lXi") -fi -AC_SUBST(GNOME_ADDON_LIBS) -dnl $BUILD_GLADESRC is already conditioned by $enable_install_pkg by GLADE_W_INIT() -AM_CONDITIONAL(ENABLE_INSTALL_PKG,[ test "xyes" = "x$BUILD_GLADESRC" ]) - -dnl Do not use AC_REPLACE_FUNCS() as we need to link it selectively: -GNOME_VFS_READ_ENTIRE_FILE_O="" -captive_save_CFLAGS="$CFLAGS" -captive_save_LIBS="$LIBS" -CFLAGS="$CFLAGS $GNOME_VFS_MODULE_CFLAGS" -LIBS="$LIBS $GNOME_VFS_MODULE_LIBS" -AC_CHECK_FUNCS(gnome_vfs_read_entire_file,, - [ GNOME_VFS_READ_ENTIRE_FILE_O='gnome_vfs_read_entire_file.$(OBJEXT)' ]) -CFLAGS="$captive_save_CFLAGS" -LIBS="$captive_save_LIBS" -AC_SUBST(GNOME_VFS_READ_ENTIRE_FILE_O) - -if test x$enable_standalone = xyes;then - AC_DEFINE(ENABLE_STANDALONE,,[Provide initialization for static-build]) -fi - -fontsdir= -if test x$enable_standalone_fonts != xno;then - AC_DEFINE_UNQUOTED(STANDALONE_FONTSDIR,"$enable_standalone_fonts", - [Fonts installation directory for static-build]) - fontsdir="$enable_standalone_fonts" -fi -AC_SUBST(fontsdir) -AM_CONDITIONAL(ENABLE_STANDALONE_FONTS,[test "$enable_standalone_fonts" != "no"]) -dnl $have_gnome should be provided by: GLADE_W_INIT() -if test x$have_gnome != xtrue -a x$have_gnome != xfalse;then - AC_MSG_ERROR([INTERNAL: [GLADE_W_INIT()] expected here]) -fi -AM_CONDITIONAL(HAVE_GNOME,[test "$have_gnome" = "true"]) - -AC_SUBST(CFLAGS) -AC_SUBST(LIBS) - -dnl "Makefile" output files MUST have pathnames incl./excl. "./" prefix as specified! -dnl FIXME: Why the rule above was written here? -AC_OUTPUT([ -captive.spec -./src/libcaptive/captive.pod.pl -./src/libcaptive/client/options.pod.pl -./src/client/cmdline/captive-cmdline.pod.pl -./src/client/lufs/lufs-captivefs.pod.pl -./src/client/lufs/mount.captive.pod.pl -./src/client/lufs/mount.captive -./src/client/fuse/mount.captive.pod.pl -./src/client/sandbox-server/captive-sandbox-server.pod.pl -./src/install/fstab/captive-install-fstab.pod.pl -./src/install/acquire/captive-install-acquire.pod.pl -./src/client/gnomevfs/captive.conf -./po/Makefile.in -./macros/glade-w.sh -./debian/changelog -Makefile -./macros/Makefile -./src/Makefile -./src/libcaptive/Makefile -./src/libcaptive/include/Makefile -./src/libcaptive/include/captive/Makefile -./src/libcaptive/include/reactos/Makefile -./src/libcaptive/include/reactos/ddk/Makefile -./src/libcaptive/include/reactos/ddk/i386/Makefile -./src/libcaptive/include/reactos/internal/Makefile -./src/libcaptive/include/reactos/internal/i386/Makefile -./src/libcaptive/include/reactos/napi/Makefile -./src/libcaptive/include/reactos/ntos/Makefile -./src/libcaptive/reactos/Makefile -./src/libcaptive/reactos/include/Makefile -./src/libcaptive/reactos/hal/Makefile -./src/libcaptive/reactos/hal/halx86/Makefile -./src/libcaptive/reactos/ntoskrnl/Makefile -./src/libcaptive/reactos/ntoskrnl/dbg/Makefile -./src/libcaptive/reactos/ntoskrnl/ex/Makefile -./src/libcaptive/reactos/ntoskrnl/fs/Makefile -./src/libcaptive/reactos/ntoskrnl/io/Makefile -./src/libcaptive/reactos/ntoskrnl/ke/Makefile -./src/libcaptive/reactos/ntoskrnl/ldr/Makefile -./src/libcaptive/reactos/ntoskrnl/mm/Makefile -./src/libcaptive/reactos/ntoskrnl/nt/Makefile -./src/libcaptive/reactos/ntoskrnl/ob/Makefile -./src/libcaptive/reactos/ntoskrnl/ps/Makefile -./src/libcaptive/reactos/ntoskrnl/rtl/Makefile -./src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile -./src/libcaptive/reactos/ntoskrnl/se/Makefile -./src/libcaptive/halcaptive/Makefile -./src/libcaptive/cc/Makefile -./src/libcaptive/cm/Makefile -./src/libcaptive/ex/Makefile -./src/libcaptive/fs/Makefile -./src/libcaptive/io/Makefile -./src/libcaptive/kd/Makefile -./src/libcaptive/ke/Makefile -./src/libcaptive/ldr/Makefile -./src/libcaptive/mm/Makefile -./src/libcaptive/nt/Makefile -./src/libcaptive/ob/Makefile -./src/libcaptive/po/Makefile -./src/libcaptive/ps/Makefile -./src/libcaptive/rtl/Makefile -./src/libcaptive/se/Makefile -./src/libcaptive/storage/Makefile -./src/libcaptive/sandbox/Makefile -./src/libcaptive/client/Makefile -./src/client/Makefile -./src/client/bug-replay/Makefile -./src/client/cmdline/Makefile -./src/client/gnomevfs/Makefile -./src/client/lufs/Makefile -./src/client/fuse/Makefile -./src/client/sandbox-server/Makefile -./src/install/Makefile -./src/install/libcaptive-install/Makefile -./src/install/fstab/Makefile -./src/install/acquire/Makefile -./src/TraceFS/Makefile -./src/w32-mod/Makefile -./doc/Makefile -./doc/apiref/Makefile -./fonts/Makefile -./fonts/fonts.conf -]) - -dnl FIXME: Why is "po/POTFILES" being substituted? -make -C src distfiles DISTFILES_PRINT=1 \ - |sed -n 's/^:DISTFILES: *\(.*\)$/\1/p'|tr ' ' '\n'|grep . >po/POTFILES.in -make -C po Makefile - -echo done. diff --git a/cvs2cl-usermap b/cvs2cl-usermap deleted file mode 100644 index a2fb6d8..0000000 --- a/cvs2cl-usermap +++ /dev/null @@ -1,2 +0,0 @@ -short:Jan Kratochvil -lace:Jan Kratochvil diff --git a/debian/captive-install.conffiles b/debian/captive-install.conffiles deleted file mode 100644 index 8d8df86..0000000 --- a/debian/captive-install.conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/w32-mod-id.captivemodid.xml diff --git a/debian/captive-install.files b/debian/captive-install.files deleted file mode 100644 index 45e333f..0000000 --- a/debian/captive-install.files +++ /dev/null @@ -1,5 +0,0 @@ -/etc/w32-mod-id.captivemodid.xml -/usr/sbin/captive-install-fstab -/usr/man/man?/captive-install-fstab.* -/usr/sbin/captive-install-acquire -/usr/man/man?/captive-install-acquire.* diff --git a/debian/captive-install.postinst b/debian/captive-install.postinst deleted file mode 100755 index 8f913af..0000000 --- a/debian/captive-install.postinst +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/sh -# post-install script -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -/usr/sbin/captive-install-fstab --add -/usr/sbin/captive-install-acquire --scan-disks-quick - -exit 0 diff --git a/debian/captive-install.prerm b/debian/captive-install.prerm deleted file mode 100755 index 62615c7..0000000 --- a/debian/captive-install.prerm +++ /dev/null @@ -1,21 +0,0 @@ -#! /bin/sh -# pre-remove script -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -/usr/sbin/captive-install-fstab --remove - -exit 0 diff --git a/debian/captive-lufs.files b/debian/captive-lufs.files deleted file mode 100644 index e2e3b01..0000000 --- a/debian/captive-lufs.files +++ /dev/null @@ -1,5 +0,0 @@ -/usr/lib/liblufs-captivefs*.so -/usr/man/man?/lufs-captivefs.* -/sbin/mount.captive -/sbin/mount.captive-* -/usr/man/man?/mount.captive.* diff --git a/debian/captive.conffiles b/debian/captive.conffiles deleted file mode 100644 index 8d4fab0..0000000 --- a/debian/captive.conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/gnome-vfs-2.0/modules/captive.conf diff --git a/debian/captive.docs b/debian/captive.docs deleted file mode 100644 index 7d6213c..0000000 --- a/debian/captive.docs +++ /dev/null @@ -1,5 +0,0 @@ -NEWS -README -TODO -AUTHORS -THANKS diff --git a/debian/captive.files b/debian/captive.files deleted file mode 100644 index dd9aaf6..0000000 --- a/debian/captive.files +++ /dev/null @@ -1,10 +0,0 @@ -/usr/lib/libcaptive*.so -/usr/man/man?/captive.* -/usr/lib/gnome-vfs-2.0/modules/libcaptive-gnomevfs*.so -/usr/bin/captive-cmdline -/usr/man/man?/captive-cmdline.* -/usr/sbin/captive-sandbox-server -/usr/man/man?/captive-sandbox-server.* -/etc/gnome-vfs-2.0/modules/captive.conf -/usr/share/locale/*/LC_MESSAGES/captive.mo -/var/lib/captive/*.sys diff --git a/debian/captive.postinst b/debian/captive.postinst deleted file mode 100755 index c50345e..0000000 --- a/debian/captive.postinst +++ /dev/null @@ -1,27 +0,0 @@ -#! /bin/sh -# post-install script -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -if ! getent group captive >/dev/null; then - addgroup --system --quiet captive -fi -if ! getent passwd captive >/dev/null; then - adduser --quiet --system --no-create-home --home /var/lib/captive captive -fi - - -exit 0 diff --git a/debian/captive.postrm b/debian/captive.postrm deleted file mode 100755 index de363ad..0000000 --- a/debian/captive.postrm +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/sh -# post-remove script -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# Remove stale sandbox chroot directories owned by 'captive.captive': -rm -rf /var/lib/captive/s-* -rm -rf /var/lib/captive/tmp/* - - -if [ "$1" = "purge" ] ; then - deluser --quiet captive > /dev/null || true - # group may be already deleted by deluser(8) - delgroup --quiet captive &> /dev/null || true -fi - - -exit 0 diff --git a/debian/changelog.in b/debian/changelog.in deleted file mode 100644 index b3aa1c0..0000000 --- a/debian/changelog.in +++ /dev/null @@ -1,3 +0,0 @@ -captive (@VERSION@) unstable; urgency=low - * See package ChangeLog entries. - -- Jan Kratochvil Sun, 17 Aug 2003 14:16:59 +0200 diff --git a/debian/control b/debian/control deleted file mode 100644 index e8f38fe..0000000 --- a/debian/control +++ /dev/null @@ -1,67 +0,0 @@ -Source: captive -Section: contrib/base -Priority: optional -Maintainer: Jan Kratochvil -Build-Depends: debhelper (>> 3.0.0), - liborbit2-dev, - libssl-dev, - libgnomevfs2-dev, - libxml2-dev (>= 2.4.29), - libpopt-dev, - libglib2.0-dev, - libreadline4-dev, - libbonobo2-dev, - lufs, - ntfsprogs-dev, - libgnomeui-dev, - gcc (>= 3.0) | gcc-3.0, -Standards-Version: 3.5.2 - -Package: captive -Architecture: i386 -Depends: liborbit2, - libssl0.9.7, - libgnomevfs2-0, - libxml2, - libpopt0, - libglib2.0-0, - libreadline4 -# Due to --with-orbit-line=link -Conflicts: liborbit2 (<< 2.8.2) -Recommends: captive-lufs (= ${Source-Version}) -Description: NTFS filesystem using Microsoft Windows drivers - Existing binary Microsoft Windows file system drivers were exploited - for accessing drives with possibly proprietary file system data structures. - Open file system API is provided to access these file system drivers. - Microsoft Windows system components required by these drivers - were analyzed and successfuly emulated in the GNU/Linux operating system. - . - The implementation allows applications running under the GNU/Linux operating - system to access NTFS drives. File system driver compatibility with VFAT, - ISO9660 and EXT2 is also provided. - -Package: captive-lufs -Architecture: i386 -Depends: captive (= ${Source-Version}), - lufs, - libpopt0 -Description: LUFS module for Microsoft Windows platform filesystem access. - LUFS is a hybrid userspace filesystem framework. - . - Package provides LUFS filesystem module to access Microsoft Windows platform - filesystems such as NTFS. Use filesystem type 'captive-ntfs' for NTFS disks. - -Package: captive-install -Architecture: i386 -Depends: captive-lufs (= ${Source-Version}), - ntfsprogs, - libreadline4, - libgnomeui-0, - libpopt0, - ntfsprogs-gnomevfs, - gnome-vfs-httpcaptive, - libxml2 (>= 2.4.29) -Description: Instant installer for Microsoft Windows platform filesystem access. - Package provides easy enough unattended installation of Microsoft Windows - platform filesystem access. Installer finds available NTFS partitions and - tries to acquire needed Microsoft Windows filesystem driver files. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index c2d582d..0000000 --- a/debian/copyright +++ /dev/null @@ -1,39 +0,0 @@ -Author of "captive" - libcaptive and libcaptive clients: -Jan Kratochvil - http://www.jankratochvil.net/ - -captive is based on ReactOS - ReactOS authors are listed in reactos/CREDITS -file if not specified by ReactOS otherwise. - http://www.reactos.com/ - -GPL patches for GPL-ed ReactOS compatibility with the GPL-ed project "captive" -have authorship of Jan Kratochvil. Some of those patches were alrady integrated -into ReactOS CVS repository ":pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS", the -others remain maintained in my "reactos" repository branch "captive" -against branchpoint "bp_captive". - http://cvs.jankratochvil.net/viewcvs/reactos/?only_with_tag=captive - -Integrated small parts of Wine are originally covered by LGPL-2.1. -According to point 3 of LGPL-2.1 it was chosen to apply the terms of GPL-2.0 -instead to get fully compatible license with captive project. - http://www.winehq.com/ - -Integrated cabextract by Stuart Caie licensed according to GPL-2.0. - http://www.kyz.uklinux.net/cabextract.php - -Supplied Ext2fsd by Matt Wu licensed according to GPL-2.0. - http://sys.xiloo.com/projects/projects.htm#ext2fsd - - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; exactly version 2 of June 1991 is required - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA diff --git a/debian/rules b/debian/rules deleted file mode 100755 index e0cc48e..0000000 --- a/debian/rules +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/make -f -# Makefile for Debian dpkg-buildpackage(1) -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# This is the debhelper compatibility version to use. -export DH_COMPAT=3 - -# This has to be exported to make some magic below work. -export DH_OPTIONS - -ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) -OPTFLAGS := -O2 -else -OPTFLAGS := -O0 -endif - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - - -#ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) -# CFLAGS += -g -#endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -config.status: configure - dh_testdir - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ - --enable-shared --disable-static \ - --with-readline \ - --disable-bug-replay \ - --enable-lufs \ - --enable-install-pkg \ - --enable-sandbox-setuid=captive \ - --enable-sandbox-setgid=captive \ - --enable-sandbox-chroot=/var/lib/captive \ - --enable-man-pages \ - --enable-sbin-mountdir=/sbin \ - --enable-sbin-mount-fs=ntfs:fastfat:cdfs:ext2fsd \ - --disable-gtk-doc \ - --with-orbit-line=link - -build-arch: config.status build-arch-stamp -build-arch-stamp: - dh_testdir - $(MAKE) - touch build-arch-stamp - -build: build-arch - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - # Do not: -$(MAKE) distclean - # as we are run in clean distribution archive by AutoGen.pm - dh_clean - -install: DH_OPTIONS= -install: build - dh_testdir - dh_testroot - dh_clean -k - $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install-strip - dh_movefiles - #FIXME: dh_movefiles(1) ignores any directories - # and dh_installdirs(1) creates them in debian/tmp/ - mkdir -p $(CURDIR)/debian/captive/var/lib/captive - chmod 755 $(CURDIR)/debian/captive/var/lib/captive - mkdir -p $(CURDIR)/debian/captive/var/lib/captive/tmp - chmod 1777 $(CURDIR)/debian/captive/var/lib/captive/tmp - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir -a - dh_testroot -a -# dh_installdebconf -a - dh_installdocs -a -# dh_installinit -a -# dh_installman -a -# dh_installchangelogs ChangeLog -a - dh_link -a - dh_compress -a - dh_fixperms -a -X/usr/sbin/captive-sandbox-server -X/var/lib/captive/tmp - dh_makeshlibs -a - dh_installdeb -a - # FIXME: warning: could not find path for libcaptive-0.9cvs.so - #dh_shlibdeps -a - dh_gencontrol -a - dh_md5sums -a - dh_builddeb -a - -binary: binary-arch -.PHONY: build clean binary-arch binary install diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index a48718c..0000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# $Id$ -# automake source for the topdoclevel Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -SUBDIRS=apiref - - -POD2HTML=pod2html -POD2TEXT=pod2text - -noinst_DATA+=captivesym-pod.html - -MAINTAINERCLEANFILES+=*-pod.* - -if MAINTAINER_MODE -captivesym-pod.html: $(top_srcdir)/src/libcaptive/ke/captivesym.pl - $(POD2HTML) $< >$@ - @$(RM) pod2htm[di].tmp - -captivesym-pod.txt : $(top_srcdir)/src/libcaptive/ke/captivesym.pl - $(POD2TEXT) $< >$@ - @$(RM) pod2htm[di].tmp - -CLEANFILES+=pod2htm[di].tmp - -else -PHONY+=captivesym-pod.html -captivesym-pod.html: - -endif diff --git a/doc/apiref/Makefile.am b/doc/apiref/Makefile.am deleted file mode 100644 index df517d7..0000000 --- a/doc/apiref/Makefile.am +++ /dev/null @@ -1,86 +0,0 @@ -# $Id$ -# automake source for the gtk-doc generated API documentation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# captive: declare for Makefile-head.am we plan to include macros/Makefile-gtk-doc.am -WANT_GTK_DOC=1 -include $(top_srcdir)/Makefile-head.am - - -# captive: configuration for gtk-doc.make of gtk-doc - -# The name of the module, e.g. 'glib'. -DOC_MODULE=$(PACKAGE)-apiref - -# The top-level SGML file. Change it if you want. -DOC_MAIN_SGML_FILE=$(DOC_MODULE).xml - -# The directory containing the source code. Relative to $(srcdir). -# gtk-doc will search all .c & .h files beneath here for inline comments -# documenting functions and macros. -DOC_SOURCE_DIR=$(top_srcdir)/src - -# Extra options to supply to gtkdoc-scan. -SCAN_OPTIONS= - -# Extra options to supply to gtkdoc-mkdb. -MKDB_OPTIONS=--sgml-mode --output-format=xml - -# Extra options to supply to gtkdoc-fixref. -FIXXREF_OPTIONS= - -# Used for dependencies. -HFILE_GLOB= -CFILE_GLOB= - -# Header files to ignore when scanning; space-separated list of strings. -# captive: Ignore $(top_srcdir)/src/libcaptive/include/reactos/ -# captive: Ignore $(top_srcdir)/src/libcaptive/reactos/ -# captive: Ignore $(top_srcdir)/src/libcaptive/sandbox/sandbox.h -IGNORE_HFILES=reactos sandbox.h - -# Images to copy into HTML directory. -HTML_IMAGES= - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -content_files= - -# CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib -# contains GtkObjects/GObjects and you want to document signals and properties. -GTKDOC_CFLAGS=$(GNOME_VFS_MODULE_CFLAGS) $(GLIB_CFLAGS) -# of $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -GTKDOC_CFLAGS+=-DLIBCAPTIVE -GTKDOC_CFLAGS+=-I$(top_srcdir)/src/libcaptive/reactos/include -GTKDOC_CFLAGS+=-I$(top_srcdir)/reactos/include -I$(top_srcdir)/reactos/ntoskrnl/include -GTKDOC_LIBS=$(captive_library) $(GLIB_LIBS) - - -EXTRA_DIST+= \ - gtk-doc.make-captive - -include gtk-doc.make-captive - - -$(DOC_MODULE)-overrides.txt: - touch $@ - -$(DOC_MODULE)-sections.txt: - touch $@ - -# Prevent: No rule to make target `tmpl/*.sgml', needed by `sgml-build.stamp'. Stop. -tmpl/*.sgml: - diff --git a/doc/apiref/captive-apiref.types b/doc/apiref/captive-apiref.types deleted file mode 100644 index 005982b..0000000 --- a/doc/apiref/captive-apiref.types +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include -#include "../../src/libcaptive/cc/privatebcb.h" -#include "../../src/libcaptive/cc/privatebcbmap.h" -#include "../../src/libcaptive/cc/privatebcbpin.h" -#include "../../src/libcaptive/cc/sharedcachemap.h" - -captive_vfs_object_get_type -captive_directory_object_get_type -captive_file_object_get_type -captive_private_bcb_object_get_type -captive_private_bcb_map_object_get_type -captive_private_bcb_pin_object_get_type -captive_shared_cache_map_object_get_type diff --git a/doc/apiref/captive-apiref.xml b/doc/apiref/captive-apiref.xml deleted file mode 100644 index 689a865..0000000 --- a/doc/apiref/captive-apiref.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Operation Captive Reference Manual - - - - Operation Captive - - - - - - - - - - - - - - diff --git a/fonts/Makefile.am b/fonts/Makefile.am deleted file mode 100644 index 3329f82..0000000 --- a/fonts/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# $Id$ -# automake source for Captive bundled fonts Makefile -# Copyright (C) 2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -fontsdatadir=$(fontsdir)/data - -if ENABLE_STANDALONE_FONTS -fontsdata_cond=l048013t.pfa -fonts_cond=fonts.conf -endif - -fontsdata_DATA=$(fontsdata_cond) -fonts_DATA=$(fonts_cond) - -EXTRA_DIST+= \ - fonts.conf.in \ - l048013t.pfa - diff --git a/fonts/fonts.conf.in b/fonts/fonts.conf.in deleted file mode 100644 index bc8d569..0000000 --- a/fonts/fonts.conf.in +++ /dev/null @@ -1,22 +0,0 @@ - - - - - @fontsdir@/data - diff --git a/fonts/l048013t.pfa b/fonts/l048013t.pfa deleted file mode 100644 index 4c9d0c1..0000000 --- a/fonts/l048013t.pfa +++ /dev/null @@ -1,1233 +0,0 @@ -%!PS-AdobeFont-1.0: LuxiSans 1.1000 -%%CreationDate: Mon Nov 12 2001 -% Copyright Copyright (c) 2001 by Bigelow & Holmes Inc. Instructions copyright (c) 2001 by URW++. -% Copyright (c) 2001 by Bigelow & Holmes Inc. Instructions copyright (c) 2001 by URW++. -12 dict begin -/FontInfo 10 dict dup begin -/version (1.1000) readonly def -/Notice (Copyright (c) 2001 by Bigelow & Holmes Inc. Instructions copyright (c) 2001 by URW++.) readonly def -/Copyright (Copyright Copyright (c) 2001 by Bigelow & Holmes Inc. Instructions copyright (c) 2001 by URW++.) readonly def -/FullName (Luxi Sans Regular) readonly def -/FamilyName (Luxi Sans) readonly def -/Weight (Regular) readonly def -/ItalicAngle 0.0 def -/isFixedPitch false def -/UnderlinePosition -36 def -/UnderlineThickness 72 def -end readonly def -/FontName /LuxiSans def -/PaintType 0 def -/WMode 0 def -/FontBBox {-215 -211 988 993} readonly def -/FontType 1 def -/FontMatrix [0.001 0.0 0.0 0.001 0.0 0.0] readonly def -/Encoding 256 array -0 1 255 {1 index exch /.notdef put} for -dup 65 /A put -dup 66 /B put -dup 67 /C put -dup 68 /D put -dup 69 /E put -dup 70 /F put -dup 71 /G put -dup 72 /H put -dup 73 /I put -dup 74 /J put -dup 75 /K put -dup 76 /L put -dup 77 /M put -dup 78 /N put -dup 79 /O put -dup 80 /P put -dup 81 /Q put -dup 82 /R put -dup 83 /S put -dup 84 /T put -dup 85 /U put -dup 86 /V put -dup 87 /W put -dup 88 /X put -dup 89 /Y put -dup 90 /Z put -dup 198 /AE put -dup 140 /OE put -dup 216 /Oslash put -dup 196 /Adieresis put -dup 193 /Aacute put -dup 192 /Agrave put -dup 194 /Acircumflex put -dup 195 /Atilde put -dup 197 /Aring put -dup 199 /Ccedilla put -dup 208 /Eth put -dup 203 /Edieresis put -dup 201 /Eacute put -dup 200 /Egrave put -dup 202 /Ecircumflex put -dup 207 /Idieresis put -dup 205 /Iacute put -dup 204 /Igrave put -dup 206 /Icircumflex put -dup 209 /Ntilde put -dup 214 /Odieresis put -dup 211 /Oacute put -dup 210 /Ograve put -dup 212 /Ocircumflex put -dup 213 /Otilde put -dup 138 /Scaron put -dup 220 /Udieresis put -dup 218 /Uacute put -dup 217 /Ugrave put -dup 219 /Ucircumflex put -dup 221 /Yacute put -dup 222 /Thorn put -dup 159 /Ydieresis put -dup 97 /a put -dup 98 /b put -dup 99 /c put -dup 100 /d put -dup 101 /e put -dup 102 /f put -dup 103 /g put -dup 104 /h put -dup 105 /i put -dup 106 /j put -dup 107 /k put -dup 108 /l put -dup 109 /m put -dup 110 /n put -dup 111 /o put -dup 112 /p put -dup 113 /q put -dup 114 /r put -dup 115 /s put -dup 116 /t put -dup 117 /u put -dup 118 /v put -dup 119 /w put -dup 120 /x put -dup 121 /y put -dup 122 /z put -dup 230 /ae put -dup 156 /oe put -dup 248 /oslash put -dup 223 /germandbls put -dup 228 /adieresis put -dup 225 /aacute put -dup 224 /agrave put -dup 226 /acircumflex put -dup 227 /atilde put -dup 229 /aring put -dup 231 /ccedilla put -dup 235 /edieresis put -dup 233 /eacute put -dup 232 /egrave put -dup 234 /ecircumflex put -dup 239 /idieresis put -dup 237 /iacute put -dup 236 /igrave put -dup 238 /icircumflex put -dup 241 /ntilde put -dup 246 /odieresis put -dup 243 /oacute put -dup 242 /ograve put -dup 244 /ocircumflex put -dup 245 /otilde put -dup 154 /scaron put -dup 252 /udieresis put -dup 250 /uacute put -dup 249 /ugrave put -dup 251 /ucircumflex put -dup 253 /yacute put -dup 240 /eth put -dup 254 /thorn put -dup 255 /ydieresis put -dup 49 /one put -dup 50 /two put -dup 51 /three put -dup 52 /four put -dup 53 /five put -dup 54 /six put -dup 55 /seven put -dup 56 /eight put -dup 57 /nine put -dup 48 /zero put -dup 163 /sterling put -dup 36 /dollar put -dup 162 /cent put -dup 131 /florin put -dup 128 /Euro put -dup 165 /yen put -dup 185 /onesuperior put -dup 178 /twosuperior put -dup 179 /threesuperior put -dup 46 /period put -dup 58 /colon put -dup 133 /ellipsis put -dup 44 /comma put -dup 59 /semicolon put -dup 145 /quoteleft put -dup 148 /quotedblright put -dup 147 /quotedblleft put -dup 132 /quotedblbase put -dup 33 /exclam put -dup 161 /exclamdown put -dup 63 /question put -dup 191 /questiondown put -dup 187 /guillemotright put -dup 171 /guillemotleft put -dup 155 /guilsinglright put -dup 139 /guilsinglleft put -dup 47 /slash put -dup 45 /hyphen put -dup 173 /sfthyphen put -dup 150 /endash put -dup 151 /emdash put -dup 40 /parenleft put -dup 41 /parenright put -dup 91 /bracketleft put -dup 93 /bracketright put -dup 38 /ampersand put -dup 167 /section put -dup 134 /dagger put -dup 135 /daggerdbl put -dup 42 /asterisk put -dup 39 /quotesingle put -dup 34 /quotedbl put -dup 64 /at put -dup 35 /numbersign put -dup 176 /degree put -dup 43 /plus put -dup 215 /multiply put -dup 247 /divide put -dup 61 /equal put -dup 153 /trademark put -dup 182 /paragraph put -dup 164 /currency put -dup 130 /quotesinglbase put -dup 146 /quoteright put -dup 123 /braceleft put -dup 125 /braceright put -dup 170 /ordfeminine put -dup 186 /ordmasculine put -dup 177 /plusminus put -dup 189 /onehalf put -dup 188 /onequarter put -dup 190 /threequarters put -dup 37 /percent put -dup 137 /perthousand put -dup 92 /backslash put -dup 168 /dieresis put -dup 180 /acute put -dup 96 /grave put -dup 136 /circumflex put -dup 152 /tilde put -dup 184 /cedilla put -dup 169 /copyright put -dup 174 /registered put -dup 32 /space put -dup 160 /nbspace put -dup 149 /bullet put -dup 60 /less put -dup 62 /greater put -dup 172 /logicalnot put -dup 94 /asciicircum put -dup 124 /bar put -dup 166 /brokenbar put -dup 95 /underscore put -dup 126 /asciitilde put -dup 181 /mu put -readonly def -/UniqueID 5078987 def -currentdict end -currentfile eexec E98D09D760A3C22CF119F9DC699A22C35B5B35ED6AA23593C76D54CABB5E942B -F7D6DD84F1664B89699C74B472DE9F8E6DF925F6C4F204E9F1C639B4DBA988ED -2AC419FF2B2BDE605B8EE3264EDD66412D4F21C64AC522BDFC7C5502F9C3F3E5 -592B3B2093D33C9BFAEDD2D49E89AABAA832E23F062E91A25032519D1868816E -44B4E0747795003D7930299D6E1E2A5BFE0D595DC97E140989CE81D8D7F852FF -9CDC7A1B1B598C69131DEE005B415805A16D8F1232D83F2EBDEFED79F2D9B89C -8EC53816C50F0AE382BCE732EEE6D88D5DBD81066D279225908FE82D1016823B -76A6ECC3AE378CFA8D4858C797172833DBAD7A6E3394F8E694E1492FE4B67412 -7AD6A6ECC7A6ADC95E7AB30E84E5C6EAF70F5ADD2C2325538478BA68B505A016 -4E1EEE2C4BC00D82994B690B0A7F593DECA6BAC94DF9958F8C9D4A1B5E8CB301 -F978E31D098ADAEF1A8B0C49BE16CF963236BC1C98BFABE641EB28E425926D7D -121C3B5ED3F3B331A592397A0118B79F023A1F3427922D646B40F1535AC406FF -9A6639600E9DE05CB8CB72DC1C2315FF3C04432895774FAF2E5BC8C409478E7C -5E14212F16CCB01F40C090BB951FBF5866A7C22C10FC75DB5EF8F207AE4FD07B -10C82861AF1C7831ACC5759E0B603A9D8292CC48BD8720C06CDFAC12C303437D -D3B5D1F4AF514EB57314E27DBDF3FF7C4F1B5DD60244CC8C383F433AC4D74E8A -E0C76F22042BCAF8E576FD489CFE0ABC503C5BCB003992FE159A65392A4AC64F -4E555112A88333D6CF854A48727EF93AA0BB589426AACDC7C06FA3D61049F58C -74416E873A6B6A2198A493F73834D5C19BE517A92C5ACF16093E2F797548DD37 -FF9841B166114296FA9D03CAA6877981EC35D279B3795106CA671228224D0B4F -D4AF3640A59F9E44C59541F7F06DB11535289BE84587C698463286E342038704 -8D9B9A670A0D11A2B5C6C2E2A1E8F4AFDE915A03AE45CE5947909B1FC9A03413 -75AA4857E725120F78BF6CE2ECB35F685371843C3D95512572A7A0E3BD246ADE -AEAE95E62E9775AC24597907A8B56AEB88F46BD4B39018AB8432D9737C5CBE73 -77A82B56AF95293C7D0D847C7A508470CD6762AC896FE223E17730F05C9D3747 -E340F37E7BAF694BDAC9ABDB97BC12ED7B01173D3C713E0A8E68E10DE647BB03 -E4E67DE1972165C1796F5EBACF057A5AD7FEA38443D91ADBE54028CBA31F75EA -0DA41FD14F15496382A0D8C9C27BCE1FDD6A5164F70BFA2C5B334A2D2DEF9AEC -F1C39CC0484EE7F97A39D31A46CE50FC7D2CC52420898E2052896488606A5328 -FB195A9561E9D5A41A4C8117C86EDE60F80B6C70796B90EA9D3BD5BEB05E6656 -A8BD35A2A884BF8677D05A1F8489FAEFED5C645AD23A141ABF3E78C69EBBF48D -14884B29D1A4D7F03A66EEA0D0EAF7476E80EE45A894E706B5D681AEE8B31E58 -935CBE30E790B7A3995331BA9B0FA2F03F9A4D326F249BCAAC590345596F8369 -028CCB95F0D1CE8A44391C0E9526214EE28927FC98B3BF6676B1EF48DCE63F3F -48695A3AC668FAD1ED3B50A1FCD29ECE9E01F8BC3012053AF96B0C7D276749B4 -8CF046E7406621979A92FBEB7B5DD5CBB154ED51C4A9A1C13F6223BB54F6F3BA -326F6EAE74DBD8B370A25A7A1DC320E9A17CA230A868B752FA7FB1065F435BE8 -A3EA5775CCDC33A360DDC25B2891F7D2AC399BCF6F789109CCB37DDD02BF9EB7 -EAED7A9CE82793DF6FA7F68F9D45530A14EC91D71A19A9251BD810FBC9934F19 -FE4FE1BED828FF3BFA6E91244AFBD8B430B53106AD18F41DF767E2DA16F57083 -B8F66A0356F80C30B956C43416BA6E5CB805AC10ABBD18B31F8BEF14757877DF -152D286CB6B478EFD4C88A3DC1745A32A56D845A7E61034C7907A7EE957A4C7D -A6525821611CBEF18947E727A49E0F765D648CFF974273D18A03080EEBB6211C -E96439F86431EFD0BCC4CA2D2D8A4FEFC65C768D28FCE6BBFAB055E0DF961A52 -81ACE5A300787BF4A458016DB1CDB671B4867E5F5103551007BA0F53117D733A -0D3E8802208CE1C54965A28912A03CA12D9C34D7DE9599E6DAB5124713CD716D -916701BE3D6318B19A9E2827E94D4FC3F4D7D5794228DC958B3FB82617CF21EF -D4A5129EF9051745A52DD66EC77E50F35A8793858819131F36413715416D372D -DBEE44AA952C566114C8E3A21EC8BB0669805F48BCB27C92E609905D39C7FB82 -A62A627280ACF84937B0F10E132EF579B69992A1942133DA541F50CD3A51FF2F -C56C10C6ABDA32C83F1DBB4127843928A4F6E714E815E387588478BF941F1F74 -E8632BD28851474673265AF4A18905C07A4EE77865CA41D23069615FD2176AB5 -2595D1E86B86DA9D0C416B67497B6B9FCB3E3F709C3A4E552E9EE130BAFF3810 -C30F41795F68105BB700DE11773B6435AFD59D7815C17D2D0C33C824550CEFC3 -1285EE76EB1E72D6D3BFAF60973919F8FBB4E2904079F53927F7F1FEA66FE0AC -5496A13D446B0FBADA61467346AAB2E5A9F61619E09C929FDE2BB660FF152DAD -AD834A43A906585B1B48E90D2AB718011880AD2A3431E5C9B2AAD5B9E401973B -AA944A69F49810FC10FF7B7FFF0BC5A2FE856D757DA569F34FD03953534315FC -BED3841FCAF428FBF5210F66C961BF468F25A82E0D6868D3E4B93F95F9B04BFB -D9B99488FC520678A862EC1AB774A0CE59CEB043230B6DFDB2309D0FECEFD69D -8D49085ACB83B16034AE0835FE67AD57F38D369F4D9604CE276CBCBADA2F8C0F -3230E3525204E3868B0AA1E8B387DD2567E000CCAB04929BB4F9F5DAA93914E2 -A4C4F6C5E91C51725CC94DB972FD7B8B46C868D6D2FA9B63C84904E9C3EC77ED -FF4ED0FB21A310ABE4C54FC6D6D18CE039B4407F06B95CE7C262F789258D0585 -BEB98AD999A28751FAAC37BF6ABE82331A9428F873E91254E820DA499C11F4FE -85F0CC83DB4763D6B4C6B832D3AE8CFF77C0C883A0B41A21DE36A1D32DC13EF7 -D35F3E86C7EF1D8461B171813160E56FDB2A0232D1BAFAE968A4FB67BEEEF61F -7273B238C3E2371A05B71B15D8E0B460156A5FE5DA20D662247CC36385544C4B -A52BF88B7C20C78AA08BB0FA4835FAB7642F195D29A5EDAEEFD711169ACAEE55 -1350C30E459A4EF0D5E7F7C068D1EA4882230D157A51D639750E2550F96D752F -97B0AC14EA6524AD772E10B6E420584990F0D622598832F519FF9CB6F6A20E79 -6E75AF675E3886621421E2B0DE3AB619E6D0C65AC4B7366BDBA74C76C5F6DDA8 -9E8D11F672D02ACF26766D7CB6185BEF931A4ED03E3745DE92BA86660BAC7865 -61F4A64F959A7B4D825E15FD9567A957B9C672ADADB83070795EE44D7022745A -9E8B7D0C03ADE959A33ADAFD9FC69A0EEE08FEBF24674B0B6F16B31BF3BF0278 -68B511314B4C73FE31D640D6726EA6051A079A7F503C6C886C9DFFB6D03D2E6B -AAC0BAB66F9C06FC11A4D7C165CF97CCF9737899D41F602E326BF02394F6E438 -A579EBA81C049CA9B773C10BC5BE33353775FFE01E3529DB4FDC9467564372CE -1D2976040390CD1F1C0DD3DAC8936854A0E9B5074730AF4736C0E4F040759B69 -5AD6A1C46714E61914180D1F80ECBC33689CDFBE788204DEB11FA4E35DD610C2 -B82E28A25991DC4E55331DB54345E3D11EC304B7B25CFB5F1762444C55AD642B -8095CF31A30BD6C429497BC0904B1F06EE90FD9926125E77FD430AE3852CA235 -92428660C10A19470784FE02E536926779B248650A6315FB8B784DBA9D226B06 -09C6900E5797693983CDDCF08754C3159545042ED401B364A45A9FD7BE0AC6DA -ACD9120E8114EDF40F21D968935F1BF9DE05228EC140AFB1889AF353996B79C2 -E6795E23B5D0CED1E0FB1E6A572C6746958619FAF88C368EBBD742570DB4CB4E -DED4D19E89AFDBF6092D5A0A48372685DD9639A32E4F91ACD9CA3A9E34D64E11 -9AF8E6BDF8674D52F1242D8FE11E19820F26BF1F533C34EA6471A4C96D4D5207 -A9AE99536705F6934CB16165657EE6F6E7CAA7720D4AAFDC6C075346672B3E16 -001BC35A331F03524D28301FE77D9C8B5FAB0BB872D568D5B95B2DEA4322ED4D -0DC15BA4F0C1D1AF924873193FB809B689646A4CF1D97A1660F953C82211E4D2 -A58E370AF2693919EFBD3C1E18BEC7A472B20DECEBC0CF1861AFE3978C993CE2 -3D7E93946083689CD61E6C180B3EFA962E2BFC1D073F7FCFE39EC0F963C51C77 -B2A77F81D20BCAF1F0B5DC1AABD9869D4497CFD90953EEE70993ADE80AB6CE15 -864AC0BA7FA4B666C54EDCA0A0F9F67CFBC21A3BFC4E2303F5849C130B9B7E46 -0A8F60048C57FF89DED4A6D5976635ED1AFB0331370E53EBEF3835107D02FEA6 -5E28A746BA8E0A4AD649E0CC03B6AB56398D922B96133DF7024BF83A46A0EA6B -E4B05CC77A461AA0FDCC59E90FBC96D16DA364C2DC55E618090800BB3E8A2D90 -CD72A4C067A1C107EC6B0A648FDFF3D05C508C4DA9826E7082CE58C2B027C014 -6C001421F42F21B18221E7AAAA092EC197AF592EA3D432175856F58FE7EAFD05 -B81FEDFADCCF38AE807B2DCD8E4260E348E3B561E72112DCD7BB0032120966E5 -5F131F2399D9C89AE65CB33A354903D37A9A5E480EBAAEAA485305462228C88A -16F99457F7FCB1538C2BD86DCAF01F6D6404F02FD91C82562EAB72EE21268867 -CE2C0F3A083719E62205D0090F64F694CEE7F0F38D57D01F3732839933DC0F8E -DF5F9CBB1FED7FB149AEF7A53C644E17A672DF4F8BD4A0ACDBCB32859117ED77 -82ED68468C311C51C8851ADBB6A9212DBBC84EC1B88A4AA31CC6D1F764AD69F5 -CEBBE3F7983C3442FD91D7EBAFA16CA047165BD327BFFDC247F822314F346D2D -D3E28BB4C05C485438E70E62DF3E165DF4AB31B0CF7FE84F420304D3FB7D11D7 -DA73EDB8834AC45479C13BFC5B845AF24C2F1A4711AE4BACE4D60276491D1BCA -E3A3667563FEF12FBE7667F1EA621D0C241E49D68B09BD92D5163246425565BC -FAD5051C5CEDAD508F387E192AD94FFC7184F8BD2530FC7DD585501E34AF3846 -BB1295CF417B218758F11D342792D81C8CEC903D970E51BD263AB1BFD6E9B2C2 -76E1B061522A88930712D2C169877295EE5340A4D1C3F69B9874E5CE3E3C82C3 -E7CC446BB33407B2F2B13722054B9E4286C06EB291D0410964FBF53E079D70C8 -1AEBE7D82ED6C7F95A0F83AE408196F9FA71BCA747448B3D94BDE6B25D9B1B17 -4C55496B3D0480CAF91E053B3FCD02C6140317DD0457EB98BC899CAFA6D274C5 -06FD587285251051CD5DEABD6E5B22A3F42189ED36F3A5DF75F8A1BAA892D296 -13A466A0FD134597DBCB91BBC63400CFFE7B77A8D09367F2252C22EE637A686F -C076ABFC10D88395D376ACE6CC23DB7F05CD6C457ACC83FEB49C6B50BDFA075C -ACF9D01E6DFA07227E28C3F651EB02303A658355BA5176FBAF95414C6A704FB3 -C8025111091F5482A01628F05547A9ACB731A291F1CE05EA8D6574272DC2FC4D -48006EE157BCD0AB293CABF3B6201A4D90350EEE2948A444F59C774847A5F3CE -76E328F3A1AFCB732F339DED374E8FE3BF9B964C9A26B3E1C3524EB27FDA0B4B -EC483B16DB62FAAAB326B862529E0B284283AD28E80F362343BCC66DF8EA0E20 -38AFC2F98F623770538A38698293FDEF0B75E3C5D851094CE5928150C7296240 -1FB139409667CDEE7605B4F16339E2C4A9B94E316D7A6B271182A19CE5DDBE61 -458DA5B24620348E77D1EA20B096050013A299D52E51C07EB68C151F6EC394D0 -26D6AEEA446783C64E15E7C7602522500E789A4D38EDC317AB7CF6765DFC3190 -FF1B84DB7A4A0194A4400DF94AEE615411313DDEBD12786D1720430E0DE1278C -9AB02BF0705A2E75738D65B832DCE7751EFFEFC699B97CF4151AACA2D94623C4 -73748CC15AB6D1A07F5D13178979CE175326C5110B335E47A53F45818FC9E4EB -5F7CB8332E12CB441FCEEACD64AC84BFEF1E858C5CDF1F0E895CF1AC75BF2105 -D2B6B86C14E9145BE2F22792CF68CCFBD007C728E816783AFCA822730EF16766 -2626857E1E7C525793A38955C4F40CFB8E42F86AA9A0CBF0296F9C54626FF1BA -E25D62B530221D6421EDF9E5D7BE7A1311BA3AD0F48771252F4FBE4E55605F4A -0A520DBE08CC94B181952D89633840FBD1F79BFFC71090E918076A9053947120 -70635D5EFCDE3A566101104D54B346DBECEE79FA87EBF54104904756ECF68B32 -2F6F26103CEE3B06A882DFFBB0B08BF9BDAE2C8D9AEF88837235BBC2CCF19C9B -E262B6F8748CD3B0224E2237CE0413A4AB2724B6BB3C3391CFD6E8C45AC32ACA -7249A955656967035944D14823D7EBA0D4FD6F3747ED319A6B133AB8762AF94A -B43B1D03FCD9F63766753EC12609B8CDA51E65875B04A0DEE40F768D91715D29 -A06076D2712CD5BB154CB9E3E77F322008C505F46FAFB3ADAA066285A50F77C5 -8A9695E324B6A24B1D96F4D4197EA627089D71EA7371D0D0348B8893E5261EB3 -F41BCD40EE77A02264BAE486CB345CDEE0C00A98ED7F96A3AC6CE8C534F5CEAB -889F7E3563092DFA96C44A28279AE30DCE4031150E2A4F03AAEA5E2D854D8AE1 -0E2DE62B83B05DD9C7F0BD5ED122FDFB6D4E5DDE5BA1C27E8961CF61119B482C -69055C36E2C3A1DF9165FCD5F24CBB5D6143C9E43A0F93EB260CD66CD4BF54AB -7AD064FD0D7B72E71F51464E7CF407BA9D90368ED4E9A5D11E63EC7F7E2563B6 -1678DB1300C88F3EB77DA3AC104B644C799344A7B93B7925991A065087ABCD6B -4C72F2C60B3AB3E9B1B008DFC201E2F48E47C38ABE247B622A75ADAF193E5E9B -301E0F19B8066429FC8F64E1E5D7822CEBBDF08B83A5E732FB45B211090F0A90 -EFDF2FFC7BB6A847EA398CAE9BD0562F73DBBAEEBF83595E5774C5290373F3B1 -161905296921A55C4C8E9C925AA543338254E7D9855E01803A2EA96B4AD8ACF3 -E4682030B7BA428C6C505C9F6A97567E568029A0FDA0652947ADFCB7FB74BFB6 -F72CAB5267EE86F34D878C62DC81BBF22FFE13CB066760353039995E461AB2D2 -040ED87EA2CFC54F2D5BE13CC99FEBA37333228C7302A34A4F508EE6595797F3 -7BD211BF901C4055641869FEA3546B89D36949EE0FA2CE8DCE71842A52F05DAD -F63829F2B3184CF814FAA64C73B65E4ECE9B0517204981AF9957F1B6FB29BEF6 -8D47E887F8EC987889705FE17BDA506B1C9E521BCA46A10BD728BF9E21551C6F -E233316FB7F5CF3CA15F1DD7B827126C89D4EE7A4AA82FE71026107963523F09 -096FBD47DFD66CA1A69A4D7C076D9A2ABD9D5A87B70DF1016E29C3698AFDF479 -451C57823F7B5250315EC85A8E7B1367C2E9F064E2B716340EECF712EEA14886 -22F560B22B39BC1CF25CE9966AAF766BC606CA93C04ABBB3DCCC7E0BB8F4CF22 -2D37CAF0BCE43B93B2EE318BD72BA502D596EF36562A056E1413DE0700C776A2 -0B4791C90FC8ACA2EDA723CBED95908811C2ACFDB5258CA181AF38EA66E305A8 -046EC71857E31894C750CF59C4FFD7DDF405378FFA7C854A0E0E3C7BCA0AD237 -2023844F8E8D69C15608CBE17D84FE9C0C9404913D68B98A6BC8FB01479E0B60 -E2E624A5B4E64213B4BF4734BD3C8B30B0E691B190B30CF2B49978BEA937BFD3 -A18AB4FE7D77EB75837ECA25ADE86438AB48F6E2A6C7DF2CBA1A3006F4A89AC8 -E9596510EC3FB24B33E24F8819A9129429376CDF5E84D61F79084346EFD83BE4 -55348D8E9BCDA1ED8096A3215600A1EAC278B99AC3FE8AC3BA9AD3B861A492CF -B38BEF7502F608907CD5418B768C795E3A31E7B6971E482FDF8265032FB63F2C -4B9385860945B83E244B19B7769160D3E90CA5E81E39001085FB8AB7D7A855B2 -7F58B5AF4D7A04C214015A5112FF363981AF0C9F3A6E98C391630F839C8529D8 -79B2AD12D38181E9A57642AF6915E8EC894A2592A606753C7C6E67538B22B1A8 -18D836B53E4E775A9D745F4F0C2BDC493A1122F1DCEEC4F7E18445546FBB332F -45A62F4A7D2BDA18491577A7EF07D19F1F48420944A2A8DF92D953AB628D2095 -F02358B542AD8CFDA1E2C739EF10ABDAE3C7C17AFB2F0884175BD4BF29164836 -49A5AE6C7D7438D477D15F74939183B61119367149B32B38C4277EB60EEF82E6 -AF4E94FF0D5DCFD77052C2FADBD0554964066239180611E193CAFED231F7CE82 -381A14BB9D908D842151883AEFA0C5C155184D2A6E82FB943792DF1D1B9ACE7D -3695B87CDA9E22839448241DFE11886518AFA164707842599A964E65A2EABB2B -1118F729EAADCFF6CB3DA1BD784DBC6BC6D41E895EFE4BD8355B65AAE7FCF6FA -0B2E115F67B7F29210611955759DC3C52E6C67FF1AF9B69D0DC3B53867FE8DB5 -E3E9F35BF158340E2E888D3A9DF0160F8150EBCB76D053689128B4DCE663EE5A -DC8526F46AF7DC1629A28BD8200EC03F6A11D2573C68580CC18B0DF7E138A6E2 -9C9022DD9093D3198ED133895B6EB49A5475EB0BB06016E646F3244D76218EB8 -F26F00F8F507ABFD902788EDD8755DDAF9973C40D1B7CFF83E696C2B60AE9E33 -DB98E520A33242F3B367287A519255AE92F2512E3BAA70DFA3D4FAA48B6E16D7 -167CECC79D41D27F714EB1029BF021EFCA5D4D9203062585F1C2EBCE61BDBCB8 -A834CE84A1716F3A4FF8C8F596E5B4C607DF81D25995A76734AEC487BBB1D440 -F1F11D2FC345317BC2928AB4F59091B4B3EED478E821E6A84ECE01C760698BF9 -19163E32D29ABF92C5E2805434C317C05F7B1BE3B47E26AF33FB53A720820B30 -771A2DCE04C0E9914B6E7A2902C4C4A91BC788FCC588C96AC517A2FFAB00889A -AA125ADDC939A6FAE98D809F8DB1DB49B6D1297EAACD08E94EADF3AFF59F8E0D -1EF968E765BCA6FCC3D52B7DF57ACBF89E45D13F001325B796E11A5BD51AAA3C -036C0AFB391EFD7984D3BC6EC248122CE2721DF837E44F58F9CCD0C06C045D2C -5098854D31234CA2AE9C41B901CEE60220E0DEC181BD39A3EC3E3F355CADAEE7 -2BD3A09FFDA632139242B16207428E0578080CA7CD604A186154665B31877131 -4916A2C04C66E01C1B71821C44E5161DF2646899F1923FF90BC203D592B9C371 -58C88945B5D0EBABFE0924D01CF22B547CE7DFD556CB285F0BE5D9CC7AF56DDE -5F61D0C66895199CDB61A39C944664CB438422E7FDFD2F3FC632058E5C8EC998 -673E8BA91DE92E64AC3FF9CDAA34DF107836B121B5259807ADE4324D0CE7B7CD -F2D94F1A5A0D2ADF7A6AFF0DDA5E98F72FC29A34B01ADD8682B57CF97610EA47 -5DAACF94FDB9E61CC14CD2B2CC361C9704EAC1F54E3EFBF743A551FAD5B52174 -486A5448637530218091DE0B4513443C8342CD18B669BFBF241C249BBC8080AB -012361313B220C3943D4F82EB3A66173635047730A44797CD20753F196A19919 -D1F75BB016E796214058908ED982F3C0D9A524C789D7F634759FDEA8C035E715 -190133B34E87347FC6E8C8671F50616030E5B199758E370F4E2BD838BDA6979C -3815FF7625F1BD41B9C4B6BF0C7DE3DE69F1C6C1D3F4D387B9317C530A49A3ED -37989944243F8DF2D60241CC6E4E5285289A7EA597D1DF92640A83360738B5A7 -26EB20D1E52850C829DB87E28B4717B8F2CC3C8942F38694A5DC5A5321DB5725 -89F49CA6D1A2AC555878CD43A023114FDE61FE8B8A08A840ECC2FBBF1041BC54 -FF4681D0B755262384A664C98ED1D1A1A2AF0F1AE96971EE2E4A1EF9E7C0B2D4 -A60B7A6108947C8BCCCEC3946984332F8AFE04AC9345FB60FEC9FD3534DF4E98 -585F371ACA9E10941CB122BB65D9AE82D16F0DDF13ED41D3A14448A83F120F7B -AEE9C6729E8D82DE68CA746554169CE6214842C399AF76CC78415B52508CD330 -0A776680685FEC3BA39A5C4AADFDE2EE53CF53C5569C54A59CB346033EA7FEA2 -3A5BCAF2442B4E18C9609220A1A334E71D0C4F7748F8068C3E42F3BA0D906155 -3EA8CBD989C0C7BEBA367E63C8484A2DF3E8EB27E50E60D09B1D71B8521336E2 -04EE168BD3077E6444266E1506F7D8F1A73254E5422A0FA4E5728712C3217829 -071803C4E65A4FDF9DDA27A2C4220EAA6F7520292FC1374DB4252886600780AB -BB1EB3C5F479E96AA17644BE204357F8073127B57B5058CE06C53475CF82B946 -E7632666847BE56D1E37EF9B4CE247B80E2287B80E7C3DB45C4F90D49E0AD5C0 -BF2B51C79F1D929FC84EC2B8EF66EA213E862A2F06759059D72931822D35695C -82A834F08B21DB8F40C9BDE784C97BA483E15DEAC3552146AD67AE417836A024 -2F388EBB7E877AEB04C226031941BC5E00B62DF4C833303E8D09360345DD3DF2 -7C05793D4B8954D01DDC88C7852B722546691B0DE58D03671CA23B1F8015FE7B -9E50DAD5AA41382C4E9CCB98FCEEF7785BF174171C4D386777DE16A4329C831D -FC04CD5AE48E6F13DEB41337FC48AD7C7B208CEC6587585768C24852122B70F5 -DD3A54A92F38A4201C6D75C8DEB955471638A9EF4B81BC38DF39C4E4E6CEB929 -0B06974A9D40CD5622FF02A7D3CA2F25249A40E4F0B684E8FEE2A839FB365DE4 -50FB988F97B992C9E8AC58B74F840221865C6E48B044E0A1A4201490F74D82D7 -5383AB46CE69ACAD4B4B09F5FCF3C66A637DC529695C9442F19A15C927569161 -6BFEFC8CD1B7A7F3F9C67A445F8B6DCD2EE53FA25F68817012105E420A61D35D -3741FBE996F921C24A4EA47CC5D2099A314183F55F4B098F3CC567E9DA4EB74F -9865A8019106AFFE5C8BD34EC67228540A4F49747678FA79DAF3ECF142A4F3EE -07E5B66F004EAF6FA3CBDE4782480D9541CA6E4BFDB69DAB7C72C607F56630ED -2F3B78B7FCAE17BF13D3FDA9A092B0DCA9D75AD9D6EBB9DD649C3B032AF5A1E0 -E18B31810E6CF3D26702B480D1D2F16D8A6BE47354FE17AA318AC16390AB1C4B -10165DE80EA293822BB63DB8B72D78E94FADA203B0CE078A929C5B9BC681D560 -B20A2DD69CFAC03D8F2EB16FAA431AB0E7EDC77DFC40AE2C8ECFC0CFD4A9E236 -15BF356CB6EAA90F6630801CCC05B577EC4A33463182DB9F40AD504669655370 -11CF974D7536EA8D8BDD56C268F2362E544CBC1D31E25F9E5D6F490D33026575 -E45B367739D77DFB4D079BE7C379235C8095D6D4F52C8FF0FD4C6DFF2D6C7C0B -13DBBAB39AF732C38348A4B170978410668CC1A2189A058A3EDAC1B08C09CD6B -ED16950A2DF3893B96CB35F551D7A8103380F1264FEEDE157C641B4783C6581C -790DD7349D6703D0B61AC8196A0B787A9A1F0BD9C906CB00439FAA0A9C9CF7A2 -0F26A9CA013B8A737C921722C76B167269A8443FB1C894F35F7BD37EE31DA899 -75B4EDE61F409D8539472CE9805623105FD5E67E6FAC734A6E83151BBF93BD01 -EE89EB5D4021777C423461554F2C2406D35FA6F94824EB29F88E20BFD6383C6B -2499DF337517DFE6F01B0CF4E35C4E05EADCF5684E34B7A646F3FCCBF3811790 -EE1B34FCA03BD9E6F65916C15C68D8E7B7D2306FBC705B90341415DB1262D49F -A6BB3BFCDA817AD7668A2528A76CA62AA8CDC02C9671D254B8427AA2F0CC354C -C9F2B673814A0637DEC6A052F3F279C23391148B4C9E761C5B811F89E737969C -79E7666282A91CF9D865F25A1EA923C85660404A914C90C9CA6ED4EA1E552BF2 -F03A64AD507EF630E917ACDAAF2CF94A6DFE99BAFB2309BF05F9B6CC991664E0 -C477E1BE53A422CA0C85ED03933D3B210D6716E50022E0BC0DB4E5D5030A9FDC -4DAE2DF78BF602F524F138F682A21CE9E1B929CAFF0F1006F289A94F5F0C9A68 -A2DBED5009FB809985FB0E9DE0A0CD342366A329B0FB96601624415392B0CA13 -F62538B0B96F27B6E24E8DF136800885C9A3CDD5615B8FA19529073873BC725D -DFB03865A17573CCDEE9572D13FD100ACA9EF2AAA0FDE0A60A3A219778146581 -92B520565791410F4E515A7B088C43D514B8B16BAE2A658E0AEC9E9A6E7849B4 -4051FFBD37916E095F56B93D56DF69B39B3AA423CF3021862F9BF963405DC9BF -2A13467ED56E1EB1A8A874BA6FEB5E9B72ABF43BD10C709CC687482CF96806CF -8BEFA8F7E7AD89186534A4795FA08224116ABF435509E9A6773F88589EF40C87 -7EDE77FE457008692EC223B98E0EF858DB4C8DFB275F6E631FBE611CF31D319E -C3E946180CD64A4D519BF3F311892C1A5462838271D03D5CE7C4960D675EC73B -18D41303945FBA3504E55798D86E174BA38DD8B7B1D4F23109857567256AD067 -AE8BBE62696CE29C95D4326E1BF4A5DCF73BC0C79E972518C558654D7CD8BDDF -67A3E799A95B05426A1072ECAA116CA332E1D611CBA90BBF9D15DA7739FAB50F -E31BB619F7513BC6BC72617923EE35A2999EF78AB74EF7B3DCF32A6286EB096A -920DA01F6DCF0693585165EA80543E74646D2DA147F9615D4914EB9690ABDE16 -92FD179A66FE9A0290AEF99733F5995943C88EAF7FB5F8B7E5CFAC2FA77EF9CC -4F678820742A36D2D0AE01F11652063457DBF0A4C535708D4AF777D37E5A33C1 -C3FBEE96010EB3112FADDE319A17ACC1AB36157CC1A5BA41B291CAFE448380FF -B11C7CE02791D702D70819E83C2ACD8939372B7DDD08E98D0F17940D94F825EF -F759BBF2BD70387DC2467AB0B21A536F5F50F2EE5368542AA42BF43008D17D4C -E9543A490AEA3FCB360B09198D649966BA730A06F8A2441F5408D5A7095B1A0B -545FF0CFC72E831EAE74B4E3656F413CCB92A778D154F74E05BC0C1623EC926A -E86BBDFEBFACAA94B9A6127CB16336EE4A412B32FAF19B7C79942A8A399D9C15 -A621EDED310FC33108673F0D6290FC882CE490FBF3FC65B26BF47A9FD3AF6BBD -13539E842F08928531CDCF19DBE2CEF56C1FE7F6F617099F18CED9AD3B3B7C0B -89DDD37A3CC1AEEB69C54C162ECCB17D73FA18405BD7F58B0E78021BEA22CB81 -1357F69CCACA5E090E658D1B6A826E621482991101CE50C62B343132BCA7E586 -ED3DB34DFD1562D7AC57A088375B145F7ECD54BEFEED6791C53B4C0F475C0B69 -F14A2196A701674C8845397E4BE0F13C66A2E28A98DC42EB96569E06F3D923C2 -18ABED5B8FF7B43DC738B9E2258D1C0F5A242350AFEAC5E95BD80C16F094246F -182C53E12CE7B880D1A252999C8EBC6014AEEF1EC179C1F5175A7AD8163ED9A4 -07BE5B2D3EEDEB61826EFE3D65A9441701A76BFB637E5D5053988903DEF41C28 -EAE257229172CE100FE8D5591BCF99F000C5459559B517D3818A9D65A94922E2 -CD5517C8A5927378B580C048FF5D5E60317B469F4EE7889E4461050F2AA1B20D -D8A2F241D25635F195218A37F29112C2DEAAC7D8A3B1ECD4A68FCE0C24CEC87D -CDE22DBE1A0A73614C3DB14066448681DFAEF8D35598C6AAA8F70AF07A7DF0B6 -100113490C2131D5613ADC8ABC12FAA531B3EF0A45D19C72D77ED225F361BC0F -86B70C9B531F4900C6CBB9500E532C5C50BCD2A1295434F1E763AC95E68D7C75 -2444EDA3C23FB50D2867CDA09A758D32E4E30B01EDBD02F917FED439D2F097FE -0BD6B387FF89CA48E624295F91D96D6370FD42AA6A0BE14666D791E088BECB57 -2A391A8E87F2C6E50D188475B74CFC4F5BD1ED8D1EC22791BD31AAB92EAD4DDD -C7E610667BB1ABF783137436279D93A71E565923296866F9704D97AEF3876367 -5A063F8CD68C9223B621797F7070D5BF6F743EF717E754F94D6EBD201AB0164D -C240049723150C45374BBA15E0BD104091781F7CB67852002D31644B12E590DB -82846375410D004AA8129575F45562C33862250858C46F72044D58FFED513301 -F7881208CAB4E4C4459CE16CFDFC75F768CA513523C6C2AAAAE41C0A219B06C6 -7B4AA98F92C074356298A588B571A0A03B566128C0F62ADC9663E0EA2BB9F686 -609BDF8D6EB178B00E121632620CB7331995A63551F8373A22801915C7BFAAAE -652D11CE7CAD9C7AB1CB646C605C6C4F2E42BCC872D94160024D4C0B2DBECB02 -25650FF58D1ACAE991CBB26FFB229D8355814F5CA8620C9E637F4A77AE88553E -E159519E232749E5D037EB2BD3DE28EFC4615515DE0F44BAABE6916F0FA7D61E -2C56F5B0DD6B387A7C160EE009302BD3D1925D6372BBC8D72344100641B9A87A -647386FC7F4A4F16CDCA462B9215D94E8C9068B760AC18660FA125B352FBF456 -C145C0DDFF3E4F6D2C84937AC82BB53D0DF720BB8E0EF59CA0F1DF1AD8A139C0 -92DAD7B59892303822ABFD24EA1A922B09F5B4344290B3647CAF6E7622583798 -3DAA4155916D90B1142F2745304C46BA7E3F98F1319A3F6500C402133D8CEA89 -A10360935E26ECDE1578D362C34DB7037FE312A5EEDC4054DB2CC52A88D2820D -C2ABA013AFD88CE47E09BAE8B40F7CA321DD86BAE6C82B919884C8B855D7F5E6 -72B791936EE754670A53E92AD0C74843D15445AF39B6C7C2B065ED1B3A29B81F -DFCA2F5D4191212ACB7FD331692C0ECEC8DC4F442A753F60024969BDA7E5A010 -3DB640453B353FCF772678C52781FD6DB32BAB10D6BC7DA3233D0DEF0EFB8B5D -7009EB3F58D77C0B02B2341FB3D485EC340E80C842B6E1EC4DF85052FB2AF512 -A48412CDA18DBBBDB5726EC1DC3D5838FABE8ACC5C3D19414DFCEAC70B857638 -5924531C3803BA645F902CA88F74367B09C70A1E8504F8A850100A5EB21ADE63 -3FB038C571150C9EBD3A75A2F670122E92855F6354919189E36374E91C59886B -22899897F868B8720508F9BD5A161797F61EE40942EFB26C155359D4A6B2314F -CCE8C7059E214534FCC40EC602DDD283B2A931B5CA1E873773637BC9863CF916 -1B7B36B008EC1BB562C4FD883A631598831B1559C5D77136AD03E94DCD9C495F -315470097E005FD022E53DCB7581DAB60FC791B4ED9C636E2DE5F5B22482374F -088736F9E02EDAE88C55C5CEAF21EFD64EE282AB84452A1319AA8DA3695B7806 -0ABECD77CDC40FBF7D9FD09E1ACEF73DE682447FA18F45C93C03E7D8A70135EF -2B18D6F397DD2885206DF5A8C52C89BD54B11B4F61376CA6D6342F44A57FBDFF -171548EB957EB47C62C9B78FD5916FFC8B2D9F9D4B744E3D7B784BE985DC57A6 -92352900DF235A531109372BBD46A8B862298EB6967829DC163E55CE85F0D8B4 -D952851ACA00BDCC981DAF1B15E5D53D29F55FFB46E81327ACC6C147B5627FCE -9989428A788A98DC4DBC9DF0904DBFF8DB4C6F0BA3CDE8FE3248F29EF8003878 -132430F063596E34424CECC9C9FF6985D4DB0786EA1CF7D0DB7099A3C4D5E26A -307080C45892678EA66C0A539C32E688222CA098EA3472814A995A5701E5307E -DAEB7C853A4B7B46F9910158BFC4B206F7E7CD0D9B5A1820773CBC23E6E43CD0 -6A4E88EF6F45285E85651FA56DA663DB16D356FEE528772A506397D9D86B3D18 -645D3FBC57199F8FE75913911FD64E03E24C6D0279718F7BBB0C8C502BBBA59F -9B2CC3C21FACD744CED42569A8841D3867CBEBF2ED3486F5C187583E0E6B5D5E -9441B9F0F659E5BE48A17B05F9D3D96F28D95D757BEF3CB83CDAE0E667F3F8B2 -42F4E6D5AA1511D320A2E1B96C3C7CC96A8737A70B974760159CE08941C3E06C -EF4B1F07AB12EAD4BA26C5C3627A231EDAB2197F8B0EB12584C9817D5BB6B39A -B415D59E2112DFC61B10A06EF9ED5252F9C0FF98FA4A2B49193F09F796BFC431 -38B88C7EC80A1E192DF7B6A0E5BA7EEFED908BB108AC20B5816DC41D57DEB1C3 -37E3BFD817772D44F7C1FC4F82F41685FE711220C8175D68F4C73727A6982190 -2894CBDA32FF2B70656B269657AEE710E75D8BB54659D46025405583BD30A344 -EB026D2DED75300342807E34D661FECA07A39F567E0AC9053B3DE8330E6FA84C -10A47732062EAD6DCFE4982DA630008C33823AAB374797946A17678938259C44 -EE9BD6B2DBB700BD2CE90B2407DD6F7B48A62D3A9DAB971477E50CFD4F4BC72F -5405120220EBCDFBF0034338D21BE2FEC949C90466E14DFDE981A70F2F6F26C6 -5F0A35C1ACDF277E7034066DE11C25984CB5511FBA51CA0EF84C1143F8CCB991 -116A2F8BDB68B1EC45CA2D0B3247F93B2905C146FB10A63104AD5F9C4B82C7A9 -5373F8783913A2F925B09245825E167EB08308B1691DF759C1E90FB2611AD646 -0F73248F56E90C86F99093486FD1B5736D4E0A6F880670C37F1AFBBF142C7865 -C846921E34887D57187F0828675AE07826351005BC73158A2BBA59F5E9614BB5 -B9E72334E760BEBF7E49E74F68525F9A017A34A18A1EF40ADC811DCA5D5835F1 -26132E606874DDC48E181F79D791DAF9B2668DDC6A833969FB573201E745DA5C -8176B641258ADC5990C82F9A9C8E6EDDD446843278A83BFD4300F749EA148A28 -1CEB260198F38A5090427A0052FC91364EE8A2DE0317ECC66F676E2F9CAAF3D3 -BC6E4FDDC0F31F9259EDA5AC75B969257E635391539330BF9AE0AF73738452D2 -6388C2975CD9727BF11E0C4E887511B0975F6813E77A08DD27826D609F0A2F12 -3FD49AAE57298D7D814409C4EF9C66F81A02BDF349FA0F4F8D46683A56165B06 -CACC0EA3D648B47D501AD15F83EA655D5261DBD832A6C7131A73F3A25BFF3193 -B9B37D19D2334F29808FE28BDF612DC38172E9F35CB9616CF9F2248B7159465F -FB90BB57BA61B00B4FC957644729F270FF485252643F9F16244BCF1178C7CA2B -CA532F178D44B8A7A47550BF1D1BD89C0A15AF41BA0735C486F61D5CDC421DAD -17ECEEE048CB89F0CC319D0C3809893E441F85E2635CA10A869BFEE0B753FD0B -C9849370A0CF1631DE406FAA5C4A9C97EA07608ED72BBE10D82C17CEB10BC478 -1EA17F6336A773CCF515287E9646695A6A27E84A3ABE2EDCFC49656008B951E7 -B3C0453409A7003D5E33F3CE248C108AA0553D8EA29F52ED17443716EC967F48 -D3C2E15470F048D317210A67916ABE50E11F6199D769EB5C78E447D9164BFCB9 -FA6565C7B3AEFA07018695F7D3D40868AFE8EE320D6BC24D55F972CA66BA98E5 -1E2149F7D205FBFF2E1C5EB06CB71F2F10A61DB1571726D0FC78F584294508A5 -844449982ABF95005A4DDFBE364DB40D81E573C937402ABC251B64F130BFFD0B -5EEC2B739A109B89895F8EF47F6F180A4423ADCA8738735D1287AE5EE35B0CAD -09086479AC06B5D0861D8EAFF2CB0EA7EFBFF7CA03CF6460DF5DC7FCD5795497 -57CC8EFEAF7AC8CF44670B8519825FA30825057A23DF1469CA1C14E4737FE199 -38064FF83880E04C863D4B16292084505129670B11BC5796C4F551770C2807BC -D5054771387B8FA34AB300BCA9447B952BCEEC98C72B7BA65504BF02BDAFE588 -0DCC68FB6AFAADECA915F572740233D78E6D3E652D6F8817B771B1E1B32BD1A3 -6DC2B632C92E6A2BAFD2ECC15F7316FEAB6229434E0FD979685202408F71CB8B -1201512A065271EAC2BBF1B479798CF2E3A05F05F21E123C5644F701E3113EAE -27B93EEA49A478484B91A844F9325CF0742AC676D55C9187EDEB708B4C8D1B1B -37EF1B96CD3B554458B840A8C384B89A91D53E0C8EB72483BBB08CBD9FDA0BA1 -4E124713C547E137E60B37E88AD35B0FB9DCF2A29B8E191A2D8CA785576AF525 -938D5D856049CAFD10E949CAD5F42A390045D90F2CC97C981D1FC272435374DC -3ED1E0E42C04E0984CA1E12960C2EC6BF263F4D74389F1761A6E87857967A6EA -16BB17A46D36F1AD4D8BCCDB8988795D00C76677DAFC702EE863AE02392A840C -03215E0CC08DC8385354022E7DD2923F419501297A3AB017FDA031D6616CEA5E -888ACFBD83145CB8205DB631E632822AEEA28585015695A4B206D98EBD27BAB2 -DADBEB6FC00C72CCA83AC401B367414306D36291AD777747A3C29E52992A8F25 -D3DE12A79EDBF370AD7E9C4612C665C72E57B612FCC81CA23661FDEB7159CD5C -1F159EB60B49085424F078081DC690399A5123240B698B7625AF0D34BFE324B6 -A24B1D95C4BE19428DCE545E7626705A7CAED84460B44256125B829098D97FF8 -FC319CD72C806D7BD7343ACAFD866D00AD8F5EA111E9089EF7902A56B7FFBE67 -F9BBE8853D1734D146AEC85E28D0903A94163C1BA0F0E5220558F85966B0B787 -3EBE0329D0E243970B7FA61DF295E8493C92B30B2F5019D4E4F2C0C775C25AFF -4F502727BAC48067217E5587EA0C6A24918AB20D6A7C7938380D1A342B76E99E -0F12B4C6F5BB424E447A26CDBE25766DB8A1E7E374BAFB4EA2DD58ECBF0942FB -6A54885EDA3D8CA43D8EB86A1DDC6572F468AFA03E20F0E882958AB7EA7E3ACC -8DE675B4C35F6F9052E7850E7205849E8505FBDB8168C26FD29AB6E849CF6001 -DD4FEA81FC83718F4C2F2BFA6E4C0C4FE66768B54A913D4A29499AE406B343BB -450B3D7029E6C578F523974353DE37D522E8FB091EF6106819675179FD6BDBDA -B6A42B339DCC43717C6C12C56EB5C80EE2A7AA2FFC8097EC905DF5EF9656877C -4CEA6360082D500D23BBB0AF4B4EFDF15A33360DEA36DD2591FB9DB7A1501A18 -6A31927BF5BFBA8FFFA22F9EBE0384939063BB305E307DDC3E595E525780CCC2 -D4CFFFD19EA9BA61E2BD6CBABD1CE52C9B93DBED0F486833E7A252D818EA8040 -94213BFF2DB659ADD126AD0455EE85936D6C02E67A07B163DDC10C11B5A42327 -50348D881F4005572D61CC0DC9510C958A153D6434363A52DB4CB9B9E56FA46A -0ABC1939A1FBD632E18C3D250798B27418403610477C6736004B1FBF6BE7561C -950861BB6013CBAEF7ACC21C7096DCB7B99E8F4E17815C5D40BCF2218248AE02 -086353CD1E8B0856AB31A3C2474326F14D0CA9F6A0C52236D9FB89EC842DC8D4 -4857B0DB7F37131137AB222A517CB80C671CFF8A9A5889C8BB2ADDFCBDCADC06 -CC2BC3540F12169D3C46E579E6185B218228603A4B3FA8AD8E840C3761C61217 -8861458EC8BF163C492B748FFD349E00996B78705D9DD932D6CCB6FE7D7B25C5 -A92DEC2C6B950FECB4ADF57C5A95BF7ED12E431787DD29C6D4414FCF3C4E360A -31E19B37E2722A94BCE47087C5E1845929FEB43E73D3EDA981A0FF9C0F757042 -48F6912DD892E2CF8880A9D1B19FF0A197921A2DC12881E913A4C7858A3B3B96 -E9A4DA7FF3598E74D74B04B5F2545DB3B1D84E86E26AA8396D696E667C2970A0 -DD9978187C583D415AE00359BBDDD7109C15547B9A56F978475531BE02542924 -65D23928DEAC21CC7D0C1E1B1BFF850ACF80E629EA46D71FCA2809061C61F65A -B881D56F270E8C776983E3CE0271E3F502818DB1E3EAF30D0C98BEA340673FBB -23CD34CA17648735CD2A532A8B3A530C3E523CD013151B75FF664463DCB0B388 -BF60CD928E28139A13575635F349BF70C798D0EFD52011E75A7B3A2841FC3D72 -65EF0CBC6286367F1F4B3A7EF9F1F4808954E6D973ADF0CB1893D49B47DBB0BA -AD66EA4E84BBC2F1604FDFC7C9FA0E131718053BA1BF946A6859DE3E452E05A0 -0E179B5F1D03659522BF22518338B6C98397F040F0E93F8E6A463D7D504D3690 -142E26C28172E8DB43E5DC2D45655F7D05D999F32B6BC9A9D0C89041C2031C32 -C54C4ECD75FF3A95B871DA7155A73C3B2FFEDB148FD851AD87437BED46C10E99 -0BAED69E6900AA9F66D77F30873A508C6369C4F898788F8204FB5B5EEEC4068B -2C58510223C6B23B668204B2423FE7146B7C5314969349CF72F100FEE07D4B8E -9AF97E9B7B6EC0894C6E81DE8EFBBDD37641EDDE1D241E4C4440CC91F8E3E3BD -E70703769D9AF7227E7A16BE76336B46DB6573D0A195837471D18666342990BA -4465913A45DCAB6420462C5FFB8BF1E546D0C5B009ED19C8B11F5E5D7A41A3DD -4AA97192A047F29E8C8A195634E4778EA5F16472542D9A0B24C8741F547784B0 -3CB68F42169804AD537C0884BEFC4B5C0953A11F050117C86BAD3F5E151FA668 -D83B462FC0BD10664F0962D62E31E163FBD8FEDFA0C300994421E54A9BDD620C -42ADE78FED182C26595F8CD93190C4CAC7F46D7432B635725038A4FF6DCE92C3 -9385912E24C214AE42D5C72EC74EFE2017D4428F4961D416454F41738A6C3D2B -4B59F8F915D7A5E03B6A6A9B982CD07BEEAE7760872646776324BA25AEDC88A0 -38A730B1FA17BE4BBAC909375FAFF664BC811439F269CE71B92CE5D30FA255EF -5F5CD5ED0393DDFBBCA2C4008A6D58A1E470EED8CA803E56CFFFCD581793CE83 -1D49557CB4F47FAE9CEEDCFDE140E70F70D8AAB8B4A851D01F219538D8185042 -46E442E90954118BC348EB5896BB31B185D659503B9214885CC2600719EF8F58 -F006E2EC11EF22C286B7F058E8F4535D7EF5F3B674FF0F5B476E8D75001ED67F -48029504CD633DDEA56FC7750A9F9D707C9D3416430C210089F60B231526F4F5 -3962D40FD4C549EB4E494EC03DB95DEB23A6CBF25DF58F1327470CE13B9001FD -04467E3C1FA4082DECD79B4CFF71E9284168794F2151C1BAFA164AD43CED97BC -A410DC015AD503B270D81AEBA9A963CDA9031FDAE6B51F0C1F3606A00215719D -477402DA2B221AA885F6351EE8C4B17876409ACB320444E69B0DBDE6C90E4D10 -2F72593F2C36ECEEE2F293DDEEA74CE325E806D825F94B4280E94B8F5803A7A2 -3A47DECA7E1175BF08421112A67C59C1187570DA6B60528565F0AE1F9810AE20 -E9A0990380605E0C186092B7F65E9C0F1602609DD44A8BC80376EFA0D406DE98 -DA5E4D2BC78E67543927C6DB57C5C480CAA6D5D81041432F3EF05420341F369E -499C5245507A621789317DC4C294265DB72AF96C7FE3825DBA6AB5C96773F1EB -203AA5092F63C0DC5C8D47C28F86C5E41B280C77A8501F529B1AFAA5B1C64031 -DE2E70D75D8A471E16EB1660D64F8F1000173206D82C807A7BCBE7C318934315 -EED4B9B8403A58E18C1D4D7250FBD8DC638A3D13D1ACA9CB71D805D4809BDED7 -8F8732ED4C08DA5D6F705DC510892EBC39EB623095D6D7CDAE7FD01A9E4F3A63 -64BC83D0DA24AA2333F473ED023CF9189EAD1BFFF702E0B8E5BC6F6484B6C77F -E79842C4F56244E6A5816F0C76A4210F2B9A81E367A7B02CB683C6A19DF10F98 -DEB661CF23424272183272EDFAF0871EC214A6261A93A7C8F9CD1C08CBACD9A8 -048961430AAEBB34A5EF5C0E321CD6C2B0AF1E3D81A8153CCE16C87CC7A24585 -62BBDB75E14CCC4EC692749432A52FF9827F1CA8ED6F47059CEEBBB945B701F8 -7ADE1DAA3C6FB9F3E95954CBDF0883BEC86A6F63C4A794634F503750B169A642 -3D73762550A657BF8A5B6388E41E7C8136062EE343EAF09C07FDB04A9972A91B -6E9B192EF143F9E8D111CACA0540CFB62346A23938314B9EAADB27D5879E9376 -DF4465948BBD6B1E845C90518802D5389900E1B98B68DF86066A90C7EFBAB98B -58335EB75CF3E0572DE2BBA77E7F6AF3E199842DBBB7060ECAD3045E834E1BD8 -64BDED3FBF9306C2912811E237FF9D6CEEE5278F6613E371AAEC15620C4A2A15 -22150F8B1B0C81F9A18D49B2684640E7ED5CFBC31357A236FB1942982EE96B6C -E3C54F03A25C06968A53CB9D7FC3AE8C5B917BF33C2D4181280A0242E823E2FD -DDE615424F9A3FDCCBAF420542AC90A4D9856BD2C6371F75767A6BEA4F861909 -1444B6A5BB066C63E46B32B55F2D26B97D074661CC54BA96497B226A353CE86B -62D435CC24BAC65985A947BC16218E15579F16FC8DB371582A15D3E510558BC7 -EE6169F2D9D239F40C010AD8EC8EA128CE416E21637174D34F651E4DE30A024E -0FBE8B5FEFB5C89772D5230B3AA652D6778299B048C4CB5D68455E18B66DF0AF -851DF300836E15EAE115DBD03DE42716281E531D5B6994DEBB0897B97D21ADE1 -49F76FB3DF0FD481B322E2F3CBDE64B16BB7FFF8DAE55923757F1A65FCF48F36 -E51BE3D300E0D251BBD18AC914B242D71E491F9CB99AE0909D326AE17D9D94F6 -6F8CBEC8421AE9941069126986D9C26DAAA474928B2BB477D14D7CC7A4B3301C -A9B795626F9FD0BFBDC870275229C5E67451D37BF4BF92090A5571158169BB81 -D3F45B9C6D65E3DB921ACBFF42885AEF73285D3BDB6FB4B9B8C8864BE52156B5 -B2F20F8627BBDC08D8AD002440E47A2C96D79240147936CEA7CFD7B09027FAE2 -60AB5109DBF7059DFF4FA0D8B8EB06DCC73A1D1405FC19CE7D23C18CF6B353F4 -FBAF8AEC7E36B738F6B1CCD05A0B9C9A4C13D060273DCF6D39DF922B3797DCAC -876E0635F4D60C3D5A5DB9715D09CA2C6D0D16B62B747BB8BFA0580D0BFC0469 -3D78A9331EE1C9E7D5FEB03C241B47C60E70AF08FCC5A37CD973B4C6DC83C6B7 -0D4BBA368135DB44092579F9FC257EFBC1CF7D915FFACB222D06C52E4E927178 -80EEA6947B47345342D24FC41FC24A90178BD358759247F8102EACAFB14F4BEB -256AC2EA0E6D3446B1F1DB46922790290C38F16317FEB372898EA0854C333A01 -6A43B3DEE51F5A114B90B421C4CF9F874C8AE2CEA867C7C7A95DB46C30C1AA49 -6FA9F53DA9825F54B6653E509A079F2FF1C3615F0F34D04EC75EB02BF0ABF364 -12FB55935F20A858F30F7C86974A3485927694695DD500607183FCB73F1C3428 -C9C24FDDFB844232A43D2C596605C70C9F0F14DE98F222CD610262EF9CB6AD1A -41FE3C37051B2E591A879AA425118BFDC89B41D42E97EF93FD6E50A82B7F82B3 -267FD63506A2208D35FA855BED185FF6ABD8C5B5BC833D5CACF9C71AA6AB3DB4 -992C5BE71BB6DC0596ABBAA03F89A4FB0D77FEB283CE666DABC4AC06741D8B76 -05E80D80C8D95A5E340B8A23733960DC9283ADCBA0C75B0E78773B198C5A37E1 -27B7470CB6E15CE19E890BA07CA1A419F1F5FCC5C1CB6AFD5B530BA03585568E -11063A0050CA5E8F3DCC804E440845869689478CE1D7388C4EBEF6FDFD245810 -AB2C5860CD320AAB722534AEEB9E3483329BC97B693DCF7D3AF4D29E08E83F0F -A487B723EA2ACBA403B03F3D17F8380B2CCD6C269B6D201E465973BD821ED5AB -BC7AAEB05418DEA87619D40F4B1CD70E951CF7AD151A9B8B1A127871BFEB6997 -8A90798D6D075F8C74E1D3375A932A3B57136131826C83F2B4B4159456BF5DE6 -ADBB4EE690FFD3F2D760310841CB6C21509871DF6CC08409617AB94A32FCC617 -632E3E8C98B5A2B3E7B4169E53C3FE3966CDDB526EA5A18DC4894660EC1C4FBA -25BDA925174892535C368720C92C0EDEB4A245065266674C033D90D52009F5DC -742F7289F36CE321838680EB9F8E667234E802E6EBF61B60E526E154F2BF3A43 -4925FD043EB471476117D86127AF7894C44DA04EDF2BACA67120DA53B1A116B2 -B9BA47A8193D791E951735E33498D8C705E67E2986520D880110D35C0566FD8C -EF860427BF833331A7DF3F7EABEE61E25B667BB6A4584AECF704B45F24587AEB -B6DB1D7B6972FB4B4328B2160A91199CEA30020FD62EF0337A4D4F10AF923EC2 -247660A5AEC4D22E976972C71EBE9FD9CC9988D2E272D8FC20E15C68E9CF2621 -4778CD8C3CD42235F7FB33D3DA71F5D2C5CFA17421AB95587919AC1BA75C85E5 -E459C9AA3DA52A0A8714594BE4F2AC32599DD6C3FA3340DBCCD87B8E7D567595 -14E3D254F660EF2C5EAB9373F33395BD7327777E3DCD4A11B7BFE54CE272439E -E2BCC6F8EF22672F81F20318CA95FBD8ADF3E18ED04A4E73C9B32EA493317B99 -E7680A397A72692D0AB3877CEEB916F8D7D7E7B40D97E449F76BF4B1FDDD08E5 -DE37609896DEBDE25CEE302A509968144061ECBB277142D3512485D11003E3DA -D57C8992A310C2968CDBCB65F3D975EC5E3685F0FB2D24B8E03774CAFA785BCA -F6AB8F5B958FB630B7DB2EFE66EC1C446E5EBF86C0F02EB9A96E582471E48BB8 -68AAB996C02DB531A45FD3AF2696E0A459629041E80D4B25CC6C9F60B5218C9D -2BD697F050E194E664AC1F229082656351C8CBB04F8DE1584411800C19261918 -FE7BA5FB2E4C02AB650D73B4A62E41C15D4A92EE8221C51A7C6998CE99BC505C -DA3F3F384215CE8EBD281393E8EFDB9EF91F03EC00DFFA1B2229D70143981563 -4B52A88FC1378607096431F6B8E1DF869CE2FBF2548B6C1A9D5A4E40821E3FAC -9B15907958C13AB21017A3432D57A0190FCBD86287B5E2AF6DAE27E5F34D9EA3 -1B8DC48F1574D9484951F76BF3411788428D05874F0AF0048192CC05CA43EF70 -E0E1358BF692F8B420358C131E06E33394317AD867CD47F5B91A075F5B72C49B -DF756D282F3702CE9F03BF86CFE4F51FA00D186145C002F25D4F897ECE7986A0 -5308DBB80B40B71FF4B776BB4B3F82782A76EEEBBBFC3278DA716868DCBC097C -D3D3A37B935809D7FEC58B537799E1527E7F0094B11490F9999D23D73C129A0A -7048D4CBF9226064A31B3ADA9C19254A20DD1BFACABAF15B3DDB06C4D7E65591 -3624A68A5559C9BA94E47BC2C08AB8C6FA3E0A2494EC8B40F90E0CBF14E5076A -CB91AABADA49BBA79CE47E70955200256475BE67352A65C75292AA82FC3998D9 -DB4D7E5366138B7C516819F0EDDF92351FE34CF73011FD339B0F8380B52D7C9F -B7EEFBEC433B3CC2EAF0BA105559172088AC7BEBED21F2243E7FA81C59554911 -08E9304C1C252908CA315F95A1A896C0C1F782724D3716D3236DDCB129AC356E -06E4043FC93CA6BE977339C6527B4EA54EB74E89CC4E8D42F3AA2F7AA5BD9D3F -B7FEBDC1F174F5F594BC6AF14C89ACF1760ED6F173759AFA80476759CA2E7E80 -6BD05284C63764047A0AB8A545C67868236411D96751FDFFDD4990324951E071 -7A8E17659FCAAE93DBB7E387569959C4A4AE5F069207A13E1D1C7F40802A2D0B -8B3DA376E109A1AA9A428F23B0F9B99650FDEF28AA801C1F9B7291D47880444E -7EE09C0920ECD434CFF5B851A343BB70E2CFF06854E78A1F92CE831BCD253713 -4A92308D405B22D204FB7139CDBD1B14946F2CCAB6242DE87C5C7565EB1C9D99 -85CCA6865CFCD57DAA7291591A202492CD863A98E17F9AC2CD9867EB827E70D6 -B8B81A6996ACE08112BF38BB07BB78C6C879FCF709F8D94729D06D3BAD9CBCEC -E85E1A08576B1B4192FF26B6F923D08EAAA58EB670D84361F9688229A9F103CB -1D43978B1B067FC31CA0AEA33B5B244D7069C29B6BEF12907A78ED5128D678E1 -67C39DEE6E9BC38E134FC55DD7692F5219ED04924CE8163CC566BF6D6B331456 -4047FA2F3B2C10D95F1BA5E7E527C539144B135D3DA214B88DDD2B024E6F8F7C -D943E64B6097E559B860E235E2CD13395DD7177D7F93070B8C8EBADCB127162C -CFEC2895632A15CF1E55A525D342F96B023648E8C5479C6AA0A9BF9729DF2E70 -DC54A2A26B1DFE7BC7669FE938FFEB7582386FDB2104E6A19042FE6DDA8F9850 -D5AAD74050D5318F0F8D4D750A4492B50C2AA395795CD635C8A914B707B14E35 -844DDE1DF2912ED6B078D2685AFFB987D8C4D86A9DCEADDEAE4DA772B947299F -E5A438058A936C0AF23106FAA82C9D8BB8D414EC5371A2AE978F99513B7DD837 -A6BDFF5551C9467EA26AA91C3900055EE65185DACE0D675A8BD6C9D4BE4B006A -FE0F89713E038B7372A86D4A40532D6AD87D2FE7B62B3D2EC605DD00377A55C4 -E8392D8D3ACCC84664AC3E30C18D8C486E8C502196F4A36226C1538C4AFE302B -846F2A87AF880514CE1CEFC5973FEB9E9A48C4E356EC79D3AC1B714E23B7562F -AE7199C0FA5345D37ECB4F371BA123B67CA068CF67BBDA93268F4E08A5427FD9 -0ECF6B33837F8A4F42B37530FA5AFFF10D8D558C9B55A930CAE49172A6D36079 -3F952690DC1D987F2D63015B3DD6E2642B97D7175E345E299FE57C3AF1E83E02 -B34BD8A4244D95F7CB1AE5D501F358051477C15E534FCFE4C637E316E5701EDA -1009743C789B2FD633798171F4E88DBDC447ABFC9C32701527F34BEE07FFDC36 -003856BFA9325A4F7D1611CC5B36A4D7604484471B74EA3D8D5A28E9DE243332 -D3C6146772D773971E5BB3CA34D8EBD37C8F435B0BB57AC9352DFB3D09BC2C92 -E9081DBA9D8BCBEBE3C2C42066DA13188A5DA5939BFA435FE5D2CD8466EB0EAC -4F735302C75CBF6ECC96969E3AB91593FA24BA117BD0BED4E3F9A51384A5FBB0 -BDCC7A14B31D8833C1B796B8667FAE8348A7589218988BD4C2094B1456099BCE -0E925A5673C13BEF4F1D91A72B00B75524E9F2B6EEE39EDCD8436A239FD6194E -02AF04CE213AF8A4DE0BEBE6103A1CA891C90F1F79E34E8D7217B59F1F8A146D -94017DD36B2610883692D55453BD9300545764CA404E3699548992C65226F772 -19066C8DC53B6CD2E378C0773B10F16FDEE74FFD370EEC6963762A9EE64FCAD0 -D793878A07386CDDC0B00A6E3500D50536E7CEF106105AEB4F7FD391C7825C96 -3D1492F6B4431AA74736462D14F63CBCDA4CA2808E3C55BDFBE668F6B1AE5F01 -4A4B8A8EA303C345CA242F0D9CC02F1BEDE134C6B4FFC0231CB3F16D0F5ED86B -56A2D04CF64925215CC4DF3B51F59F69E99DA91BCE06D02872A60E8756EC89EC -15FDA8D54067FEAC2E07483F66B00E8FBD5BAD31BB3DA45A549B205B2525BB6C -74B4762CC4AD3BAF05C4A1A23B50BB22EB8D88603B7CA3052F83FBFF2D7E49D0 -438F3810F8076865973D1A4D2B06F3FC38498935E6CF0DF4DEEF6335403E4748 -611D63BFA4273A823E027AE5868907BA7124FBDF11C4E30446DBC2346B4595BF -2CE8784006D1AD74432F5A3A1E5A7E6E69498995114830D4C7C9057B0AA4476C -A9F5F44B45861ED13CF485B3CAE0E0DA24D805B5FD78D96064EEECAD82FD881D -6046574FB32545B5B9D65C46C7605925054241013115C1B0D112DABDF00B45EB -11CB82077372FED9B125B9091129BEB6F8F71F093CDCC5F3ECE4A9D33B55803B -33758CB9F82DF01DE13A7E8C800BEDEC6840E37AF32B40A412F6DFE46E9B0469 -F96589AD547D14F75F9B694071F1F6F7A459EB8DB009B26B9DC8744E250A99BA -EA1421504C17BC772862BCE3F07EE747D57487DC8A611FEB526095B872A10902 -6839B37E552D2C798F761EC0F1698AE49FD98B8CCE873259B911D61724EA6C5F -5AFB0E44655BF454D1D35936638684A5FA041CC0E1884E362ACBB04BBE704282 -86E87C674245143F5E35B598F431EA3DCCA443318EFB85242AEFABD64B8F1A21 -CA7B1E372748A25ECCA6DED3A7E81737AEC77561723ED57A7006F96D17B8385D -91BBEA3A651B5644FEF22A577543169056230A6FD1651EFC5140F2FDFDD1B417 -4B458D312D9B58176403D160628EAA9E99CB5CB7658DBB9A2217CFF17A3F5761 -39C720A5924739EABEB75FA12277C5389166FE5891B484C4F3317B2513FF0EEB -18DE6D8CCF1306FD85C5C19D47C1C36BE1BC73957F8291A641E39877F3ECA3F8 -25A539CD09D32741C725A7F7520B288670AE6DB55BD2879005599744CB54B1BF -8759C7EFFDAF992F557C13CC77A95FB0778628713ACA9A1A4F0F9B5304A2E828 -43F6DE633DC423B4AE3AFACE6D08A2CB7BA7CF2A0AE3D52100A3090637B446B5 -3D69CD48477185434B35884FF9A965BC434A6AED30C26537E14D7F5E27438F5C -CE5A8F4B01B0375092137154A9937719C3D6874C9D1136DC203C1F5811BE4C8C -9E10437D27586D4FD8B4A8146B0C96A4F13FF403188A9EFA26D0974C731CBD7C -143B1AF2EDBD2A87304C5FA205D285D324BD21C1B8CACB4F5AABDCF81186B08C -19A8FCE8F94CED88BFEACF2A6E237BACEDECE38B60D581CCB5B5B5D86DB88486 -0123DB51D12D11E49379765CC5994D16666C886D18A8D44DD3EF0235E14156EB -EB767237EC9A93606E034375048396DAACA3D20F55666D0C1357222572E72404 -163C6F5F398A73ED1395AADF530282D61879A6DEA51473A286EA7F6243CADAE4 -BA9342FBF4A5248C1915590189A4616A3C774304B6E88FDF20930552BCC493F5 -0FA5DF80C3C72608D532F4F5933A225DE0F261A1D33D866417E49DD3C5CAA669 -853AFB20D792FC6BA87A46049621030AC1B7176156B1D2F49A8DB24861C14445 -4E528E2653D4E4F41681655CAF55E57A8C1D27B60ACE5AFCFC0EC8839CD99387 -880E8CBAFA86B397E8E4B6B286A8BB53EB55CDEB3F8A238B15A3C1E5BD457450 -E3DA8794F224C8EEE4A09CA8567A4E71FEADD076E0CE221A4834B817A5F5517B -5FAEFA742EB1CA422822BB178B19225EC5B90387929145F7690A2ABF9043E595 -E67E23C9482385C17038DC83B9AD1EA4B0D5E0E0A9BAF8355EA256808B55366E -FA65F8089A406983191238BDCA8F61C732D99E204CEFCB3F344BF39E240B8457 -5A6204C0257753542985E7AABE35B01B991AE9B4B10E87B3FC44BC3A14479902 -CFA8572E0D255269B7ED30FCFA1023B8A614586C5A2722EBAEB9DB53E87BC93B -BDC9CABB3EA3BD4938893D2C8F2A198042744213F419C5571540E96741435FBF -6AA57E260D84DCBE3A214954028AC1ED4DB2C6DE2DBF14A749647E1641A7863D -B91A9801261731B65BDA550A199941158AD9827527B9D37464B8614438AF6008 -2B285CD83AF213BC6AE6198208BE43540B76165A5D5617C01CA772BBC98F9C30 -52E67F6E25F7192D36A130AC18B71E38D20A724E28C109FEBA4A3F1D677C8B67 -42F22120C99FA00FC0122F18ABCC0D24CC32B09CA42D428508AC63E421F9C0C0 -87D277AD58DADEFDC187ABC7D79F8504DC1113D70D7CEA1B4783AFDA128EA7CD -C7860C3ABEA3BB53D7AD6EA3C116756E282C509058D599FC34B98F7022CEE941 -7108B44C0A6AFD98A6E79109F8685FDA6C2AFAE11BE2478FCD4E14BE04A19DE4 -822906ED944EDB5B532DBEA395A09C7156E45505D43215863F63B635C5A30F6F -C7E316DA9650D9B5EB90F6A45E36F2D2B2CC89E18A246FA7D391A7728D51B18A -D4C92D0E97BC88A78D5F3F5107938BAEAFADBE744EA9B9921177C86435A6475D -5CB3F71FFAE0132E0F288BD509993DBF5C35A5C3B87EAEE7D3ED71B73091562E -45B022CC7FF481142E18A8D98EFE703B4AC8904D275B08E51FA0DBA6C6FF4E11 -0D0334639A04311F6AC5ED7E2FD7E81D573B14DC0A7F5A6720D2F2F235554B8E -7697BA92F17ACDD426E107A266D8DE4F774EE90C8FFE38193882015FB1FB1F77 -DF9779C16BEBDCC6696915D5E977BB40BE17CEFDBF4BB2340B35610F2BD333A7 -E0BBB08338C5BF12BB103756EA1BC94566FBC0F1549DE72DB4404D703DE8D566 -693DC9A8BD6D0679D54FE8FB5AC0934D2336600A1B528E0BED9F18B93F6CD0A1 -9363ED941A02704BE7C8EDB90C7CEEAF5FE0DE83DE1AD9398E42411BDBA8C9FF -266FE82D375FF6B6B6B42E3C72F9D310A3CE90D112F7F0BABAA8FCD3DCBA9870 -91AA07E001EDB3C1B8452EAC75169E0A23C108FF9020C4CA9CF2A0E2A20E53E8 -42146154259263EE4BE01DFD078472363B0481B730FFF03E6B2322009818DF2F -5B7BC17D57A70A9D02A1ECFB9CFAC92B4C43DA454E97EE9AB42FB800F397C403 -785B59D0961536165B7D5CE598913155A75310B331E633AF46A818FA0431F7B5 -E408BBAB437A7B9B47BBC875F8B7B14B7B46A421CAA505B3C6FCE2D6B98FEEFA -BFC8DB0B5182FFE040461498573AFE9ACC85EC4AEDA3FA37086CFD35155115E4 -0F5EC7170E19913DC7EE88132663A1B1C04521A0216C73BBE09605D3D76CDEA0 -53C53126DF96298813CBF9FC2074167A41E9FAF05868D80CB78C1C114473667F -52E8DA719E7427A6F688C5736E59FACD7B86856AF7AEAD82AEB9A3F3B76220E0 -1DB2ED0049230607E78DCA5CE38DA174A9CE4FEFA0EC187DE2020D472889E553 -C988AC4A918C3CEF06EF3BB4EF02C2725D1A9EBA406967F8A4969694E929C1F8 -7D85E82A434C5C5E1C5D9F03AAB7FDD6DA21D3E95B0F6709BA6CCA5F37D6A7EC -58CE5BD8C82FC1A5A1F0B90A6E49F14B04D8BDF6243CEE499B4303B9FC35E853 -1FA4804F9514F966FC5263567396E28A9F605235C797ABAEADA1C71646A2FF24 -2753C6D3A5348441F196294860D44C47DAF1E50B004CF0677CEDBB7FB842B7A4 -90E4E31E85314E9031A665CC3EC0B3F0368567E154A4A6CC206CD8AE3CD45061 -AD67FA9594C4B3FD7BB01C6409D9C5E232323C60566E0C254DFEF45282E75676 -5BA6FBFAE1FEB9477BA7931C2C47F3EC2FA506E7DF6E1D4D7C60530F33F4FEF8 -DBDB65507F002E7DA817695508896578D84E2124748EFACDD527F4190E7C8931 -D7D30D8A7FAB5FFB4F55B8DEDFE2CB84230DDE12C54106FA697E84B320E0D508 -ABD664C7FE500549229636138BF213EB55CB325210895024F8F748E9B8A85AD2 -D5B1E888A503C4BCB2C5BEAFD980C202A0C580848AD9B7088A53AAF4AFE7EA35 -D1F3E05C7D1348ED6EDEF9D477987420E79590D1EB76F33043A6D18644FD3F7E -E65597D5C699447573F37B082DF8D4527780A5B77A7A1C337759614B6B926183 -83B7585A16886CEB3A8EE1622BEAFF917B2397FD7FA803AFAF8F0DC99A0E202D -795B4FE27345F3D275D29AE0A13C258C2EBEE48E5332C0064B1E08F82E2D7094 -705BE9F0BA6CE2ED4E7C34FD707F4DC9B586718D2FFA05108ED8F7623B9A11FA -01D3A755250131A5BC85DE837F8F6E4C56721747A00830395E2274B7116C3845 -EEA1DDF51FF498DF2F143DDDF413870FF42CC4F667802695233C8BCBFFB5BB9F -C416A5AD416CA61832DB67A517345F041A85AD1455D7B8580A04CED89CBC40B9 -6BFD0598668F99616579A960061DDBC5E4EE436730C932D645839848A1A0F5B0 -B8DB725B2D83F436E23B81B04B3154F98DC99032AB08C897DA86C933ED50BCE1 -4A728A52FE09F910F7E47BC3F2DAF8C22DC78DF9EC66C2664782FA94B3B9B56E -49481B999BC60526881A7AEE7DA30EAD63A32F65D3FEED5D8D6CF94BCB618A83 -82EBD5CB11DD9DF1527112E4AB18BA84D3006F0A0E2C2696C6730BE9C8056FA5 -22D5215932558B28D2CA5CCF2EF5075E928DB301202FFAFB2578BB25DFA6B1C3 -20077C418C1840245F73F8E9EA4C473E182A46A33C3CAFDBC0BDB2B67442BD6C -77F2EDE389AA66AEA8E1047FD90830FFC5A53C05A9A5F02361953A9A6365F866 -68D2AFB36867724E5F1E4E15DB55CB82332AD2B50D1F4FF598743A5BD27770D2 -E80178E01635596CC17D1625C55E7BE5C9B23FD330B1CD1AFC3B250A359F47F7 -25E6A837C96953EEDC5A4F3249F50435432A4268710DD9375AF252C2B1A90E67 -92545928DDD1FBC28971A075EF7F17AB44C51D4F5628AFC8F53B1EA0E92BB299 -E50CC983132C0AB98BE00FD6E9E432876859B25B9835185DDF9F88BD9D1045B3 -3498F720E9A146FEE51225A5C72758350B48938E63D92D16EA5E700C48EA5C75 -B493C810D5490EA12FEBB381ABBB5AFC1DBBBE50AEDCF797DDA608D4A4412F20 -4C697DECFA4990F5AF13CB7223442714F907D5C3E41A01CAD4744B346327D7CB -2BC0B1CEBD3E711B8E63A7A28A21905488B6AE388BDEDBA2C4D81DB3E8AB4BEC -105FB9C0A25BC6FF47973AAC6AA236B16D6EFE49EF27BFABBB061535970534E0 -04C6851F5129A7453CB74A1E4285B560ADA3D87305E0EA0BC89F0A6EEB2AC5F9 -14520E6F791AB083DE23866A4A84342D751D8494873F1064DD3CE7B7FEAABCAA -EA808E944DC0311ACFB1DF0DE76EA38DE7E33AC71EB7CC7135D94FCE33FCCCEF -AB068A62E2B9D20DFD65B57E7F436DBACB5E308A8E4502C37BA0E4DF7AB021B5 -33C6C93C8AB613AF3D96D7719E56809453BD1E0900E4AA9F01CABB634D972346 -081AF11A1E665F59E4BD86491205F43A6B21EFF8056478293CE34AE045DD7A57 -6C5C33AC194764C0DF930EDBCB162E093452D15A72934141F683498684C951D0 -733DB2FAAA862A3D7A4CB337366F8793A9B865D70EC280CD084E71484805D5C9 -7823ABCAF00585281C5F0934329F3265E38045E64752B28CFBB668C8077C39E7 -53704F2EBF5A95A8F6879E2135374CCF7A50EBB6DE63372975EC7A83770BDB60 -EE4F9DA3CA3DF1E31E5B489AA62E29B92E90C3D95E2C5D9F285CF3800265D8B6 -ED1822CD6F328059DF29C154ADEE3FB10D56D8600055A823E10D9EBFA3778A5C -BBCA59FE3F40EA37F67515E5F947025F64785F172213045E882BDD672F434B3B -2B4BB66EBF9E85934F3F3794B9B320D1ED0AB3C3B68477A595DAC9536B2E4C47 -E6B7057A96359B57E02F7282F35E9BB1A8F7DB62C9809BB21898B6402903487C -2029C7300384B376346424D99E2CBA82126666335FA8DD0B5225823A733457EC -DBEBC89FA3FD249BCCF746F8434B8E60EDE335D0F515A063260D6C6F0B6F5691 -96CF588D856421AD4561C864E0ACF9FCCD4CFDB4EBC60656D66DA3C1DA212A55 -6B4617DEDA813739C6D3D07669EC10F669711A17B460C00AD47359276CB293D4 -79B41F1CA8CD1129A6313A2253A29DA8C2CF46997F71AF365954F5F612141198 -8DB049ED9F3263D3AACA68FACCED6F24BE3E5A9E602F775A79EF90AD4FB00789 -D60896451A39A34648C7CFF8AF04BA351EFD772CD253BD902AE55EADB42E536A -C1E711854932A03A36D7C3863CAEC28E4FDC836265504FF8406675A625644168 -3FC2038FD2F050F8C23233E0481832BEA328A7FC5C45446EA919DA3ED28F8CD2 -D8D93AF013B006C46E1508AAF9D159C348E04AA3E78119E361A34D67958DD040 -DE1781D010C6F15D890C0EA00496E8ACA9E3440860FFF5AC4FD0507983749142 -F92E2DC5B8082A5DFBC0CE442946ACD947E8127AAB82E5A60176735ABADE226E -8A11D6D40F267030B3415603F18A59BF6F546F5C72DCB84B9810DBA500ACB230 -2105356AF679B3AF478E0B0FCF991FE2F2D046280CEB35647F7C63A7D6ADD948 -D22E8714B263952E07716678B4A94B5A5764C69A6F268CD58285A82AA61BDD7F -3CCD2DF266C35605FF93A95A46C44E93514094592EF43425FE5E1F49206F0551 -DD35636F54BCE90746586FFEF34774E43D2DB09BD6A06733DB1D8648487BCCD3 -F1DF35D24638B081A4F04A41DB88609F63CC2B720F96171360D74DE840EACFDD -36E8D3172BDFD986A3F7EE97DF58B1BE6867C306C5DFBC9F625FF2F9F743A884 -16889BC87FC49247FFA31F3234815B6BBC0599A9463E3AEA983346F55DDF8F8C -A19517241D59B502D099BA9A1A254620F087DD37A20AE13AD23123873798DF22 -F94E28ECD0B0BAA8DFD8896ADED992182F78D35FBB5CA8F95A69984FDB9480E1 -3D524CEA820DADCAF0184A565A18AD4B756A287880ED3125581E4F094C6D4AE5 -3B7C7820C12458DA98A99A97DD7F9587E9352F8AF642133C2F9E2A646B97920D -C9033A1E95F5F8A1EDADC9B6E7ABFD29F9CB8DB9365FC60B50BD8C0506A62EBC -EB8A8050C1ED1A9E0A7F975DEB2BB91EE0340BDF44538E03C102627691BEF28C -4243BB73111382D1F4F2C9D328EDF7674C7CA2BFF1570E52C3034B13E805E75A -DC945433E1222B4A711B6508C26A4C3D0EAE6B81A664CC9024907319AA5E3423 -F9BC4A45A2E2A1330D2D6E6D087ABB22BD7F1006C1E8763BE1338E1C993432E1 -654098913C062B102A53F26F4A730E0756BB4A47FE961EED2A60C6638C1EE93F -75FB104D556413B2314375DB036F4225CF86CDCA28662730E5022B980EBCD6E4 -ED29E615CDE69EE00F5DF937096A53CC303CD9A283950CBCE8BA1DC7592035AD -FB215A6E4D2D343FADBA32EF8B9CF34402B89CDC729DC57F526FE3CD4AD46D1F -295BE9B0D53FF0CB06EFF1919E9BA9019446CB33ABE3DF3ACB7EE9F5E02F9795 -BEF2E808CCC7FF21C9EA41C93E9672C035E37B75AEDEFC6384ADFA52A0762E41 -4557321D665719B7F4E43513C997DD56D526C10641CA654C19C2D35AC8CFC0FD -6946C733A51BE65AE583F186BFAA4C8C112F94A24D33B435C8820F99E1D10F4F -BFDB89537ED95354FA009A4ED9F4E3CFBC93D8FCB674F0E1C2C4716A203389E5 -A38E42C10A4C41EF6E63BC0B7D584A97FA508D4677F037CB1005C90816B90E96 -3B8AD64FC8D63E9DB21B4A8DA53C75F4BAC0137BFE9FD710D1B8E5EE3EF21E46 -4C6AF9F5E4676810CC19F9470FEAAB3D30F409AF9BE1BA0D03229F6F5BE5226B -9471585C007D680F356F1F564D723049644039D1D3CB6124ACBE7C6BEFC36597 -6181E15716F691FCE490CB0F05F4E550AD35CC4D345B2BF4E85982D523BD919C -73A974B806A1C8F78507798B5296D48F8A4B5BBB4D7B736C6ADBFD00D2590D3D -924406CD1BB3C89636C55B1C90B69F51861A654D6683A0966FC413C1CED7CAAD -243262B42908A3A16031EABCBCE4FFD02DFEBA01A0831BD1C8171D93635A1F4A -BAB522D93E4E00BB91F7C18B38EE47C5739C6D215E330BA68DDF5A16BB025E6D -EA4094D60332A289053C0380D456924C548588B9A6F0330D351B95E511E00C1E -8D82BA7509A653A4EAFB2002048632D63B9883AF38567E3AC185A82B7DAF3237 -42DA7EE5A95115E5CE652D507D66073850363DF068282134BBB3928551DB1A18 -8FE10A825C388A73C1F3DB270504626154C4D6A61A750578A107F0BA4780246C -6BE6C4B69611B7F01EDB605B19ECBB7A229300893504F5C32E0A3BD998194390 -5FA3CB3FFAEBAAA2175B85DB4B8EB762BDA274FB322FB39CCC73689232CC0A83 -8E1EFA281735FA00FAA4E955348A595240821D120D0C9ACB6CA8CD9ECA4980C5 -4B547873A58BC840A28592C3E66000CB4D7A28CAB1978083EE2847F2B681EEB5 -2D2D892D32904294C8E139B0FA4581782A244742226CA8911F83C1D7C98A2A92 -6025CBF85E82824CECDD6A9E18445BB815FE21E80DB10E2120D14DE94B453274 -E5F65F6BBDB3146690B0B7FE4BDC1C4CC55754304AB6B61420164A88A76E8541 -4722CFFE8AA2664311FB7565B3F4FD6493CA2A30DDEDF03F5749515DF9214E7E -0B219296F094F92637A427C30F9FB712C3E8F11533CF5C1F077E808AF37E3E39 -94D4B0417212312BEBF1F4F03F95A1799E3AA24352B93B2BA891DD6183DD124B -B9833C82F4BA2B41403233DA8ECCD88842625A8DBF00B5E3E83989273A3F7F01 -DC31FADA68CD56C8B95479B21EBC2A295D76B68437B80DFCE037B3BF87CD2170 -8BAFC158730D3B2F695DD6C701C65011720B3376581D6BC79166EAECFEA6F9E0 -40E62651FC8C72F47B47CB2E36A4E7667B95E82C88E20921A52C76EBBCE06CFB -29AB75D051007EF5BA5EAA35FACBF549A85B3B6F37E3D206F7C8D39C2085E3FA -74D3211EF5E61592ADDA9092C0483B9ADEAD2C64B6778AAA14FB6CC8A4FC6EE1 -82999FE543B0F2DEDD7E442E0BCAD4212F38852D6F2183EF8C3DAC77666AF856 -C410454D9F1CDD07DBBEB1547E6718FB9B79D00A9E3F744071CC75C3F48F8BBC -3F09406F816A86BA4CB0D169E473AA3A62D68785283B8C5862E631A9BA78200E -8718AF68C6215B68675C94B43EA901592FB2B8BBD53BFD835356FF45A200AD55 -3075927ECD06924B6DC3F7FD0C4FA9AE61AE9B1C332E2B996612E8D9F49257B7 -10D8C404213210CC338206109F6A0B5C7A1B9AD18E0979A790498C5BB0BBFE1A -3F3249489FAC00A369470B697344E989099D9377DAF483C93EB7E7420DA436BD -0ABA11777ADBB2716927806D95526AA226E1293E84EF76807953C52B515DB505 -7942B890DFB216807468A84788EC815677FBD55C02CACCDB2654585E42DA9A47 -16C0D5DC9D321C43C5E17EAD6E80DC8F3D11D50976FB342E1D16D2BF5C8CD121 -1DFC079858141F3631526ACF733A23E71C187A6E7933715841AADC7CAF7060A9 -CBAC2B04E33B047684487D4BA94B16A4431374A8867504A4EA338E192532476C -D8EAD70E0CC6BD674A8AC75DC18C4E4C2E785FA52F89EFA5F0EFC6F624F30595 -1436CAF9F1682D2FCECD7AD11429EED4F64D82B51F8E8451802D4885418FC253 -41EC5ED0821E7BCAA89BD70A62D281E90938332744896875AA79038971E778D1 -2E350AD149AF542C44DC36C236272FB12BB8690F689C74736C6888E2884BC0C0 -4E105537BCF3C8F0CE8292BC5C044E2C99665F3247AC9330A516A76420D070D9 -0082116A6A43051DA9AC00B71879F1C9C1D43EE163635E87852088A6D3B77A4B -574265A679334DE35F02698EC7884C8140207187933A36E2C577753E168F61C4 -21E2A3AB436CCA9C0BD7E996BACCB156867A89ED2B8F8DCB6DB9CE8FB870DE91 -4D1CDFA268E5BC6A4AFD1B0890998345F2754045257BF43591473F351B62AA97 -D7307BB7AD7C8DB43A73D5EECC987F34CAB192480F570574227E2224A5CD0A07 -3E2BD0287A3C313EDF5781A4D9E1BF2B2B8DF35CAD3DB80E0C5B3972260BF124 -BD3FC3EA966B57D552DE87822AFC04A46291CA66623FE48F0FADB5DD7CB571F6 -F39F0CDD7F541C9503AF6008B389F3B1FA3743AB1774F0C9FD4EF228D1C0F9DE -E10F5839D69560391FC0AA8EFF9D4B83A970FE1351CF6478E4D91ADA69E3240A -B1B09C1F24ABE2B23CF8D74DE43E3301E60F21A12FFF51D03AC00C2B44F552F4 -0503BD7F3EDAE51A89BDE38ED6A4B16481E457517A7E363CCD3FACB112996A75 -771474432AB0F08DB7F5EA12C3036697CE979D321B7AE1E4A0C1323E05C0C4A0 -13C8F18B2F59A4D396182763B94A855CD4CE21E4923B6B9AB3F7A9127F5F5BCD -3C4550F697B4BE1ED870525BC0EA67F994558375C9E6D28D618E9CD9675CBFE0 -BF24A75A1B90B73079E2C7222B866C89D4D0BD9A041EF0FD603AAA9551A64C2F -EB53C41DF2CAC894B78F8C84510C79F11CDF8518D585A2A5018A55CB8EF9E30F -77DE2200F679F9C3642ED792137130083C0F516C98B6EF34758207B799FADD76 -E0939B3C1AB3AA12543AACC2B9BD2642B0FBF48E0427B64ACA02F1BFDC501413 -83E32E59F705BE89284AD702CB6F9BBB88F223ABE70B4256B8511EEE6E21E048 -148E8B4A7945A5A67D9819B632D86D6FA1CA5E0D040994D8165A5DC175245D68 -42FF80A82575AAB2B91C0472F97FDC8B537201F2E551D18CA39669DFCF0A1586 -370AA32695557CDE598771E158B023404861CC76464E098DC4EE83D9EE9B5250 -FAE90B4E0B2D46BC459D99B706E8740DD701F4C5F5D1DFCF365B261405541665 -B1E532AA3F9F03ECFF018E9FC36BFBBE50589308137B120975F70A3965582260 -1D975C394A11304AB7EB5A1448FC02CA062D2DF50D3611C2C00179501089BAF3 -E57DB91CBD6812C695B0CFD658D3AA7C2C32713B18D420AF945D00850EA7A0BE -B98096A00D9AD0ACD656D4319377700D0BCB6FAE93A54BF27B3976B8353A6261 -E25402861065694F507D81D099BC6E4EA8D851277A8273E6318739D74BBD7344 -5EEECC73CFAA72DC0B7EC2A8794A5DB64BA9D4668E3E9F330DFD7F27CB83ED92 -C0A8480A15DCC3A16B7EABC23C594309845A4595164711333B2FBB9F877D8A9B -426130F95F3D645A3336EF17DA63109B5BCCCD0EA1FD390E6F0DA649F81AFD8A -1973EB6C74F7663D0BAEBBDD9B0738DBFAA9B7657E7B291E803D14F1EF7EB1C6 -B9306C771E3A5AA3AADFE2060D2323A9758412BB6E44B95F82DCAFADDFFD1A6A -7F194B3E4F67279EA49410DDCC1F7DED6C0B34515D5E203BCE36F8755EB1C2B4 -8184AE1B1B570817B73D46D498358C4ABBC349C283DAC96B3FB23D2981E47337 -DCAA2F7C1010AF1C4FE80B7C22C534BE4FDCBBFB4731BF99A369E1E3D6231132 -F5AE9D2A1D701CA8B9F7AD88A5E17BB90C305D6604986C41058C6CDB78CDD043 -CBF6FE9D482363293156C6069C0ADBCDCF3710FC904361FA0CCAA012D3879556 -066E179E09FF5B001B52E838735AAAAFA899E71F2928562DA997133756576127 -CD0FEAB3447B5EA57BE6C32701D248813EA8B93E869F2137F65D5C1A0AE5D5E4 -21393E16DA6FA116864D07D17B1C8F08560DA2532990E2FED66D0E0FFEFAEE49 -55418C41DF71AAE21318D1CFFF5B38C90F7763B278DC825CD31CE53CCE9CC805 -C5A11B3CCE9EFCB43928C1E8482302CD6B66A2CF7CBEA7E98294F7F25C490478 -3080E7121F2ECAEC5F3563BA632F2E2019398B584284DF9EB96666FDF10AB2CD -2D348D416D29200EA47B9F3CB5DA356DB357E0682943F0E5FA543987EEA76020 -F633FC4553F3D4E2FA6B8666374200BA14F12E9384A8099712A2E17916C61934 -317D443E56D8C3B5B11B5ACF389C6DF35125D399D19EDAAA53049E119EB110D4 -201901CF7D967B9BFDE6A5ADACE2222CCD624B6889D3574CE6E94F956198ED5A -0245956F031084B7539141D01C5B66F6DEBC3C4F2E90E7756FCA65708F755E61 -71533842008AF59B1A9AA5372FDDB7D0CA18BE1EC8E399B4787CDFAA931DCBBC -2AE9687D973DA7EB4F2F764B8EC359017E1877F4EF5B81A4A7684F87C4F91BA4 -54644E4C2D45F320A4A58592AFEA5731D47A118C814136EA91A00BADC6946669 -5EC507D7854C1C3AFAD477A1D844A520159FCBA8AD708B522B2FF6FBF55D8A0F -6FD97F7BB4C4F61DEA1237DA3B8E42409936DEDD8EACF155766889931C4A1740 -4C3C646904268114676AF5B0E5E614930B0836BCD5292128779645E2D8743D5B -75D8442A911425C3932B61F14C97EAE0D895B97C957B9C0489D47254A4ED52DA -99F6C27F314E03812E6B45B690890743EDA6CB6410952E4AACF4EDB38CC22C89 -2E569D597B91ED013F696F06BBA6E6549C4B74B0D6DA6C7251E744CAF092EA4B -D3ED88A4E5F8873528792A2549133E25C27A77F074142E38D2CAEFA2D83E7409 -83488D979E5EDBA0AF0EC16BD4D5E27E624765A93DCAFC7911604CD2530F754B -C64F3F70591B8E91B2C28DFB8A4DC3534C6C74206D562DE3567DD3C2AF1DC5CA -52C91FDCC57B08E23D47A3F9E55E1CCE984991AA4701210857FD85A8C2171FAE -6B08136B3A5A1D1B738D0627F2FBF722F64ACD86A083CEF02179FECC90E2E6F5 -3567678D46B877850E30000E2061F68102B8B8E92AF0B9183F250AAE6C1B7992 -6AB521E20196EE31A08892167103257B1A9671CA14DE2079CF8770EDB83BAF9F -53DA650828761D27C50DE9FAD629BCAD28805CE37222CEAB505D9508558FB660 -04D5550F42CA25880E37B395583EB95891942B443DF0B3B8187D5715EA366766 -E59E29DD4BB93A7D0876E35CC891EAA996CEE283EDAB491FCE06AE7B04D5A0DF -31CEDEAC4FA7E7FA52A9DA00067A7D3BE15C0AD2166D5588B879E6019504F633 -95E783463A8C8418659F3ACA7DA1EC997D7A04D09F8D83784702EA9ECB3AE69D -C56A063B59A8FCA9762D3DA187DBDF3DF719778F9D2578163CA01DD9B5B78DA0 -B5D9CF241A4B8ECFA244EE22D3B59BF9ABCE7320DEFADA12D442EAC7AECA3B40 -8EE795F3909C603B80DA8F2C1DD9441F84F9A41273ACF33D03F111FD78259500 -9BBBA8C3F021C09AD376B170C1C5FDCE2F8882593219D3955D73C0F9827A0A00 -262B4D50A92969469C1A3399F8580B67BA618D99947CC2D6001749FF6E90B2CC -07617E54B52DC6C952B5CBB975CEFEA8E4FAEA7BC4B019BCEEF05729FA72E585 -001AF774F0F62C33C0D9C085AB8952CD7C05F0C4B63DC1C1C2EB91DCEB7A503F -F0627C145467F95C8E9DD49FF2E8513A3691B4EA94A96F90774B839E6A7150E6 -842331ED976434BDFFA7526B4D3B4204BFC3C550B68F8EC23C735D3C23F97796 -4F07C86CD3E76AB44A4883B21A75A70E7C10404E6EF46719B9D00772E515BB65 -7B28F43986A8BA067C6686E4BD54EFF94038750976D74D74833CF394D6ACCB7B -40173D0B70757EBEF5FB4D30C487AD7839EEF48E78C4550FAE0F1DE33D6A472D -CD3031B2A3DFB0D743BA0FF56F6BE3E0EFF3A7471A74A1F55F4F4C1998BAC995 -3B5B456934344CE6D634E1F2D7D12523D1EA8720A55D5034D99543A80AFFB0C5 -D352E32A35DDD0320956D21442B3A6E82E83D81CAA47043944FD10CE1B505B97 -D6466083F1F5C6DC2B2929783F12658766898848C1442487D0091BF263CCD603 -52F2B00878D567075D442BD8731ABCF5D2C83F36A0F9A1E6513774501213BDB3 -CD17CAA600F19DF66E0CE30233080DC6DC9D554D95FDD1AA2BD681D1C992AC48 -329206615E6CE9EB6DE557FAD1B93BCE7E629962E42E542996231E4F5DBB96F3 -C98983D0F5AA6A21279618F524DB66C8863937BF8ACF9EE54C403A7E4F939388 -76F64E7201FE28C37D3745B817F282D9F85FC68693EC7532EC329DB55D4E69DE -30F7515684E7F0D0EC089DE4784617BAFA338B369BE06ADD099DD7EAA13AE100 -6A36A3E098E41ED121FE71C1958477B1B592B32F9A772BB15A8CBE00C2CEF494 -4984A9C5C590BC158EE52960D641FBE2FC2F8D5D47E753F67C9581811A51E4F9 -9A4EA2F413DF149256CCC0F0F3A31207E8E3129A0E3B26A0775DF6FBD0DEE987 -3D30C1F5186B4E26F574B0CFEB2DCBF60DF97E82AFF543A366F9DD6696851741 -AD6AB8351D633BE824CBEBBA9C5A98AE6F1E23B9587F171AAFB43611DC5BDF76 -2BD293B37EF19137CE825A6B8F6413A22ED5E46BB4C922AD40E2650A6B4D2277 -47281F7265F3ADB31C432B7A6B88489D10331A923B403310BC0BA06B85F48785 -72D3259E3737071BE8A118D9549F3479A928FEC0116DA2B41D12BC958D0918D4 -4A8C9CF30FEA2149B200FDFD03B4D0CB0F148E89C344B90C59936A4E7E290654 -81B2444128E79E3D5C8B8A4A4BEB8921C504050F4177959B25F33FD25744080B -4F05595644171EA0FCBBE047F31BE2976FFC586B38B9982CBF76E2A67C8C50CD -3C594701C91398605EF946D3FBD80B96ECB679CF5894525BFDB39690431FE060 -60689DF26CA49C37041EA77CA90E89EF6E78C4BAD0F4ABF33626ACD029FE4809 -C409AE68C321A594E19A081D4835A538B63FE0B7AF8EE3B68F34E2F7976D4EAB -B865510896B0133C287A3B8FAB4FE04E9A9BAC9865A705EBEAE689D0736D39BC -5181AF6B84701CDCB7176BB0F9107FF547299AA8B8C8E8058D6B7805F084CA22 -CE4FB9F8A520835695A71D733CD28991F6158DCD0C43A09314BF520BC86BBF2D -179F0AAD7E934A586F31A196F2A0718B30983D13F8DEF42C59B7F2FB0F8EB3A1 -F8B519E9B9CD59E18B3D5240F9EFC306BBEC014FC566445BD8B76E5AF0252FEA -372DDD3DAB04E6D574FB30653EF31F7D2CF6B6F3DFE397D84DFAB299B7983BCB -8210FD423D64A0BDB250DADE971A61D08B78EDC48C167C579B8926C60081EA8D -9BE64490D5A6CE67CDABBF06041AB535A21380D43ADACD1B5C62664BA44FAF70 -1CD47EAD956DECAC0115273386EA8F78B268DA881EC845EEE5F3FA5B39B0A258 -E475B58AA506B250DBAA66059F7F420E3686FFD482CC9AEA884CB9DB881B4210 -A41BA3023BE3F62F42744379A82B140130FD6037773E62E4ED9AA6DB831B23D6 -672115DF51AD99C61696594E9750E3F9D73B215345A1EC45FE47F8984C4ED919 -B09A00582B00E72E38D602F5285C7F266D95AD1FC045E63BF653C8E781AE40BE -84271632E81777B0FFE8AC6C53CEA0C785E4440D84216D2EE98D8A589278E06D -FC7B5AD41D3DAD85FB465F63D773899CE58DB1991E71F15FEDE9183743F20933 -3CFC0EAF71B9711022D5AF0030016F28D7D5651975C5ED9EFCC7CEF436464F29 -39332330A92D8F8225475BA5CB2A6FBABBA28930BF747396C2F2DC0542BCBC3B -98ACAE77991DCA7C81A3EE50E03555E9578D516C511FCF7682C5203CA9E83F83 -ABB3D68231F4F3445F8AAA41642C47E1400C48322E4276400D9CAE1A62213F4D -55B854C7C255D24FFE8B20F3C67E796C7E8146330E43167FBC56434E40167A5F -9B8A9273FF702A4F2A48B85874D309DB3B4824692E756981D7E53AFF26A1558F -5D7BE49021311B18D34636D3C2572F3B0859014DEE1519D5FC47642A08FD5B7A -CCB41475ACFA477D496C491739D4F32B6239E220A742EF9479A6C09FDABD580E -E172FE89856018DA055DBE38097073833FDC90D9416B81B3B397C38ECB092D1F -98831F1463319D89E2F978CD9F7554E6074FE7B1712560C5BEF1C7E1EA5816D0 -B10C7309A4D7C13F2F5D88A0786D283975F98A4CB847B51EAA2E65A2E822AE1D -1FF5C49B42711E1BF49ED933E1485717EDB08612C7B86B05DEF387C2B2951610 -626DB79C36F8CB5181768B4C297A5FE8D73EB470594CEE2D0B12659D9249D1C3 -70E9B0E02C5B74D16021F039173A98507B189ECF34E4C17F982738B9B48CF9D2 -2CA18E2405D929A1F0E75094956689D7B9407CE9A8B392E1E4212FDA5810FB81 -E66BD56AC62D271947D981A459D0DA12E0FC520A54C7369AFFC40F698BBAC99D -2128405FAC517E8E273869809965D208642C73531F4C670BCDF69847ADC008FF -087487565C3353749DF7368566850EBB3E06B9C79D27E7792E48ABA5DAD5967C -D3F5FD33DE4A39DBCFB1AFB37DFEC440165A03CD0F9A0B0D72ED78A56A6A6C78 -CF1E06EF1F4416F01576045A26722A346795FD4D4D76AB3A19660018B26C86B0 -F45D403864D6EDBE6231764590EFA528FB31BA9ACE331D3EEBE9871F209336A3 -935E8842954CADAF5386325C4BF2A87969FAB335E9FF3704929E0D0D5BBA1D59 -795A5328AA2CC4FB411C0B5898C092B1911334948BA2109432AA5045264EA67F -5126164BC3FD96EDC09A44809091872EFF39CA0EA66EAAAC6314C61B505141FE -A631F8B5862B04B1A4DE1DCF607286B2A3987922E0CFAC1D88FEEA2D2C027C7A -121F76F9433E5314BC554360874933FD7AED268986B789FFBD6D6535772134A4 -52B2930E0207B273C98BF26A0F6515A4B42F39A4935E10F1BFED78D292DAB6B5 -105A43E5AB00181A6E3F035B28C5C3BAC2B6E9E6B495C08910101E47AF030DE4 -70208324CCE7E0421173166BB245B544B9BD102374B67D02E99FBA474E9C96FA -963CF1B714340AA83F9AD5AF75B468A6DAD13E1F7420ACB51B0096EAB900C4B5 -2AC1D2866B273BF011E2C7C07F6FCBF0AC334A8A389D0F351D3C74D403EF66D9 -39DCB12D7DACA0F5EDC39F2FD220CEEFFF2E1B9617F305CDE3E740C066A0166D -EA8B7E08FD185D048CBAEC8EF574F59FB4F80DC8382AB91F56388F586D7C4B4C -3823847086B9EC3CD99DB118DC89066090B20756EF990678BAEF4498694C0884 -FB309CF7A22CFB79BBE1D4064021A647A957B773052A0CD872AFABF04478516C -97F76772B6F511FC2EB58980103DA0FEB32E61D0C83FED84B967CE31C5F19D85 -A566ED750CEB9C8BC798CDD9F0138BD650943137394BCCFCD97EF2DFC435B337 -4F45AF417F9388037B4C5FB681F5E11F3BAD9450632E1C2DCFB263EA3ECAE66F -AB78AEA057C18ACFC12098E0DD71D16EE1794904252BC427298F69D9FEA435A2 -F00A5BD09DF5C57254EA62FB77B0248873AB68DB7A60413A96F53850EC693B1F -C5D2BBDFB6B197500C2CC5F35597D452A501E812C102F8C235542FB2E78278D0 -E1C1D0C96CAF2628B54C98E3F32DB8D62CBA3441A63945A250EC21C4BB97CBA5 -4A80F71E30CBD8D974EB3FDD3ED45EB008ED54D76BD01766FCAA8F6753402C07 -EF04B9B2308F66D56CEB917E0848C72ED4B1E290BF4A6FE7728CF68A23F6EA17 -3FF37E5F9574645DBED15C540C0DBA3C61E9C02697329BA57C29F3D28B5D76E9 -9EBA8F527DFEC6C96CF090804EFFB25E1458FC5897CB9E269BF2FF6880222F28 -1988909D794620E260521B65CBC1C495DB903F916F50D15F36034506E0838CF1 -D741CA25C5C2B68679A056F03F65C842BD628A2AE8D73203876665372DE0B048 -C2FFC030F600E500B5699A7CF7E9DEA818A5653700143FBEB970F2D51DF32730 -FAA372EFAEA1A4E15E6C2096AAAA5AE7DA3D9C05FB11F83E853763DE89AB47FB -89411C369F036A03D881664AF026D76B52742B74F6DA12469E8D560D3C2E2BDA -3357A562201416BAD3F046BBBF27A5ED52C606C96CF2FBE7236F0D76E10097E3 -03ED4F6A70BACB2E52F00C260C61B66040946AC7A5B4866C61501A883897512E -FAFAA687ED471B7CCFF704B4674CBC082B07179B30F0A78459B6D23A16C49C07 -BEDA6A23F17F25F1166EDEE0B17F43AF8D897DDBD715B9D9FB540949EB3FB4B9 -8B749FB156374E73FD7EBD72EC9C4FBE54E24F17AAEF29B1E846A42C84D3A1CF -27E2E59BE76B3A8828A1EE70887CEA3DF74A7C7DE9A239CCC9E9770740E16E87 -84EDFDEA5B34168384C0F429178B7AACAE1D37A731AE1629F8971811F032A2F7 -A88C26E73311F6BCEC83FFC99B01DE9BC5FF9F34999DBB568199CF8EF8836704 -192CD77B452622002C3DDF0D5BB06FE822B0583E00A425D85A4B29633B1DF56D -9F5F7CCC9AF8C4333AAB65841CC7A4FEFBD07ABF367D0E691E22384362F43AC1 -4EF4FE416F8FB32F29EDB2A20BAC9D285D78F8DC79F7677DCD002E4A30C98DEE -4AD9EA0B00AD161BDA8B6C19922E9840B3C2E96CAC90369FF71A3E5311A4334B -10F53F90109B6C218EE7B8D23A95A766DE4D4541ADFCB4A488D8F913F9D07D35 -2B303F2518E0BE70549BA0F0D8D33EBA0CF23C610FAFE29C1302D7FD008972B0 -D8E9DFD0DA84C8CEAB1B160056C2B69F7EDDDB93B069C8E4378C7777696A7ADE -9DFD45125F9609D8403F72905B73B813F320B6AF2C9D62532328C65FA25FA75B -9B57A65347488BCB948FCE4E3843E9A195F5D6CC1FC91CC9D474AFA91BDB9F0D -457D08F869F21A78800D1744957848AB12982157748ACDB74814C05F40C5C630 -171553B9A547AB9650509B4C8A02740182C0E902120721DDEC1EAB1AF4F9EB81 -2EB8B93EBF9875D368D11696BC7AC7631C0C357E4E90F121B58009626C101972 -BC86C45D2444AECDF6C734A9D14CBF243777B970247A6587AA078EB820DD9131 -2D729B6B7BC569A444460BA522284509F8F5A70BF465F20EA91733A07648AC0E -D7630DB0AF9FCF9FEBD09D8847C8CC6CF63424A784937F00594D311AEC11B55E -8AC43A2FDC85DB70DE025FFE25F1D314CF06847BF2DF90EC2F78116EC8583A3E -52D8B8F0C8EEB01DE18B3F288710FB14DD0E10A8A4E7704662CEB3CE6E856FE8 -21AA289801B84CEDC7FCBF815D2852247C8D06922F8FA940B93421F256CE37F0 -441F8095E1A3481AD60771C65113C61D844E489725EA5B34501709463897CB5F -B01CAAA3BE5109B4A49E -0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark diff --git a/gnome_vfs_read_entire_file.c b/gnome_vfs_read_entire_file.c deleted file mode 100644 index 597d459..0000000 --- a/gnome_vfs_read_entire_file.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* gnome-vfs-utils.c - Private utility functions for the GNOME Virtual - File System. - gnome_vfs_read_entire_file() extraction for Captive - - Copyright (C) 1999 Free Software Foundation - Copyright (C) 2000, 2001 Eazel, Inc. - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - Authors: Ettore Perazzoli - John Sullivan - Darin Adler -*/ - - -#include "config.h" - -#include -#include -#include -#include - - -#define READ_CHUNK_SIZE 8192 - - -/** - * gnome_vfs_read_entire_file: - * @uri: URI of the file to read - * @file_size: after reading the file, contains the size of the file read - * @file_contents: contains the file_size bytes, the contents of the file at @uri. - * - * Reads an entire file into memory for convenience. Beware accidentally - * loading large files into memory with this function. - * - * Return value: An integer representing the result of the operation - * - * Since: 2.2 - */ - -GnomeVFSResult -gnome_vfs_read_entire_file (const char *uri, - int *file_size, - char **file_contents) -{ - GnomeVFSResult result; - GnomeVFSHandle *handle; - char *buffer; - GnomeVFSFileSize total_bytes_read; - GnomeVFSFileSize bytes_read; - - *file_size = 0; - *file_contents = NULL; - - /* Open the file. */ - result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ); - if (result != GNOME_VFS_OK) { - return result; - } - - /* Read the whole thing. */ - buffer = NULL; - total_bytes_read = 0; - do { - buffer = g_realloc (buffer, total_bytes_read + READ_CHUNK_SIZE); - result = gnome_vfs_read (handle, - buffer + total_bytes_read, - READ_CHUNK_SIZE, - &bytes_read); - if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) { - g_free (buffer); - gnome_vfs_close (handle); - return result; - } - - /* Check for overflow. */ - if (total_bytes_read + bytes_read < total_bytes_read) { - g_free (buffer); - gnome_vfs_close (handle); - return GNOME_VFS_ERROR_TOO_BIG; - } - - total_bytes_read += bytes_read; - } while (result == GNOME_VFS_OK); - - /* Close the file. */ - result = gnome_vfs_close (handle); - if (result != GNOME_VFS_OK) { - g_free (buffer); - return result; - } - - /* Return the file. */ - *file_size = total_bytes_read; - *file_contents = g_realloc (buffer, total_bytes_read); - return GNOME_VFS_OK; -} diff --git a/include_test.c b/include_test.c deleted file mode 100644 index ea59063..0000000 --- a/include_test.c +++ /dev/null @@ -1,23 +0,0 @@ -/* $Id$ - * Dummy etst C source test during .include_test_all.stamp target of Makefile-head.am - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -int main(void) -{ - return 0; -} diff --git a/po/cs.po b/po/cs.po deleted file mode 100644 index 802c624..0000000 --- a/po/cs.po +++ /dev/null @@ -1,1290 +0,0 @@ -# $Id$ -# "cs" (Czech) language file -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -msgid "" -msgstr "" -"Project-Id-Version: captive 1.1\n" -"POT-Creation-Date: 2003-11-26 22:15+0100\n" -"PO-Revision-Date: 2003-08-17 09:19+0200\n" -"Last-Translator: Jan Kratochvil \n" -"Language-Team: Czech \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/libcaptive/sandbox/split.c:59 src/libcaptive/sandbox/split.c:953 -#, c-format -msgid "CORBA Exception occured: id=\"%s\", value=%p" -msgstr "Nastala CORBA výjimka: id=\"%s\", value=%p" - -#: src/libcaptive/client/options.c:299 -#, c-format -msgid "Unknown '--syslog' facility '%s'; known:" -msgstr "Neznámá '--syslog' kategorie '%s'; známé:" - -#: src/libcaptive/client/options.c:333 -msgid "Pathname to .sys or .so filesystem module file" -msgstr "Cesta k souboru .sys či .so filesystem modulu" - -#: src/libcaptive/client/options.c:333 src/libcaptive/client/options.c:334 -#: src/libcaptive/client/options.c:341 src/libcaptive/client/options.c:344 -msgid "pathname" -msgstr "adresářová cesta" - -#: src/libcaptive/client/options.c:334 -msgid "Pathname to any W32 module to load w/o initialization" -msgstr "Cesta k jakémukoliv W32 modulu pro nahrání bez jeho inicializace" - -#: src/libcaptive/client/options.c:335 -msgid "Read/write mode: Any write access will be forbidden" -msgstr "Režim čtení/zápis: Jakýkoliv pokus o zápis bude zamítnut" - -#: src/libcaptive/client/options.c:336 -msgid "Read/write mode: All writes are just simulated in memory (default)" -msgstr "" -"Režim čtení/zápis: Všechny zápisy budou jen simulovány v paměti (implicitní)" - -#: src/libcaptive/client/options.c:337 -msgid "Read/write mode: Write directly to the image file/device" -msgstr "Režim čtení/zápis: Zápisováno bude přímo do souboru/zařízení" - -#: src/libcaptive/client/options.c:338 -msgid "Media type: CD-ROM" -msgstr "Typ media: CD-ROM" - -#: src/libcaptive/client/options.c:339 -msgid "Media type: Disk (default)" -msgstr "Typ media: Disk (implicitní)" - -#: src/libcaptive/client/options.c:340 -msgid "Turn on debugging messages" -msgstr "Zapnutí ladících výpisů" - -#: src/libcaptive/client/options.c:341 -msgid "Pathname to 'captive-sandbox-server', turns on sandboxing" -msgstr "Adresářová cesta k 'captive-sandbox-server', zapne isolaci" - -#: src/libcaptive/client/options.c:342 -msgid "CORBA IOR of 'captive-sandbox-server', turns on sandboxing" -msgstr "CORBA IOR běžícího 'captive-sandbox-server', zapne isolaci" - -#: src/libcaptive/client/options.c:342 -msgid "IOR" -msgstr "IOR" - -#: src/libcaptive/client/options.c:343 -msgid "Turn off sandboxing feature" -msgstr "Vypnutí isolace" - -#: src/libcaptive/client/options.c:344 -msgid "Pathname to strftime(3) for .captivebug.xml.gz bugreports" -msgstr "Adresářová cesta formátu strftime(3) pro hlášení .captivebug.xml.gz" - -#: src/libcaptive/client/options.c:348 -msgid "Messages sent to syslog(3) instead of stderr" -msgstr "Zprávy posílány do syslog(3) místo do stderr" - -#: src/libcaptive/client/options.c:349 -msgid "openlog(3) facility for --syslog" -msgstr "openlog(3) kategorie pro --syslog" - -#: src/libcaptive/client/options.c:349 -msgid "facility" -msgstr "kategorie" - -#: src/libcaptive/client/parent-connector.c:176 -#, c-format -msgid "Filesystem crash broke dirty object: %s" -msgstr "Pád filesystemu zničil nezapsaný objekt: %s" - -#: src/client/cmdline/cmd_cd.c:102 src/client/cmdline/cmd_ls.c:69 -#, c-format -msgid "Cannot open directory: %s" -msgstr "Nemohu otevřít adresář: %s" - -#: src/client/cmdline/cmd_commit.c:60 -msgid "Failed to commit disk changes" -msgstr "Selhalo zapsání změn disku" - -#: src/client/cmdline/cmd_create.c:52 -msgid "Create file with 'GNOME_VFS_OPEN_READ' disposition flag" -msgstr "Vytvoření souboru s atributem úmyslu 'GNOME_VFS_OPEN_READ'" - -#: src/client/cmdline/cmd_create.c:54 -msgid "Create file with 'GNOME_VFS_OPEN_WRITE' disposition flag" -msgstr "Vytvoření souboru s atributem úmyslu 'GNOME_VFS_OPEN_WRITE'" - -#: src/client/cmdline/cmd_create.c:56 -msgid "Create file with 'GNOME_VFS_OPEN_RANDOM' disposition flag" -msgstr "Vytvoření souboru s atributem úmyslu 'GNOME_VFS_OPEN_RANDOM'" - -#: src/client/cmdline/cmd_create.c:58 -msgid "Create file with exclusive access rights" -msgstr "Vytvoření souboru s exklusivními právy přístupu" - -#: src/client/cmdline/cmd_create.c:60 -msgid "Create file with read-only access mode" -msgstr "Vytvoření souboru s právem přístupu pouze pro čtení" - -#: src/client/cmdline/cmd_create.c:103 -#, c-format -msgid "Error creating guest-os file '%s'" -msgstr "Chyba při vytváření souboru hostovaného OS '%s'" - -#: src/client/cmdline/cmd_get.c:56 src/client/cmdline/cmd_put.c:56 -msgid "Transfer buffer size" -msgstr "Velikost vyrovnávací paměti" - -#: src/client/cmdline/cmd_get.c:56 src/client/cmdline/cmd_put.c:56 -msgid "size" -msgstr "velikost" - -#: src/client/cmdline/cmd_get.c:83 src/client/cmdline/cmd_put.c:84 -#, c-format -msgid "Error parsing transfer buffer size: %s" -msgstr "Chyba při zpracovávání velikosti vyrovnávací paměti: %s" - -#: src/client/cmdline/cmd_get.c:110 -#, c-format -msgid "Cannot create target host-os file '%s': %s" -msgstr "Nemohu vytvořit cílový soubor hostovaného OS '%s': %s" - -#: src/client/cmdline/cmd_get.c:121 -#, c-format -msgid "Error opening source guest-os file: %s" -msgstr "Nemohu otevřít zdrojový soubor hostovaného OS: %s" - -#: src/client/cmdline/cmd_get.c:149 -#, c-format -msgid "Error reading source guest-os file '%s': %s" -msgstr "Chyba při čtení zdrojového souboru hostovaného OS '%s': %s" - -#: src/client/cmdline/cmd_get.c:155 -#, c-format -msgid "Error writing target host-os file: %s" -msgstr "Chyba při zápisu cílového souboru hostujícího OS: %s" - -#: src/client/cmdline/cmd_get.c:168 -#, c-format -msgid "Error closing target host-os file '%s': %s" -msgstr "Chyba při uzavírání cílového souboru hostujícího OS '%s': %s" - -#: src/client/cmdline/cmd_info.c:69 -#, c-format -msgid "Cannot open file: %s" -msgstr "Nemohu otevřít soubor: %s" - -#: src/client/cmdline/cmd_info.c:78 -#, c-format -msgid "Cannot get file information about: %s" -msgstr "Nemohu zjistit informace o souboru: %s" - -#: src/client/cmdline/cmd_lcd.c:65 -#, c-format -msgid "Cannot change host-os directory to '%s': %s" -msgstr "Nemohu změnit aktuální adresář hostujícího OS '%s': %s" - -#: src/client/cmdline/cmd_ls.c:87 -#, c-format -msgid "Error reading directory: %s" -msgstr "Chyba při čtení adresáře: %s" - -#: src/client/cmdline/cmd_mkdir.c:66 -#, c-format -msgid "Cannot create directory: %s" -msgstr "Nemohu vytvořit adresář: %s" - -#: src/client/cmdline/cmd_mv.c:66 -#, c-format -msgid "Cannot open file to be moved: %s" -msgstr "Nemohu otevřít soubor pro přesun: %s" - -#: src/client/cmdline/cmd_mv.c:76 -#, c-format -msgid "Cannot move file '%s' to its target name '%s'" -msgstr "Nemohu přesunout soubor '%s' na cílový název '%s'" - -#: src/client/cmdline/cmd_open.c:50 -msgid "Open file with 'GNOME_VFS_OPEN_READ' disposition flag" -msgstr "Otevření souboru s atributem úmyslu 'GNOME_VFS_OPEN_READ'" - -#: src/client/cmdline/cmd_open.c:52 -msgid "Open file with 'GNOME_VFS_OPEN_WRITE' disposition flag" -msgstr "Otevření souboru s atributem úmyslu 'GNOME_VFS_OPEN_WRITE'" - -#: src/client/cmdline/cmd_open.c:54 -msgid "Open file with 'GNOME_VFS_OPEN_RANDOM' disposition flag" -msgstr "Otevření souboru s atributem úmyslu 'GNOME_VFS_OPEN_RANDOM'" - -#: src/client/cmdline/cmd_open.c:89 -#, c-format -msgid "Error opening guest-os file '%s'" -msgstr "Nemohu otevřít soubor hostovaného OS '%s'" - -#: src/client/cmdline/cmd_put.c:109 -#, c-format -msgid "Error opening source host-os file '%s': %s" -msgstr "Nemohu otevřít zdrojový soubor hostujícího OS '%s': %s" - -#: src/client/cmdline/cmd_put.c:122 -#, c-format -msgid "Cannot create target guest-os file: %s" -msgstr "Nemohu vytvořit cílový soubor hostovaného OS: %s" - -#: src/client/cmdline/cmd_put.c:139 -#, c-format -msgid "Error writing target guest-os file: %s" -msgstr "Chyba při zápisu cílového souboru hostovaného OS %s" - -#: src/client/cmdline/cmd_put.c:144 -#, c-format -msgid "Error writing target guest-os file '%s': requested %d, written %Lu" -msgstr "" -"Chyba při zápisu cílového souboru hostovaného OS '%s': požadováno %d, " -"zapsáno %Lu" - -#: src/client/cmdline/cmd_put.c:151 -#, c-format -msgid "Error reading source host-os file '%s': %s" -msgstr "Chyba při čtení zdrojového souboru hostujícího OS '%s': %s" - -#: src/client/cmdline/cmd_put.c:164 -#, c-format -msgid "Error closing source host-os file '%s': %s" -msgstr "Chyba při uzavírání zdrojového souboru hostujícího OS '%s': %s" - -#: src/client/cmdline/cmd_rm.c:65 -#, c-format -msgid "Cannot open file for removal: %s" -msgstr "Nemohu otevřít soubor pro odstranění: %s" - -#: src/client/cmdline/cmd_rm.c:73 -#, c-format -msgid "Cannot set file removal state: %s" -msgstr "Nemohu nastavit souboru stav odstranění: %s" - -#: src/client/cmdline/cmd_rmdir.c:64 -#, c-format -msgid "Cannot open directory for removal: %s" -msgstr "Nemohu otevřít adresář pro odstranění: %s" - -#: src/client/cmdline/cmd_rmdir.c:72 -#, c-format -msgid "Cannot set directory removal state: %s" -msgstr "Nemohu nastavit adresáři stav odstranění: %s" - -#: src/client/cmdline/cmd_shell.c:80 src/install/acquire/ui-line.c:240 -msgid "" -"Line editing not available, please recompile with readline library installed" -msgstr "" -"Řádková editace není dostupná, prosím překompilujte s nainstalovanou " -"knihovnou readline" - -#: src/client/cmdline/cmd_shell.c:119 -#, c-format -msgid "Error '%s' parsing arguments of text line: %s" -msgstr "Chyba '%s' při analýze argumentů z textové řádky: %s" - -#: src/client/cmdline/cmd_volume.c:60 -msgid "Failed to get volume info" -msgstr "Selhalo získáni informací o disku" - -#: src/client/cmdline/handle.c:78 -#, c-format -msgid "Error looking up existing handle: %s" -msgstr "Chyba při vyhledávání existujícího názvu otevřeného souboru: %s" - -#: src/client/cmdline/handle.c:95 -#, c-format -msgid "Specified handle already used: %s" -msgstr "Specifikovaný název otevřeného souboru je již použit: %s" - -#: src/client/cmdline/handle.c:123 -#, c-format -msgid "Handle to be deleted not found: %s" -msgstr "Název otevřeného souboru pro smazání nebyl nalezen: %s" - -#: src/client/cmdline/main.c:76 -msgid "Interactive commands shell." -msgstr "Interaktivní příkazová řádka." - -#: src/client/cmdline/main.c:77 -msgid "Print or change current guest-os directory[1]." -msgstr "Zobrazení či změna aktuálního adresáře[1] hostovaného OS." - -#: src/client/cmdline/main.c:78 -msgid "Print or change current host-os directory[1]." -msgstr "Zobrazení či změna aktuálního adresáře[1] hostujícího OS." - -#: src/client/cmdline/main.c:79 -msgid "Directory[1] listing." -msgstr "Obsah adresáře[1]." - -#: src/client/cmdline/main.c:80 -msgid "Copy guest-os file[1] to host-os (opt. file[2])." -msgstr "" -"Zkopírování souboru[1] hostovaného OS na (volitelně soubor[2]) hostující OS." - -#: src/client/cmdline/main.c:81 -msgid "Copy host-os file[1] to guest-os (opt. file[2])." -msgstr "" -"Zkopírování souboru[1] hostujícího OS na (volitelně soubor[2]) hostovaný OS." - -#: src/client/cmdline/main.c:82 -msgid "Query information about guest-os item[1]." -msgstr "Získání informací o předmětu[1] hostovaného OS." - -#: src/client/cmdline/main.c:83 -msgid "Query information about guest-os volume." -msgstr "Získání informací o disku hostovaného OS." - -#: src/client/cmdline/main.c:84 -msgid "Remove guest-os file[1]." -msgstr "Odstranění souboru[1] hostovaného OS." - -#: src/client/cmdline/main.c:85 -msgid "Move (rename) guest-os item[1] to guest-os item[2]." -msgstr "" -"Přesun (přejmenování) předmětu[1] hostovaného OS na předmět[2] hostovaného " -"OS." - -#: src/client/cmdline/main.c:86 -msgid "Create guest-os directory[1]." -msgstr "Vytvoření adresáře[1] hostovaného OS." - -#: src/client/cmdline/main.c:87 -msgid "Remove guest-os directory[1]." -msgstr "Odstranění adresáře[1] hostovaného OS." - -#: src/client/cmdline/main.c:88 -msgid "Write any pending changes and remount the volume." -msgstr "Zapsání všech změn spolu s odpojením/připojením disku." - -#: src/client/cmdline/main.c:89 -msgid "Open as[1] file[2] in mode; see 'open --help'" -msgstr "Otevření jako[1] souboru[2] v daném režimu; viz 'open --help'" - -#: src/client/cmdline/main.c:90 -msgid "Create as[1] file[2] in mode with perm; see 'create --help'" -msgstr "" -"Vytvoření jako[1] souboru[2] v daném režimu s právy; viz 'create --help'" - -#: src/client/cmdline/main.c:91 -msgid "Close handle[1]" -msgstr "Uzavření otevřeného souboru dle názvu[1]" - -#: src/client/cmdline/main.c:92 -msgid "Quit this program." -msgstr "Ukončení tohoto programu." - -#: src/client/cmdline/main.c:93 -msgid "Show this list of commands or help for command[1]." -msgstr "Zobrazení této nápovědy k seznamu příkazů či nápovědy pro příkaz[1]." - -#: src/client/cmdline/main.c:151 -#, c-format -msgid "Unknown command, try 'help': %s" -msgstr "Neznámý příkaz, zkuste 'help': %s" - -#: src/client/cmdline/main.c:162 -#, c-format -msgid "Invalid arguments for command: %s" -msgstr "Nepovolené argumenty pro příkaz: %s" - -#: src/client/cmdline/main.c:169 -#, c-format -msgid "Error '%s' reading default configuration for command: %s" -msgstr "Chyba '%s' při čtení standardního nastavení pro příkaz: %s" - -#: src/client/cmdline/main.c:175 -#, c-format -msgid "Exceeding command option for command: %s" -msgstr "Přebytečné volby pro příkaz: %s" - -#: src/client/cmdline/main.c:188 -#, c-format -msgid "" -"Invalid number of command '%s' arguments: %d; expected from %d to %d incl." -msgstr "Nepovolený počet argumentů příkazu '%s': %d; očekáváno od %d do %d vč." - -#: src/client/cmdline/main.c:229 -#, c-format -msgid "Generic error: %s" -msgstr "Obecná chyba: %s" - -#: src/client/cmdline/main.c:283 -msgid "Error parsing command-line arguments" -msgstr "Chyba při zpracovávání argumentů z příkazové řádky" - -#: src/client/cmdline/main.c:289 -msgid "Error reading default popt configuration" -msgstr "Chyba při čtení standardního popt nastavení" - -#: src/client/cmdline/main.c:292 -msgid "Error parsing (dash-prefixed) command-line argument" -msgstr "" -"Chyba při zpracovávání argumentu příkazové řádky (začínajícího pomlčkou)" - -#: src/client/cmdline/main.c:303 -msgid "File/device disk image pathname command-line argument required" -msgstr "Vyžadována adresářová cesta souboru/zařízení s obrazem disku" - -#: src/client/cmdline/main.c:311 -msgid "image_iochannel open failed" -msgstr "Selhalo otevření image_iochannel" - -#: src/client/cmdline/main.c:318 -msgid "'--filesystem' option required ('ntfs.sys' pathname suggested)" -msgstr "" -"Vyžadována volba '--filesystem' (doporučena adresářová cesta 'ntfs.sys')" - -#: src/client/cmdline/main.c:322 -msgid "'--load-module' option required ('ntoskrnl.exe' pathname suggested)" -msgstr "" -"Vyžadována volba '--load-module' (doporučena adresářová cesta 'ntoskrnl.exe')" - -#: src/client/cmdline/main.c:327 src/client/bug-replay/main.c:301 -msgid "captive_vfs_new() failed" -msgstr "Selhala funkce captive_vfs_new()" - -#: src/client/sandbox-server/main.c:99 -msgid "Username or UID to become; \"-\" for disable" -msgstr "Uživatelské jméno či UID pro získání: \"-\" pro zakázání" - -#: src/client/sandbox-server/main.c:99 -msgid "UID" -msgstr "UID" - -#: src/client/sandbox-server/main.c:101 -msgid "Groupname or GID to become; \"-\" for disable" -msgstr "Jméno skupiny či GID pro získání: \"-\" pro zakázání" - -#: src/client/sandbox-server/main.c:101 -msgid "GID" -msgstr "GID" - -#: src/client/sandbox-server/main.c:103 -msgid "Pathname to directory for chroot(2); \"-\" for disable" -msgstr "Cesta k adresáři pro chroot(2); \"-\" pro zakázání" - -#: src/client/sandbox-server/main.c:103 -msgid "directory" -msgstr "adresář" - -#: src/client/sandbox-server/main.c:105 -msgid "Disable setrlimit(2) restrictions" -msgstr "Vypnutí restrikcí setrlimit(2)" - -#: src/client/lufs/captivefs-vfs.c:147 -#, c-format -msgid "%s: image_iochannel open failed" -msgstr "%s: Selhalo otevření image_iochannel" - -#: src/client/bug-replay/main.c:55 -msgid "Disk path for W32 modules and filesystem" -msgstr "Cesta na disku pro W32 moduly a filesystemy" - -#: src/client/bug-replay/main.c:55 src/install/acquire/main.c:78 -msgid "path" -msgstr "cesta" - -#: src/install/libcaptive-install/proc_partitions.c:78 -#, c-format -msgid "Cannot open \"%s\": %m" -msgstr "Nemohu otevřít \"%s\": %m" - -#: src/install/libcaptive-install/proc_partitions.c:96 -#, c-format -msgid "Error parsing line of \"%s\" (Linux kernel bug): %s" -msgstr "Chyba při čtení řádku z \"%s\" (chyba Linux kernelu): %s" - -#: src/install/libcaptive-install/proc_partitions.c:102 -#, c-format -msgid "not ntfs: %s" -msgstr "není ntfs: %s" - -#: src/install/libcaptive-install/proc_partitions.c:106 -#, c-format -msgid "FOUND ntfs: %s\t%s" -msgstr "NALEZENO ntfs: %s\t%s" - -#: src/install/libcaptive-install/proc_partitions.c:110 -#, c-format -msgid "Error unmounting volume: %s" -msgstr "Chyba při odpojování disku: %s" - -#: src/install/libcaptive-install/proc_partitions.c:113 -#, c-format -msgid "Cannot close \"%s\": %m" -msgstr "Nemohu uzavřít \"%s\": %m" - -#: src/install/fstab/main.c:78 src/install/acquire/main.c:75 -msgid "Display additional debug information" -msgstr "Zobrazení přídavné ladící informace" - -#: src/install/fstab/main.c:79 -msgid "No real modifications - simulate only" -msgstr "Žádné modifikace - pouze simulace" - -#: src/install/fstab/main.c:80 -msgid "Add entries to /etc/fstab" -msgstr "Přidání položek do /etc/fstab" - -#: src/install/fstab/main.c:81 -msgid "Remove entries from /etc/fstab" -msgstr "Odebrání položek z /etc/fstab" - -#: src/install/fstab/main.c:131 -#, c-format -msgid "Created base mount directory: %s" -msgstr "Nemohu otevřít bázový adresář pro připojení disku: %s" - -#: src/install/fstab/main.c:134 -#, c-format -msgid "Error creating base mount directory \"%s\" for device \"%s\": %m" -msgstr "" -"Chyba při čtení bázového adresáře \"%s\" pro připojení disku \"%s\": %m" - -#: src/install/fstab/main.c:138 -#, c-format -msgid "Created mount directory for device \"%s\": %s" -msgstr "Vytvořen adresář pro připojení zařízení \"%s\": %s" - -#: src/install/fstab/main.c:142 -#, c-format -msgid "Error creating mount directory \"%s\" for device \"%s\": %m" -msgstr "Chyba při vytváření adresáře \"%s\" pro připojení zařízení \"%s\": %m" - -#: src/install/fstab/main.c:147 -#, c-format -msgid "Creating captive-ntfs mntent: %s -> %s" -msgstr "Vytvářím captive-ntfs mntent: %s -> %s" - -#: src/install/fstab/main.c:149 -#, c-format -msgid "Error appending mntent for device \"%s\": %m" -msgstr "Chyba při přidávání mntent pro zařízení \"%s\": %m" - -#: src/install/fstab/main.c:191 src/install/acquire/main.c:237 -msgid "No arguments expected" -msgstr "Nebyly očekávány žádné argumenty" - -#: src/install/fstab/main.c:195 -msgid "No run mode specified" -msgstr "Žádný režim běhu nebyl speficikován" - -#: src/install/fstab/main.c:203 src/install/acquire/diskscan.c:98 -#: src/install/acquire/final.c:55 -#, c-format -msgid "Cannot open \"%s\" for reading: %m" -msgstr "Nemohu otevřít \"%s\" pro čtení: %m" - -#: src/install/fstab/main.c:205 -#, c-format -msgid "Cannot open \"%s\" for writing: %m" -msgstr "Nemohu otevřít \"%s\" pro zápis: %m" - -#: src/install/fstab/main.c:224 -#, c-format -msgid "Error seeking in \"%s\": %m" -msgstr "Chyba při nastavování pozice v \"%s\": %m" - -#: src/install/fstab/main.c:226 -#, c-format -msgid "Error reading \"%s\": %m" -msgstr "Chyba při čtení \"%s\": %m" - -#: src/install/fstab/main.c:229 -#, c-format -msgid "Invalid position in \"%s\" after fread(3): %m" -msgstr "Neplatná pozice v \"%s\" po fread(3): %m" - -#: src/install/fstab/main.c:234 -#, c-format -msgid "mntent memory block not newline-terminated from \"%s\"" -msgstr "Paměťový blok mntent z \"%s\" není ukončen koncem řádku" - -#: src/install/fstab/main.c:240 -#, c-format -msgid "Error copying comments before device \"%s\" to \"%s\": %m" -msgstr "Chyba při kopírování komentářů před zařízením \"%s\" do \"%s\": %m" - -#: src/install/fstab/main.c:255 -#, c-format -msgid "Dropping captive mntent: %s" -msgstr "Maži captive mntent: %s" - -#: src/install/fstab/main.c:258 -#, c-format -msgid "Deleted mount directory for device \"%s\": %s" -msgstr "Smazán adresář pro připojení zařízení \"%s\": %s" - -#: src/install/fstab/main.c:262 -#, c-format -msgid "Error removing mount directory \"%s\" of device \"%s\": %m" -msgstr "" -"Chyba při odstraňování adresáře \"%s\" pro připojení zařízení \"%s\": %m" - -#: src/install/fstab/main.c:270 -#, c-format -msgid "" -"Dropping no-longer valid captive filesystem mntent from \"%s\" of device: %s" -msgstr "" -"Maži již neplatnou položku captive filesystem mntent z \"%s\" zařízení: %s" - -#: src/install/fstab/main.c:275 -#, c-format -msgid "Dropping captive mntent to be replaced by new one: %s" -msgstr "Maži captive mntent, která bude nahrazena novou mntent: %s" - -#: src/install/fstab/main.c:285 -#, c-format -msgid "Error copying mntent for device \"%s\" to \"%s\": %m" -msgstr "Chyba při kopírování mntent pro zařízení \"%s\" do \"%s\": %m" - -#: src/install/fstab/main.c:300 -#, c-format -msgid "Modified status: %s" -msgstr "Status modifikací: %s" - -#: src/install/fstab/main.c:300 -msgid "YES" -msgstr "ANO" - -#: src/install/fstab/main.c:300 -msgid "NO" -msgstr "NE" - -#: src/install/fstab/main.c:302 src/install/acquire/diskscan.c:111 -#: src/install/acquire/final.c:77 -#, c-format -msgid "Cannot close \"%s\" after reading: %m" -msgstr "Nemohu uzavřít \"%s\" po jeho čtení: %m" - -#: src/install/fstab/main.c:305 -#, c-format -msgid "Cannot set permissions for \"%s\" after writing: %m" -msgstr "Nemohu nastavit oprávnění pro \"%s\" po jeho zápisu: %m" - -#: src/install/fstab/main.c:308 -#, c-format -msgid "Cannot close \"%s\" after writing: %m" -msgstr "Nemohu uzavřít \"%s\" po jeho zapsání: %m" - -#: src/install/fstab/main.c:313 -#, c-format -msgid "Backup file exists - keeping it intact: %s" -msgstr "Záložní soubor existuji - ponechávám jej nezměněn: %s" - -#: src/install/fstab/main.c:317 -#, c-format -msgid "File \"%s\" backed up to: %s" -msgstr "Soubor \"%s\" zazálohován jako: %s" - -#: src/install/fstab/main.c:319 -#, c-format -msgid "Cannot backup \"%s\" to \"%s\": %m" -msgstr "Nemohu zazálohovat \"%s\" jako \"%s\": %m" - -#: src/install/fstab/main.c:322 -#, c-format -msgid "Backup file \"%s\" state unknown: %m" -msgstr "Stav záložního souboru \"%s\" neznámý: %m" - -#: src/install/fstab/main.c:324 -#, c-format -msgid "Cannot move new \"%s\" over old \"%s\": %m" -msgstr "Nemohu přesunout nový \"%s\" přes původní \"%s\": %m" - -#: src/install/fstab/main.c:328 -#, c-format -msgid "Cannot remove new unmodified \"%s\": %m" -msgstr "Nemohu odstranit nový nezmodifikovaný \"%s\": %m" - -#: src/install/acquire/cabextract/cabextract.c:1992 -#: src/install/acquire/cabextract/cabextract.c:2174 -#: src/install/acquire/cabextract/cabextract.c:2262 -#: src/install/acquire/cabextract/cabextract.c:2277 -#: src/install/acquire/cabextract/cabextract.c:2815 -msgid "out of memory!" -msgstr "nedostatek paměti!" - -#: src/install/acquire/cabextract/cabextract.c:2104 -#, c-format -msgid "%s: cabinet read error: %s" -msgstr "%s: chyba čtení cabinet-u: %s" - -#: src/install/acquire/cabextract/cabextract.c:2108 -#: src/install/acquire/cabextract/cabextract.c:2165 -#, c-format -msgid "%s: WARNING; cabinet is truncated" -msgstr "%s: VAROVÁNÍ: cabinet je zkrácen" - -#: src/install/acquire/cabextract/cabextract.c:2199 -#, c-format -msgid "%s: not a Microsoft cabinet file" -msgstr "%s: není Microsoft cabinet souborem" - -#: src/install/acquire/cabextract/cabextract.c:2206 -#, c-format -msgid "%s: no folders in cabinet" -msgstr "%s: cabinet neobsahuje žádné složky" - -#: src/install/acquire/cabextract/cabextract.c:2213 -#, c-format -msgid "%s: no files in cabinet" -msgstr "%s: cabinet neobsahuje žádné soubory" - -#: src/install/acquire/cabextract/cabextract.c:2221 -#, c-format -msgid "%s: WARNING; cabinet format version > 1.3" -msgstr "%s: VAROVÁNÍ: verze formátu cabinet-u > 1.3" - -#: src/install/acquire/cabextract/cabextract.c:2234 -#, c-format -msgid "%s: WARNING; header reserved space > 60000" -msgstr "%s: VAROVÁNÍ: rezervováné místo hlavičky > 60000" - -#: src/install/acquire/cabextract/cabextract.c:2347 -#, c-format -msgid "%s: internal error, increase CAB_SPLITMAX" -msgstr "%s: interní chyba, zvyšte CAB_SPLITMAX" - -#: src/install/acquire/cabextract/cabextract.c:2516 -#, c-format -msgid "%s: WARNING; found %d bad cabinets" -msgstr "%s: VAROVÁNÍ: nalezeno %d chybných cabinet-ů" - -#: src/install/acquire/cabextract/cabextract.c:2521 -#, c-format -msgid "%s: not a Microsoft cabinet file." -msgstr "%s: není Microsoft cabinet souborem." - -#: src/install/acquire/cabextract/cabextract.c:2685 -#, c-format -msgid "%s: WARNING; checksum failed" -msgstr "%s: VAROVÁNÍ: kontrolní součet selhal" - -#: src/install/acquire/cabextract/cabextract.c:2713 -#, c-format -msgid "%s: WARNING; failed decrunching block" -msgstr "%s: VAROVÁNÍ: selhala dekomprese bloku" - -#: src/install/acquire/cabextract/cabextract.c:2817 -#, c-format -msgid "%s: illegal or corrupt data" -msgstr "%s: nepovolená či poškozená data" - -#: src/install/acquire/cabextract/cabextract.c:2819 -#, c-format -msgid "%s: unsupported data format" -msgstr "%s: nepodporovaný formát dat" - -#: src/install/acquire/cabextract/cabextract.c:2821 -#, c-format -msgid "%s: checksum error" -msgstr "%s: selhání kontrolního součtu" - -#: src/install/acquire/cabextract/cabextract.c:2823 -#, c-format -msgid "%s: input error" -msgstr "%s: chyba vstupu" - -#: src/install/acquire/cabextract/cabextract.c:2825 -#, c-format -msgid "%s: output error" -msgstr "%s: chyba výstupu" - -#: src/install/acquire/cabextract/cabextract.c:2827 -#, c-format -msgid "%s: unknown error (BUG)" -msgstr "%s: neznámá chyba (CHYBA PROGRAMU)" - -#: src/install/acquire/cabextract/cabextract.c:2958 -#, c-format -msgid "%s: can't read previous cabinet %s" -msgstr "%s: nemohu přečíst předchozí cabinet %s" - -#: src/install/acquire/cabextract/cabextract.c:2971 -#, c-format -msgid "%s: can't read next cabinet %s" -msgstr "%s: nemohu přečíst následující cabinet %s" - -#: src/install/acquire/cabinet.c:335 -#, c-format -msgid "Destination file URL not valid: %s" -msgstr "URL cílového souboru není platné: %s" - -#: src/install/acquire/cabinet.c:340 -#, c-format -msgid "" -"'httpcaptive' GnomeVFS method not supported; install package 'gnomevfs-" -"httpcaptive'; URL: %s" -msgstr "" -"'httpcaptive' GnomeVFS metoda není podporována; nainstalujte balík 'gnomevfs-" -"httpcaptive'; URL: %s" - -#: src/install/acquire/captivemodid.c:108 -#, c-format -msgid "Ignoring module \"%s\" as it has MD5 conflict with: %s" -msgstr "Ignoruji modul \"%s\", neboť má MD5 konflikt s: %s" - -#: src/install/acquire/captivemodid.c:204 -#, c-format -msgid "%s: Undefined attributes: %s" -msgstr "%s: Nedefinovaný atribut: %s" - -#: src/install/acquire/captivemodid.c:227 -#, c-format -msgid "%s: Numer of out range %ld..%ld: %ld" -msgstr "%s: Číslo mimo rozsah %ld..%ld: %ld" - -#: src/install/acquire/captivemodid.c:244 -#, c-format -msgid "%s: Attribute 'md5' can be only lower-cased hexstring: %s" -msgstr "" -"%s: Atribut 'md5' může být pouze hexadecimální řetěz s malými písmeny: %s" - -#: src/install/acquire/captivemodid.c:248 -#, c-format -msgid "%s: Attribute 'md5' length must be 32: %s" -msgstr "%s: Délka atributu 'md5' musí být 32: %s" - -#: src/install/acquire/captivemodid.c:318 -#, c-format -msgid "%s: Unknown ELEMENT node: %s" -msgstr "%s: Neznámý ELEMENT: %s" - -#: src/install/acquire/diskscan.c:55 -#, c-format -msgid "" -"'libntfs' GnomeVFS method not supported; install package 'ntfsprogs-" -"gnomevfs' >=%s" -msgstr "" -"'libntfs' GnomeVFS metoda není podporována; nainstalujte balík 'ntfsprogs-" -"gnomevfs' >=%s" - -#: src/install/acquire/diskscan.c:130 -#, c-format -msgid "Ignoring URI in auto-search as it is not local: %s" -msgstr "Ignoruji URI při automatickém vyhledávání, neboť není lokální: %s" - -#: src/install/acquire/final.c:46 -msgid "" -"Although essential modules (\"ntoskrnl.exe\" and \"ntfs.sys\") are available " -"you may still want to get their better version and/or more modules. " -msgstr "" -"Ačkoliv požadované soubory (\"ntoskrnl.exe\" a \"ntfs.sys\") jsou dostupné, " -"stále můžete chtít získat jejich výhodnější verze a/nebo více modulů. " - -#: src/install/acquire/final.c:49 -msgid "All needed modules were found in their best preferred versions." -msgstr "" -"Všechny požadované moduly byly nalezeny v jejich nejpreferovanějších verzích." - -#: src/install/acquire/final.c:60 -#, c-format -msgid "" -"\n" -"Found NTFS disk partitions are prepared in %s. You can mount them by " -"commands mount(8) or usermount(1) such as:\n" -"\tmount /mnt/captive-LABEL_C\n" -"Available captive-ntfs partitions:" -msgstr "" -"\n" -"Nalezené NTFS diskové oddíly jsou připraveny v %s. Můžete je připojit pomocí " -"příkazů mount(8) či usermount(1) jako např.:\n" -"\tmount /mnt/captive-LABEL_C\n" -"Dostupné captive-ntfs oddíly:" - -#: src/install/acquire/final.c:71 -msgid "" -"\n" -"Despite drivers were found no NTFS disk partitions were found on your " -"computer. You still can mount read/write NTFS partitions by using filesystem " -"type 'captive-ntfs' such as:\n" -"\tmkdir /mnt/captive-LABEL_C\n" -"\tmount -t captive-ntfs /dev/hda1 /mnt/captive-LABEL_C" -msgstr "" -"\n" -"Ačkoliv ovladače byly získány, nebyly na vašem počítači nalezeny žádné NTFS " -"diskové oddíly Přesto můžete připojit pro čtení/zápis NTFS oddíly pomocí " -"filesystem typu 'captive-ntfs' jako např.:\n" -"\tmkdir /mnt/captive-LABEL_C\n" -"\tmount -t captive-ntfs /dev/hda1 /mnt/captive-LABEL_C" - -#: src/install/acquire/main.c:74 -msgid "Disable Gnome UI; --text must be first argument" -msgstr "Zakáže Gnome uživatelské rozhraní; --text musí být prvním argumentem" - -#: src/install/acquire/main.c:76 -msgid "No modifications, no files written" -msgstr "Žádné modifikace, žádné soubory nebudou zapsány" - -#: src/install/acquire/main.c:78 -msgid "Path to .captivemodid.xml database" -msgstr "Cesta k .captivemodid.xml databázi" - -#: src/install/acquire/main.c:79 -msgid "Scan all files on local disks" -msgstr "Prohledání všech souborů na lokálních discích" - -#: src/install/acquire/main.c:81 -msgid "Scan MS-Windows directories on local disks" -msgstr "Prohledání MS-Windows direktorářů na lokálních discích" - -#: src/install/acquire/main.c:83 -msgid "Scan specified disk path or web URL" -msgstr "Prohledání zadaných diskových cest či webového URL" - -#: src/install/acquire/main.c:83 -msgid "path/URI" -msgstr "cesta/URI" - -#: src/install/acquire/main.c:85 -msgid "" -"Download from microsoft.com; Legal: You may need to have valid Microsoft " -"Windows XP license." -msgstr "" -"Stáhnutí z microsoft.com; Právní stránka: Můžete potřebovat mít platnout " -"licenci pro Microsoft Windows XP" - -#: src/install/acquire/main.c:208 -msgid "GnomeVFS failed to initialize" -msgstr "Selhala inicializace GnomeVFS" - -#: src/install/acquire/main.c:282 -msgid "No UI interface could be initialized" -msgstr "Žádné uživatelské rozhraní nemohlo být zinicializováno" - -#: src/install/acquire/main.c:285 -#, c-format -msgid "Unable to load modid database: %s" -msgstr "Nemohu načíst databázi modid: %s" - -#: src/install/acquire/microsoftcom.c:59 -#, c-format -msgid "Cannot load base URL: %s" -msgstr "Nemohu otevřít bázové URL: %s" - -#: src/install/acquire/microsoftcom.c:64 -#, c-format -msgid "Destination file URL not found in base URL: %s" -msgstr "URL cílového souboru nebylo nalezeno v bázovém URL: %s" - -#: src/install/acquire/microsoftcom.c:72 -#, c-format -msgid "Found destination file URL not parsable: %s" -msgstr "Nalezené URL cílového souboru nelze zpracovat: %s" - -#: src/install/acquire/moduriload.c:101 -#, c-format -msgid "Cannot open target file \"%s\": %m" -msgstr "Nemohu otevřít cílový soubor \"%s\": %m" - -#: src/install/acquire/moduriload.c:104 -#, c-format -msgid "Error writing target file \"%s\": %m" -msgstr "Chyba při zápisu cílového souboru \"%s\": %m" - -#: src/install/acquire/moduriload.c:106 -#, c-format -msgid "Error closing target file \"%s\": %m" -msgstr "Chyba při uzavírání cílového souboru \"%s\": %m" - -#: src/install/acquire/moduriload.c:315 -#, c-format -msgid "Error scanning sub-tree of \"%s\": %s" -msgstr "Chyba při prohledávání subdirektoráře direktoráře \"%s\": %s" - -#: src/install/acquire/moduriload.c:331 -#, c-format -msgid "Scanning...: %s" -msgstr "Prohledávám...: %s" - -#: src/install/acquire/moduriload.c:341 -#, c-format -msgid "Error loading \"%s\": %s" -msgstr "Chyba při načítání \"%s\": %s" - -#: src/install/acquire/ui-line.c:47 -#, c-format -msgid "Found best available \"%s\": %s\n" -msgstr "Nalezen nejlepší známý \"%s\": %s\n" - -#: src/install/acquire/ui-line.c:49 -#, c-format -msgid "Found although not best \"%s\" (pri=%d; best=%d): %s\n" -msgstr "Nalezen, avšek ne nejlepší \"%s\" (priorita=%d; nejlepší=%d): %s\n" - -#: src/install/acquire/ui-line.c:59 -#, c-format -msgid "at URI: %s\n" -msgstr "v URI: %s\n" - -#: src/install/acquire/ui-line.c:66 -msgid "All modules found in their best known versions." -msgstr "Všechny moduly nalezeny v jejich nejlepších známých verzích." - -#: src/install/acquire/ui-line.c:89 -msgid "Searching... Hit ENTER to abort." -msgstr "Prohledávám... Stiskněte ENTER pro přerušení." - -#: src/install/acquire/ui-line.c:101 -msgid "*** OPERATION ABORTED ***" -msgstr "*** OPERACE PŘERUŠENA ***" - -#: src/install/acquire/ui-line.c:190 src/install/acquire/ui-line.c:192 -#, c-format -msgid "Still needed essential module: %s\n" -msgstr "Stále potřebuji požadovaný modul: %s\n" - -#: src/install/acquire/ui-line.c:195 -msgid "" -"Essential modules (\"ntoskrnl.exe\" and \"ntfs.sys\") are available.\n" -"You may still want to get their better version and/or more modules." -msgstr "" -"Požadované moduly (\"ntoskrnl.exe\" a \"ntfs.sys\") jsou k dispozici.\n" -"Stále můžete chtít získat jejich výhodnější verze a/nebo více modulů." - -#: src/install/acquire/ui-line.c:215 -#, c-format -msgid "Enter 'y' for YES, 'n' to NO%s [hit ENTER for YES]: " -msgstr "Zadejte 'a' jako ANO, 'n' jeko NE [stiskněte ENTER pro ANO]: " - -#: src/install/acquire/ui-line.c:216 -msgid ", 'd' if DONE" -msgstr ", 'k' pro KONEC" - -#: src/install/acquire/ui-line.c:219 -msgid "yes" -msgstr "ano" - -#: src/install/acquire/ui-line.c:223 -msgid "no" -msgstr "ne" - -#: src/install/acquire/ui-line.c:227 -msgid "done" -msgstr "konec" - -#: src/install/acquire/ui-line.c:243 -msgid "Quickly scan your local disks to find needed drivers?" -msgstr "" -"Zrychleně prohledat vaše lokální disky pro nalezení potřebných ovladačů?" - -#: src/install/acquire/ui-line.c:249 -msgid "" -"Detection of language localized MS-Windows drivers is missing. You may need " -"to copy localized ntfs.sys and ntoskrnl.exe to /var/lib/captive/ by cp(1) " -"command; contact me for their proper identification, please.\n" -"Fully scan all directories of your local disks?" -msgstr "" - -#: src/install/acquire/ui-line.c:258 -msgid "" -"Do you want to enter your custom search path and/or files? You can also " -"enter web URL." -msgstr "" -"Přejete si zadat vlastní cestu a/nebo soubory pro prohledání? Také můžete " -"zadat webové URL." - -#: src/install/acquire/ui-line.c:259 -msgid "Enter pathname or URL [hit ENTER to skip it]: " -msgstr "Zadejte adresářovou cestu či URL [stiskněte ENTER pro další krok]: " - -#: src/install/acquire/ui-line.c:266 -#, c-format -msgid "Error paring URI: %s" -msgstr "Chyba při zpracování URI: %s" - -#: src/install/acquire/ui-line.c:280 -msgid "" -"You can download the best available version of needed drivers from " -"Microsoft. They can be found in Microsoft Windows XP Service Pack 1 Checked " -"Build.\n" -"URL: http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/" -"checkedbuild.asp\n" -"Legal: In some countries you need to have valid Microsoft Windows XP license " -"to use it.\n" -"It is needed to download approx 29MB of data right now out of the 144MB file " -"size. You can also download the file separately and load it in the previous " -"screen if some problems occur.\n" -msgstr "" -"Můžete stáhnout nejpreferovanější dostupné verze potřebných ovladačů od " -"firmy Microsoft. Lze je nalézt v Microsoft Windows XP Service Pack 1 Checked " -"Build.\n" -"URL: http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/" -"checkedbuild.asp\n" -"Právní stránka: V některých zemích může být třeba pro legální použití mít " -"platnout licenci pro Microsoft Windows XP.\n" -"Bude nyní třeba stáhnout přibližně 29MB dat ze souboru o celkové délce " -"144MB. Při případných problémech můžete také tento soubor stáhnout zvlášť a " -"načíst jej na předchozí obrazovce.\n" - -#: src/install/acquire/ui-line.c:286 -msgid "" -"\n" -"We tried all available drivers acquiration methods - the options will start " -"again." -msgstr "" -"\n" -"Zkusili jsme všechny dostupné metody pro získání ovladačů - nabídka se nyní " -"bude již opakovat." - -#: src/install/acquire/ui-gnome.c:162 -msgid "NOT FOUND; essential module for NTFS disks access" -msgstr "NENALEZEN; požadovaný modul pro přístup na disky NTFS" - -#: src/install/acquire/ui-gnome.c:163 -msgid "not found; optional module" -msgstr "nenalezen; volitelný modul" - -#: src/install/acquire/ui-gnome.c:345 -msgid "" -"We need at least some version of drivers essential for this project: " -"ntoskrnl.exe and ntfs.sys. Please click 'Back' button to obtain them by " -"several methods offered by this installer." -msgstr "" -"Požadujeme alespoň nějakou verzi ovladačů vyžadovaných pro tento projekt: " -"ntoskrnl.exe a ntfs.sys. Prosím stiskněte tlačítko 'Zpět' pro jejich získání " -"některou z metod nabízenou tímto instalátorem." - -#: src/install/acquire/ui-gnome.c:506 -#, c-format -msgid "Invalid URI: %s" -msgstr "Neplatné URI: %s" - -#: src/install/acquire/ui-gnome.c:605 -msgid "" -"Although essential modules (\"ntoskrnl.exe\" and \"ntfs.sys\") are available " -"you may still want to get their better version and/or more modules. Really " -"quit?" -msgstr "" -"Ačkoliv požadované moduly (\"ntoskrnl.exe\" a \"ntfs.sys\") jsou dostupné, " -"stále můžete chtít získat jejich výhodnější verze a/nebo více modulů. " -"Opravdu skončit?" - -#: src/install/acquire/ui-gnome.c:705 -msgid "_Skip" -msgstr "_Přeskočit" - -#: src/install/acquire/ui-gnome-interface.c:67 -#: src/install/acquire/ui-gnome-interface.c:88 -msgid "Captive Microsoft Windows Drivers Acquire" -msgstr "Získání ovladačů Microsoft Windows pro Captive" - -#: src/install/acquire/ui-gnome-interface.c:90 -msgid "" -"Program allows safe read/write mount of NTFS disk drives.\n" -"It uses original Microsoft Windows driver files to access the disks. As " -"these files are licensed by Microsoft we will acquire them now for your " -"installation." -msgstr "" -"Program umožňuje bezpečné připojení NTFS disků pro čtení/zápis.\n" -"Používá původní soubory ovladačů Microsoft Windows pro přístup na disky. " -"Jelikož jsou tyto soubory licencované firmou Microsoft, získáme je nyní pro " -"vaši instalaci." - -#: src/install/acquire/ui-gnome-interface.c:97 -msgid "Local Disks Drivers Scan" -msgstr "Prohledání lokalních disků" - -#: src/install/acquire/ui-gnome-interface.c:116 -msgid "Currently found drivers" -msgstr "Aktuálně nalezené ovladače" - -#: src/install/acquire/ui-gnome-interface.c:134 -msgid "" -"We will scan your local hard drives to find any existing drivers usable for " -"this project." -msgstr "" -"Prohledáme vaše lokální disku pro nalezení jakýchkolvi existujících ovladačů " -"použitelných pro tento projekt." - -#: src/install/acquire/ui-gnome-interface.c:153 -msgid "Scanned File..." -msgstr "Prohledávaný soubor..." - -#: src/install/acquire/ui-gnome-interface.c:164 -msgid "Custom Drivers Location" -msgstr "Uživatelské umístění ovladačů" - -#: src/install/acquire/ui-gnome-interface.c:183 -msgid "" -"Here you can specify custom path to the drivers. Besides regular disk path " -"you can also specify www URL such as: http://machine/path/name\n" -"Detection of language localized MS-Windows drivers is missing. You may need " -"to copy localized ntfs.sys and ntoskrnl.exe to /var/lib/captive/ by cp(1) " -"command; contact me for their proper identification, please.\n" -"If you have no idea simply go Forward." -msgstr "" -"Zde můžete zadat vlastní cestu k ovladačům. Kromě běžných adresářových cest " -"můžetete také zadat www URL jako např. http://stroj/cesta/soubor\n" -"Chybí detekce MS-Windows ovladačů lokalizovaných MS-Windows. Můžete tedy být " -"třeba skopírovat ntfs.sys a ntoskrnl.exe do /var/lib/captive/ příkazem cp" -"(1); kontaktujte mě prosím pro jejich korektní identifikaci.\n" -"Pokud tuto možnost nepotřebujete, stiskněte Další." - -#: src/install/acquire/ui-gnome-interface.c:204 -msgid "Specify location" -msgstr "Zadejte umístění" - -#: src/install/acquire/ui-gnome-interface.c:215 -msgid "Download from microsoft.com" -msgstr "Stáhnutí z microsoft.com" - -#: src/install/acquire/ui-gnome-interface.c:234 -msgid "" -"You can download the best available version of needed drivers from " -"Microsoft. They can be found in Microsoft Windows XP Service Pack 1 Checked " -"Build.\n" -"URL: http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/" -"checkedbuild.asp\n" -"Legal: In some countries you need to have valid Microsoft Windows XP license " -"to use it.\n" -"It is needed to download approx 29MB of data right now out of the 144MB file " -"size. You can also download the file separately and load it in the previous " -"screen if some problems occur." -msgstr "" -"Můžete stáhnout nejpreferovanější dostupné verze potřebných ovladačů od " -"firmy Microsoft. Lze je nalézt v Microsoft Windows XP Service Pack 1 Checked " -"Build.\n" -"URL: http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/" -"checkedbuild.asp\n" -"Právní stránka: V některých zemích může být třeba pro legální použití mít " -"platnout licenci pro Microsoft Windows XP.\n" -"Bude nyní třeba stáhnout přibližně 29MB dat ze souboru o celkové délce " -"144MB. Při případných problémech můžete také tento soubor stáhnout zvlášť a " -"načíst jej na předchozí obrazovce." - -#: src/install/acquire/ui-gnome-interface.c:248 -msgid "Are you legally entitled to download Microsoft Windows XP Service Pack?" -msgstr "Jste oprávněn(a) pro stáhnutí Microsoft Windows XP Service Pack?" - -#: src/install/acquire/ui-gnome-interface.c:254 -msgid "Yes, start the download." -msgstr "Ano, zahájení stahování." - -#: src/install/acquire/ui-gnome-interface.c:270 -msgid "Microsoft Windows Drivers Captivated" -msgstr "Ovladače Microsoft Windows získány" - -#: src/install/acquire/ui-gnome-support.c:60 -#: src/install/acquire/ui-gnome-support.c:85 -#, c-format -msgid "Couldn't find pixmap file: %s" -msgstr "Nemohu nalézt pixmap soubor: %s" diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 33ad576..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -# $Id$ -# automake source for the topsrclevel Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -SUBDIRS=libcaptive client install TraceFS w32-mod diff --git a/src/TraceFS/Makefile.am b/src/TraceFS/Makefile.am deleted file mode 100644 index e8cb696..0000000 --- a/src/TraceFS/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# $Id$ -# UNIX automake source for the makefile of TraceFS -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -# We cannot use SUBDIRS as build.exe requires file named "Makefile" -# and its syntax is not compatible with automake / UNIX make. - -# TraceFS.sys is built but we consider it as source file here as not everyone -# has Microsoft DDK environment available. -# FIXME: Check for MinGW cross-compiler build possibility. - -EXTRA_DIST+= \ - TraceFS-W32/makeFile \ - TraceFS-W32/Sources \ - TraceFS-W32/TraceFS.c \ - TraceFS-W32/TraceFS.def \ - TraceFS-W32/TraceFS.reg \ - TraceFS-W32/TraceFS.sys \ - \ - checktrace.pl \ - hookfs.pl - -CLEANFILES+= \ - TraceFS-W32/obj \ - TraceFS-W32/objchk \ - TraceFS-W32/objfre \ - TraceFS-W32/buildchk.log \ - TraceFS-W32/buildchk.wrn \ - TraceFS-W32/buildchk.err \ - TraceFS-W32/buildfre.log \ - TraceFS-W32/buildfre.wrn \ - TraceFS-W32/buildfre.err diff --git a/src/TraceFS/TraceFS-W32/Sources b/src/TraceFS/TraceFS-W32/Sources deleted file mode 100644 index 7be5a62..0000000 --- a/src/TraceFS/TraceFS-W32/Sources +++ /dev/null @@ -1,30 +0,0 @@ -# $Id$ -# Makefile for W32 build of TraceFS by build.exe -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -TARGETNAME=TraceFS -TARGETPATH=obj - -TARGETTYPE=EXPORT_DRIVER -DRIVERTYPE=FS -NO_NTDLL=1 -UMTYPE=nt - -MSC_WARNING_LEVEL=/W3 /WX - -SOURCES= \ - tracefs.c diff --git a/src/TraceFS/TraceFS-W32/TraceFS.c b/src/TraceFS/TraceFS-W32/TraceFS.c deleted file mode 100644 index 61ac199..0000000 --- a/src/TraceFS/TraceFS-W32/TraceFS.c +++ /dev/null @@ -1,1630 +0,0 @@ -/* $Id$ - * Debugging tracer of IRPs and Cc* (Cache Manager) calls for W32 - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - - -#define CACHE_SIZE 0x200 - - -#define G_N_ELEMENTS(arr) (sizeof(arr)/sizeof((arr)[0])) - -NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,IN PUNICODE_STRING RegistryPath); - -#ifdef ALLOC_PRAGMA -#pragma alloc_text (INIT, DriverEntry) -#endif - -/* Ke*Mutex() would be reentrant but it looked too unclear for me. - * Never ExAcquireFastMutex() two FAST_MUTEX once or one FAST_MUTEX twice. - * Use Ex*ResourceLite instead of Ex*FastMutex() as it would set IRQL to DPC - * and we cannot pass the execution to Cc*() in DPC. - * Ex*FastMutex() problem: IRP_MJ_SHUTDOWN: Assertion failure. - */ -static ERESOURCE lock_resource; -static int lock_resource_count; -static PETHREAD lock_resource_CurrentThread; - -static void lock_init(void) -{ - if (ExInitializeResourceLite(&lock_resource)) - KeBugCheck(0); - lock_resource_count=0; - lock_resource_CurrentThread=NULL; -} - -static void lock(void) -{ - if (lock_resource_CurrentThread==PsGetCurrentThread()) { - if (lock_resource_count<=0) - KeBugCheck(0); - lock_resource_count++; - return; - } - KeEnterCriticalRegion(); - if (!ExAcquireResourceExclusiveLite(&lock_resource,TRUE)) - KeBugCheck(0); - KeLeaveCriticalRegion(); - if (lock_resource_CurrentThread) - KeBugCheck(0); - if (lock_resource_count) - KeBugCheck(0); - lock_resource_CurrentThread=PsGetCurrentThread(); - lock_resource_count++; -} - -/* We need to _fully_ release the lock if we are passing the control to - * callback functions. Single unlock() would free us from our current 'enter:' - * lock but another lock() from Cc*() function which called us would be held. - * FIXME: Enable of file compression still hangs in CcFlushCache(). - */ -static void lock_full(int n) -{ - if (n<=0) - KeBugCheck(0); - if (lock_resource_CurrentThread==PsGetCurrentThread()) - KeBugCheck(0); - KeEnterCriticalRegion(); - if (!ExAcquireResourceExclusiveLite(&lock_resource,TRUE)) - KeBugCheck(0); - KeLeaveCriticalRegion(); - if (lock_resource_CurrentThread) - KeBugCheck(0); - if (lock_resource_count) - KeBugCheck(0); - lock_resource_CurrentThread=PsGetCurrentThread(); - lock_resource_count+=n; -} - -static void unlock(void) -{ - if (lock_resource_CurrentThread!=PsGetCurrentThread()) - KeBugCheck(0); - if (lock_resource_count<=0) - KeBugCheck(0); - if (--lock_resource_count) - return; - lock_resource_CurrentThread=NULL; - KeEnterCriticalRegion(); - ExReleaseResourceLite(&lock_resource); - KeLeaveCriticalRegion(); -} - -static int unlock_full(void) -{ -int r; - - if (lock_resource_CurrentThread!=PsGetCurrentThread()) - KeBugCheck(0); - if (lock_resource_count<=0) - KeBugCheck(0); - r=lock_resource_count; - lock_resource_count=0; - lock_resource_CurrentThread=NULL; - KeEnterCriticalRegion(); - ExReleaseResourceLite(&lock_resource); - KeLeaveCriticalRegion(); - return r; -} - -#define DBGPREFIX "TraceFS(0x%08lX/0x%08lX): " -#define DBGARG PsGetCurrentProcess(),PsGetCurrentThread() - -static int dbgindent=0; - -/* DBGSINGLEENTER*() / DBGSINGLELEAVE*() are protected by lock()/unlock() - * to serialize the Cc*() function calls as otherwise the debug dumps - * chronology may not match the real core execution chronology inside. - */ - -/* lock() will protect dbg_unicode_string() static buffer. */ -#define DBGSINGLE6(fmt,arg1,arg2,arg3,arg4,arg5,arg6) \ - do { lock(); DbgPrint("%*s" DBGPREFIX fmt "\n",dbgindent,"",DBGARG,arg1,arg2,arg3,arg4,arg5,arg6); unlock(); } while (0) -#define DBGSINGLE5(fmt,arg1,arg2,arg3,arg4,arg5) DBGSINGLE6(fmt,arg1,arg2,arg3,arg4,arg5,0) -#define DBGSINGLE4(fmt,arg1,arg2,arg3,arg4) DBGSINGLE5(fmt,arg1,arg2,arg3,arg4,0) -#define DBGSINGLE3(fmt,arg1,arg2,arg3) DBGSINGLE4(fmt,arg1,arg2,arg3,0) -#define DBGSINGLE2(fmt,arg1,arg2) DBGSINGLE3(fmt,arg1,arg2,0) -#define DBGSINGLE1(fmt,arg1) DBGSINGLE2(fmt,arg1,0) -#define DBGSINGLE0(fmt) DBGSINGLE1(fmt,0) -#define DBGSINGLEENTER6(fmt,arg1,arg2,arg3,arg4,arg5,arg6) \ - do { lock(); DBGSINGLE6("enter: " fmt,arg1,arg2,arg3,arg4,arg5,arg6); dbgindent++; } while (0) -#define DBGSINGLEENTER5(fmt,arg1,arg2,arg3,arg4,arg5) DBGSINGLEENTER6(fmt,arg1,arg2,arg3,arg4,arg5,0) -#define DBGSINGLEENTER4(fmt,arg1,arg2,arg3,arg4) DBGSINGLEENTER5(fmt,arg1,arg2,arg3,arg4,0) -#define DBGSINGLEENTER3(fmt,arg1,arg2,arg3) DBGSINGLEENTER4(fmt,arg1,arg2,arg3,0) -#define DBGSINGLEENTER2(fmt,arg1,arg2) DBGSINGLEENTER3(fmt,arg1,arg2,0) -#define DBGSINGLEENTER1(fmt,arg1) DBGSINGLEENTER2(fmt,arg1,0) -#define DBGSINGLEENTER0(fmt) DBGSINGLEENTER1(fmt,0) -#define DBGSINGLELEAVE3(fmt,arg1,arg2,arg3) \ - do { dbgindent--; DBGSINGLE3("leave: " fmt,arg1,arg2,arg3); unlock(); } while (0) -#define DBGSINGLELEAVE2(fmt,arg1,arg2) DBGSINGLELEAVE3(fmt,arg1,arg2,0) -#define DBGSINGLELEAVE1(fmt,arg1) DBGSINGLELEAVE2(fmt,arg1,0) -#define DBGSINGLELEAVE0(fmt) DBGSINGLELEAVE1(fmt,0) - - -/* We cannot use DbgPrint("%wZ",...) as it must have IRQL PASSIVE_LEVEL which - * is not satisfied. - */ -static const char *dbg_unicode_string(UNICODE_STRING *unicode_string) -{ -static char buf[0x100]; -char *d; -PWSTR s; - - if (!unicode_string || !unicode_string->Buffer) - return "NULL"; - d=buf; - *d++='\''; - for (s=unicode_string->Buffer;sBuffer+(unicode_string->Length/2);s++) { - if (d>=buf+sizeof(buf)-4) - break; - *d++=(char)*s; - } - *d++='\''; - *d=0; - return buf; -} - -NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,IN PUNICODE_STRING RegistryPath) -{ -NTSTATUS r; -DEVICE_OBJECT *device_object; - - lock_init(); - - DBGSINGLEENTER1("DriverEntry: RegistryPath=%s",dbg_unicode_string(RegistryPath)); - DBGSINGLE1("DriverEntry: %s","$Id$"); - r=IoCreateDevice( - DriverObject, /* DriverObject */ - 0, /* DeviceExtensionSize */ - NULL, /* DeviceName; optional */ - FILE_DEVICE_UNKNOWN, /* DeviceType */ - 0, /* DeviceCharacteristics */ - FALSE, /* Exclusive */ - &device_object); /* DeviceObject */ - DBGSINGLELEAVE1("DriverEntry: r=0x%lX",(long)r); - return r; -} - -static const char *const dump_irp_mj_FILE_SYSTEM_CONTROL_MinorFunction_names[]={ - "IRP_MN_USER_FS_REQUEST", - "IRP_MN_MOUNT_VOLUME", - "IRP_MN_VERIFY_VOLUME", - "IRP_MN_LOAD_FILE_SYSTEM", - "IRP_MN_KERNEL_CALL", - }; - -/* Compatibility with DDK; the structures match. */ -#define FileSystemControl DeviceIoControl -#define FsControlCode IoControlCode -#ifndef FSCTL_REQUEST_BATCH_OPLOCK -#define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2,METHOD_BUFFERED,FILE_ANY_ACCESS) -#endif -#ifndef FSCTL_LOCK_VOLUME -#define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6,METHOD_BUFFERED,FILE_ANY_ACCESS) -#endif -#ifndef FSCTL_UNLOCK_VOLUME -#define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7,METHOD_BUFFERED,FILE_ANY_ACCESS) -#endif -#ifndef FSCTL_DISMOUNT_VOLUME -#define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8,METHOD_BUFFERED,FILE_ANY_ACCESS) -#endif -#ifndef FSCTL_MARK_VOLUME_DIRTY -#define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM,12,METHOD_BUFFERED,FILE_ANY_ACCESS) -#endif -#ifndef FSCTL_SET_COMPRESSION -#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM,16,METHOD_BUFFERED,FILE_READ_DATA|FILE_WRITE_DATA) -#endif -#ifndef FSCTL_INVALIDATE_VOLUMES -#define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM,21,METHOD_BUFFERED,FILE_ANY_ACCESS) -#endif -#ifndef FSCTL_IS_VOLUME_DIRTY -#define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM,30,METHOD_BUFFERED,FILE_ANY_ACCESS) -#endif -#ifndef FSCTL_FILE_PREFETCH -#define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM,72,METHOD_BUFFERED,FILE_SPECIAL_ACCESS) -#endif - -static struct SectionObjectPointer { - FILE_OBJECT *FileObject; - PVOID SharedCacheMap; - } SectionObjectPointer_cache[CACHE_SIZE]; -static int SectionObjectPointer_cache_used=0; - -static struct SectionObjectPointer *SectionObjectPointer_set(FILE_OBJECT *FileObject) -{ -struct SectionObjectPointer *sopp; -PVOID SharedCacheMap; - - if (!FileObject->SectionObjectPointer) - return NULL; - if (!(SharedCacheMap=FileObject->SectionObjectPointer->SharedCacheMap)) - return NULL; - for (sopp=SectionObjectPointer_cache;soppFileObject==FileObject || sopp->SharedCacheMap==SharedCacheMap) - break; - } - if (sopp>=SectionObjectPointer_cache+G_N_ELEMENTS(SectionObjectPointer_cache)) - return NULL; - if (sopp==SectionObjectPointer_cache+SectionObjectPointer_cache_used) - SectionObjectPointer_cache_used++; - sopp->FileObject=FileObject; - sopp->SharedCacheMap=SharedCacheMap; - return sopp; -} - -static FILE_OBJECT *SectionObjectPointer_find(SECTION_OBJECT_POINTERS *SectionObjectPointer) -{ -struct SectionObjectPointer *sopp; -PVOID SharedCacheMap; - - if (!SectionObjectPointer) - return NULL; - if (!(SharedCacheMap=SectionObjectPointer->SharedCacheMap)) - return NULL; - for (sopp=SectionObjectPointer_cache;soppSharedCacheMap==SharedCacheMap) - return sopp->FileObject; - } - return NULL; -} - -static void dump_FileObject(FILE_OBJECT *FileObject) -{ - if (!FileObject) { - DBGSINGLE0("FileObject=NULL"); - return; - } - DBGSINGLE6("FileObject=0x%lX: FileName=%s,ref=%+ld,Flags=0x%lX,SectionObjectPointer=0x%lX,->SharedCacheMap=0x%lX", - (long)FileObject, - dbg_unicode_string(&FileObject->FileName), - *(LONG *)(((char *)FileObject)-0x18), - FileObject->Flags, - (long)FileObject->SectionObjectPointer, - (!FileObject->SectionObjectPointer ? -1 : (long)FileObject->SectionObjectPointer->SharedCacheMap)); - SectionObjectPointer_set(FileObject); -} - -static FILE_OBJECT *dump_irp_mj(struct _DEVICE_OBJECT *DeviceObject,struct _IRP *Irp) -{ -IO_STACK_LOCATION *IoStackLocation; -FILE_OBJECT *FileObject; - - if (!Irp) { - DBGSINGLE0("Irp==NULL"); - return NULL; - } - IoStackLocation=IoGetCurrentIrpStackLocation(Irp); - if (!IoStackLocation) { - DBGSINGLE0("IoStackLocation==NULL"); - return NULL; - } - FileObject=IoStackLocation->FileObject; - dump_FileObject(FileObject); - - switch (IoStackLocation->MajorFunction) { - case IRP_MJ_READ: - DBGSINGLE2("READ: ByteOffset=0x%lX,Length=0x%lX", - (long)IoStackLocation->Parameters.Read.ByteOffset.QuadPart, - IoStackLocation->Parameters.Read.Length); - break; - case IRP_MJ_WRITE: - DBGSINGLE2("WRITE: ByteOffset=0x%lX,Length=0x%lX", - (long)IoStackLocation->Parameters.Write.ByteOffset.QuadPart, - IoStackLocation->Parameters.Write.Length); - break; - case IRP_MJ_FILE_SYSTEM_CONTROL: - DBGSINGLE2("FILE_SYSTEM_CONTROL: MinorFunction=%s (%0x%X)", - ((1 - && IoStackLocation->MinorFunction>=0 - && IoStackLocation->MinorFunctionMinorFunction] : "???"), - IoStackLocation->MinorFunction); - switch (IoStackLocation->MinorFunction) { - case IRP_MN_USER_FS_REQUEST: { -const char *FsControlCode_name; - switch (IoStackLocation->Parameters.FileSystemControl.FsControlCode) { - case FSCTL_REQUEST_BATCH_OPLOCK: FsControlCode_name="FSCTL_REQUEST_BATCH_OPLOCK"; break; - case FSCTL_LOCK_VOLUME: FsControlCode_name="FSCTL_LOCK_VOLUME"; break; - case FSCTL_UNLOCK_VOLUME: FsControlCode_name="FSCTL_UNLOCK_VOLUME"; break; - case FSCTL_DISMOUNT_VOLUME: FsControlCode_name="FSCTL_DISMOUNT_VOLUME"; break; - case FSCTL_MARK_VOLUME_DIRTY: FsControlCode_name="FSCTL_MARK_VOLUME_DIRTY"; break; - case FSCTL_SET_COMPRESSION: FsControlCode_name="FSCTL_SET_COMPRESSION"; break; - case FSCTL_INVALIDATE_VOLUMES: FsControlCode_name="FSCTL_INVALIDATE_VOLUMES"; break; - case FSCTL_IS_VOLUME_DIRTY: FsControlCode_name="FSCTL_IS_VOLUME_DIRTY"; break; - case FSCTL_FILE_PREFETCH: FsControlCode_name="FSCTL_FILE_PREFETCH"; break; - default: FsControlCode_name="???"; break; - } - DBGSINGLE2("USER_FS_REQUEST: FsControlCode=%s (0x%X)",FsControlCode_name, - IoStackLocation->Parameters.FileSystemControl.FsControlCode); - } break; - } - } - - return FileObject; -} - -#define TRACEFS_MAJORS \ - TRACEFS_MAJOR(IRP_MJ_CREATE) \ - TRACEFS_MAJOR(IRP_MJ_CREATE_NAMED_PIPE) \ - TRACEFS_MAJOR(IRP_MJ_CLOSE) \ - TRACEFS_MAJOR(IRP_MJ_READ) \ - TRACEFS_MAJOR(IRP_MJ_WRITE) \ - TRACEFS_MAJOR(IRP_MJ_QUERY_INFORMATION) \ - TRACEFS_MAJOR(IRP_MJ_SET_INFORMATION) \ - TRACEFS_MAJOR(IRP_MJ_QUERY_EA) \ - TRACEFS_MAJOR(IRP_MJ_SET_EA) \ - TRACEFS_MAJOR(IRP_MJ_FLUSH_BUFFERS) \ - TRACEFS_MAJOR(IRP_MJ_QUERY_VOLUME_INFORMATION) \ - TRACEFS_MAJOR(IRP_MJ_SET_VOLUME_INFORMATION) \ - TRACEFS_MAJOR(IRP_MJ_DIRECTORY_CONTROL) \ - TRACEFS_MAJOR(IRP_MJ_FILE_SYSTEM_CONTROL) \ - TRACEFS_MAJOR(IRP_MJ_DEVICE_CONTROL) \ - TRACEFS_MAJOR(IRP_MJ_INTERNAL_DEVICE_CONTROL) \ - TRACEFS_MAJOR(IRP_MJ_SHUTDOWN) \ - TRACEFS_MAJOR(IRP_MJ_LOCK_CONTROL) \ - TRACEFS_MAJOR(IRP_MJ_CLEANUP) \ - TRACEFS_MAJOR(IRP_MJ_CREATE_MAILSLOT) \ - TRACEFS_MAJOR(IRP_MJ_QUERY_SECURITY) \ - TRACEFS_MAJOR(IRP_MJ_SET_SECURITY) \ - TRACEFS_MAJOR(IRP_MJ_POWER) \ - TRACEFS_MAJOR(IRP_MJ_SYSTEM_CONTROL) \ - TRACEFS_MAJOR(IRP_MJ_DEVICE_CHANGE) \ - TRACEFS_MAJOR(IRP_MJ_QUERY_QUOTA) \ - TRACEFS_MAJOR(IRP_MJ_SET_QUOTA) \ - TRACEFS_MAJOR(IRP_MJ_PNP) - - -#define TRACEFS_MAJOR(irp_mj_name) \ -static NTSTATUS (*tracefs_major_##irp_mj_name##_orig)(IN struct _DEVICE_OBJECT *DeviceObject,IN struct _IRP *Irp); \ -static NTSTATUS tracefs_major_##irp_mj_name(IN struct _DEVICE_OBJECT *DeviceObject,IN struct _IRP *Irp) \ -{ \ -NTSTATUS r; \ -int locked; \ -FILE_OBJECT *FileObject; \ - \ - DBGSINGLEENTER0( #irp_mj_name ); \ - FileObject=dump_irp_mj(DeviceObject,Irp); \ - /* Prevent deadlock during display of File Explorer directory listing. \ - * Needed at least for IRP_MJ_DIRECTORY_CONTROL and IRP_MJ_CLOSE. \ - */ \ - locked=unlock_full(); \ - r=(*tracefs_major_##irp_mj_name##_orig)(DeviceObject,Irp); \ - lock_full(locked); \ - /* Dump_irp_mj() would crash here even now IRP_MJ_READ; \ - * Invalid FileObject address gets detected. \ - */ \ - dump_FileObject(FileObject); \ - DBGSINGLELEAVE1( #irp_mj_name ": r=0x%lX",(long)r); \ - return r; \ -} - -TRACEFS_MAJORS - -#undef TRACEFS_MAJOR - - -VOID IoRegisterFileSystem(IN OUT PDEVICE_OBJECT DeviceObject); -VOID ToRegisterFileSystem(IN OUT PDEVICE_OBJECT DeviceObject) -{ - DBGSINGLEENTER0("IoRegisterFileSystem"); - -#define TRACEFS_MAJOR(irp_mj_name) do { \ - tracefs_major_##irp_mj_name##_orig=DeviceObject->DriverObject->MajorFunction[irp_mj_name]; \ - DeviceObject->DriverObject->MajorFunction[irp_mj_name]=tracefs_major_##irp_mj_name; \ - } while (0); - -TRACEFS_MAJORS - -#undef TRACEFS_MAJOR - - IoRegisterFileSystem(DeviceObject); - DBGSINGLELEAVE0("IoRegisterFileSystem"); -} - - -static char PsCreateSystemThread_bogusthread; - -NTSTATUS TsCreateSystemThread( - OUT PHANDLE ThreadHandle, - IN ULONG DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, - IN HANDLE ProcessHandle OPTIONAL, - OUT PCLIENT_ID ClientId OPTIONAL, - IN PKSTART_ROUTINE StartRoutine, - IN PVOID StartContext - ) -{ - DBGSINGLEENTER1("PsCreateSystemThread: StartRoutine=0x%lX",(long)StartRoutine); - if (ThreadHandle) - *ThreadHandle=(HANDLE)&PsCreateSystemThread_bogusthread; - DBGSINGLELEAVE0("PsCreateSystemThread"); - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -TwClose( - IN HANDLE Handle - ) -{ - DBGSINGLEENTER0("ZwClose"); - if (Handle==(HANDLE)&PsCreateSystemThread_bogusthread) { - DBGSINGLELEAVE0("ZwClose: bogusthread catched"); - return STATUS_SUCCESS; - } - DBGSINGLELEAVE0("ZwClose: passed"); - return ZwClose(Handle); -} - - -BOOLEAN -CcCanIWrite ( - IN PFILE_OBJECT FileObject, - IN ULONG BytesToWrite, - IN BOOLEAN Wait, - IN BOOLEAN Retrying - ); -BOOLEAN -TcCanIWrite ( - IN PFILE_OBJECT FileObject, - IN ULONG BytesToWrite, - IN BOOLEAN Wait, - IN BOOLEAN Retrying - ) -{ -BOOLEAN r; - - DBGSINGLEENTER4("CcCanIWrite: FileObject=0x%lX,BytesToWrite=0x%lX,Wait=%d,Retrying=%d", - (long)FileObject,BytesToWrite,Wait,Retrying); - dump_FileObject(FileObject); - r=CcCanIWrite ( -FileObject, -BytesToWrite, -Wait, -Retrying - ); - DBGSINGLELEAVE1("CcCanIWrite: r=%d",r); - return r; -} - -BOOLEAN -CcCopyRead ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN BOOLEAN Wait, - OUT PVOID Buffer, - OUT PIO_STATUS_BLOCK IoStatus - ); -BOOLEAN -TcCopyRead ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN BOOLEAN Wait, - OUT PVOID Buffer, - OUT PIO_STATUS_BLOCK IoStatus - ) -{ -BOOLEAN r; - - DBGSINGLEENTER5("CcCopyRead: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Wait=%d,Buffer=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Wait,(long)Buffer); - dump_FileObject(FileObject); - r=CcCopyRead ( -FileObject, -FileOffset, -Length, -Wait, -Buffer, -IoStatus - ); - DBGSINGLELEAVE3("CcCopyRead: r=%d,IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - r,(!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); - return r; -} - -BOOLEAN -CcCopyWrite ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN BOOLEAN Wait, - IN PVOID Buffer - ); -BOOLEAN -TcCopyWrite ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN BOOLEAN Wait, - IN PVOID Buffer - ) -{ -BOOLEAN r; - - DBGSINGLEENTER5("CcCopyWrite: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Wait=%d,Buffer=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Wait,(long)Buffer); - dump_FileObject(FileObject); - r=CcCopyWrite ( -FileObject, -FileOffset, -Length, -Wait, -Buffer - ); - DBGSINGLELEAVE1("CcCopyWrite: r=%d",r); - return r; -} - -typedef -VOID (*PCC_POST_DEFERRED_WRITE) ( - IN PVOID Context1, - IN PVOID Context2 - ); -VOID -CcDeferWrite ( - IN PFILE_OBJECT FileObject, - IN PCC_POST_DEFERRED_WRITE PostRoutine, - IN PVOID Context1, - IN PVOID Context2, - IN ULONG BytesToWrite, - IN BOOLEAN Retrying - ); -TcDeferWrite ( - IN PFILE_OBJECT FileObject, - IN PCC_POST_DEFERRED_WRITE PostRoutine, - IN PVOID Context1, - IN PVOID Context2, - IN ULONG BytesToWrite, - IN BOOLEAN Retrying - ) -{ - DBGSINGLEENTER6("CcDeferWrite: FileObject=0x%lX,PostRoutine=0x%lX,Context1=0x%lX,Context2=0x%lX," - "BytesToWrite=0x%lX,Retrying=%d", - (long)FileObject,(long)PostRoutine,(long)Context1,(long)Context2, - BytesToWrite,Retrying); - dump_FileObject(FileObject); - CcDeferWrite ( -FileObject, -PostRoutine, -Context1, -Context2, -BytesToWrite, -Retrying - ); - DBGSINGLELEAVE0("CcDeferWrite"); -} - -VOID -CcFastCopyRead ( - IN PFILE_OBJECT FileObject, - IN ULONG FileOffset, - IN ULONG Length, - IN ULONG PageCount, - OUT PVOID Buffer, - OUT PIO_STATUS_BLOCK IoStatus - ); -VOID -TcFastCopyRead ( - IN PFILE_OBJECT FileObject, - IN ULONG FileOffset, - IN ULONG Length, - IN ULONG PageCount, - OUT PVOID Buffer, - OUT PIO_STATUS_BLOCK IoStatus - ) -{ - DBGSINGLEENTER5("CcFastCopyRead: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,PageCount=0x%lX,Buffer=0x%lX", - (long)FileObject,FileOffset,Length,PageCount,(long)Buffer); - dump_FileObject(FileObject); - CcFastCopyRead ( -FileObject, -FileOffset, -Length, -PageCount, -Buffer, -IoStatus - ); - DBGSINGLELEAVE2("CcFastCopyRead: IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - (!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); -} - -VOID -CcFastCopyWrite ( - IN PFILE_OBJECT FileObject, - IN ULONG FileOffset, - IN ULONG Length, - IN PVOID Buffer - ); -VOID -TcFastCopyWrite ( - IN PFILE_OBJECT FileObject, - IN ULONG FileOffset, - IN ULONG Length, - IN PVOID Buffer - ) -{ - DBGSINGLEENTER4("CcFastCopyWrite: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Buffer=0x%lX", - (long)FileObject,FileOffset,Length,(long)Buffer); - dump_FileObject(FileObject); - CcFastCopyWrite ( -FileObject, -FileOffset, -Length, -Buffer - ); - DBGSINGLELEAVE0("CcFastCopyWrite"); -} - -VOID -CcFlushCache ( - IN PSECTION_OBJECT_POINTERS SectionObjectPointer, - IN PLARGE_INTEGER FileOffset OPTIONAL, - IN ULONG Length, - OUT PIO_STATUS_BLOCK IoStatus OPTIONAL - ); -VOID -TcFlushCache ( - IN PSECTION_OBJECT_POINTERS SectionObjectPointer, - IN PLARGE_INTEGER FileOffset OPTIONAL, - IN ULONG Length, - OUT PIO_STATUS_BLOCK IoStatus OPTIONAL - ) -{ - DBGSINGLEENTER4("CcFlushCache: SectionObjectPointer=0x%lX,->SharedCacheMap=0x%lX,FileOffset=0x%lX,Length=0x%lX", - (long)SectionObjectPointer, - (!SectionObjectPointer ? -1 : (long)SectionObjectPointer->SharedCacheMap), - (!FileOffset ? -1 : (long)FileOffset->QuadPart),Length); - dump_FileObject(SectionObjectPointer_find(SectionObjectPointer)); - CcFlushCache ( -SectionObjectPointer, -FileOffset, -Length, -IoStatus - ); - dump_FileObject(SectionObjectPointer_find(SectionObjectPointer)); - DBGSINGLELEAVE2("CcFlushCache: IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - (!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); -} - -typedef -VOID (*PDIRTY_PAGE_ROUTINE) ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN PLARGE_INTEGER OldestLsn, - IN PLARGE_INTEGER NewestLsn, - IN PVOID Context1, - IN PVOID Context2 - ); - -static PDIRTY_PAGE_ROUTINE TcGetDirtyPages_DirtyPageRoutine_orig; -static BOOLEAN TcGetDirtyPages_DirtyPageRoutine_used=FALSE; - -static VOID TcGetDirtyPages_DirtyPageRoutine(IN PFILE_OBJECT FileObject,IN PLARGE_INTEGER FileOffset,IN ULONG Length, - IN PLARGE_INTEGER OldestLsn,IN PLARGE_INTEGER NewestLsn,IN PVOID Context1,IN PVOID Context2) -{ - DBGSINGLEENTER5("DirtyPageRoutine: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX," - "OldestLsn=0x%lX,NewestLsn=0x%lX,Context1,Context2", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length, - (!OldestLsn ? -1 : (long)OldestLsn->QuadPart),(!NewestLsn ? -1 : (long)NewestLsn->QuadPart)); - dump_FileObject(FileObject); - (*TcGetDirtyPages_DirtyPageRoutine_orig)(FileObject,FileOffset,Length,OldestLsn,NewestLsn,Context1,Context2); - DBGSINGLELEAVE0("DirtyPageRoutine"); -} - -LARGE_INTEGER -CcGetDirtyPages ( - IN PVOID LogHandle, - IN PDIRTY_PAGE_ROUTINE DirtyPageRoutine, - IN PVOID Context1, - IN PVOID Context2 - ); -LARGE_INTEGER -TcGetDirtyPages ( - IN PVOID LogHandle, - IN PDIRTY_PAGE_ROUTINE DirtyPageRoutine, - IN PVOID Context1, - IN PVOID Context2 - ) -{ -LARGE_INTEGER r; - - DBGSINGLEENTER4("CcGetDirtyPages: LogHandle=0x%lX,DirtyPageRoutine=0x%lX,Context1=0x%lX,Context2=0x%lX", - (long)LogHandle,(long)DirtyPageRoutine,(long)Context1,(long)Context2); - if (TcGetDirtyPages_DirtyPageRoutine_used) - DBGSINGLE0("CcGetDirtyPages: ERROR: TcGetDirtyPages_DirtyPageRoutine_used"); - else { - TcGetDirtyPages_DirtyPageRoutine_used=TRUE; - TcGetDirtyPages_DirtyPageRoutine_orig=DirtyPageRoutine; - DirtyPageRoutine=TcGetDirtyPages_DirtyPageRoutine; - } - r=CcGetDirtyPages ( -LogHandle, -DirtyPageRoutine, -Context1, -Context2 - ); - if (DirtyPageRoutine==TcGetDirtyPages_DirtyPageRoutine) - TcGetDirtyPages_DirtyPageRoutine_used=FALSE; - DBGSINGLELEAVE1("CcGetDirtyPages: r=0x%lX",(long)r.QuadPart); - return r; -} - -typedef BOOLEAN (*PACQUIRE_FOR_LAZY_WRITE)(IN PVOID Context,IN BOOLEAN Wait); -typedef VOID (*PRELEASE_FROM_LAZY_WRITE)(IN PVOID Context); -typedef BOOLEAN (*PACQUIRE_FOR_READ_AHEAD)(IN PVOID Context,IN BOOLEAN Wait); -typedef VOID (*PRELEASE_FROM_READ_AHEAD)(IN PVOID Context); -typedef struct _CACHE_MANAGER_CALLBACKS { - PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite; - PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite; - PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead; - PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead; - } CACHE_MANAGER_CALLBACKS,*PCACHE_MANAGER_CALLBACKS; - -static struct Callbacks { - FILE_OBJECT *FileObject; - CACHE_MANAGER_CALLBACKS Callbacks; - PVOID LazyWriteContext; - } Callbacks_cache[CACHE_SIZE]; -static int Callbacks_cache_used=0; - -static struct Callbacks *Callbacks_set(FILE_OBJECT *FileObject,CACHE_MANAGER_CALLBACKS *Callbacks,PVOID LazyWriteContext) -{ -struct Callbacks *callbacksp; - - for (callbacksp=Callbacks_cache;callbackspFileObject==FileObject) - break; - } - if (callbacksp>=Callbacks_cache+G_N_ELEMENTS(Callbacks_cache)) - return NULL; - if (callbacksp==Callbacks_cache+Callbacks_cache_used) - Callbacks_cache_used++; - callbacksp->FileObject=FileObject; - callbacksp->Callbacks=*Callbacks; - callbacksp->LazyWriteContext=LazyWriteContext; - return callbacksp; -} - -static BOOLEAN TcInitializeCacheMap_AcquireForLazyWrite(IN PVOID Context,IN BOOLEAN Wait) -{ -struct Callbacks *callbacksp=Context; -BOOLEAN r; -int locked; - - DBGSINGLEENTER3("AcquireForLazyWrite: FileObject=0x%lX,Context=0x%lX,Wait=%d", - (long)callbacksp->FileObject,(long)callbacksp->LazyWriteContext,Wait); - dump_FileObject(callbacksp->FileObject); - /* Prevent deadlock during File Explorer copy to our destination. */ - locked=unlock_full(); - r=(*callbacksp->Callbacks.AcquireForLazyWrite)(callbacksp->LazyWriteContext,Wait); - lock_full(locked); - DBGSINGLELEAVE1("AcquireForLazyWrite: r=%d",r); - return r; -} - -static VOID TcInitializeCacheMap_ReleaseFromLazyWrite(IN PVOID Context) -{ -struct Callbacks *callbacksp=Context; -int locked; - - DBGSINGLEENTER2("ReleaseFromLazyWrite: FileObject=0x%lX,Context=0x%lX", - (long)callbacksp->FileObject,(long)callbacksp->LazyWriteContext); - dump_FileObject(callbacksp->FileObject); - /* Prevent deadlock during File Explorer copy to our destination. */ - locked=unlock_full(); - (*callbacksp->Callbacks.ReleaseFromLazyWrite)(callbacksp->LazyWriteContext); - lock_full(locked); - DBGSINGLELEAVE0("ReleaseFromLazyWrite"); -} - -static BOOLEAN TcInitializeCacheMap_AcquireForReadAhead(IN PVOID Context,IN BOOLEAN Wait) -{ -struct Callbacks *callbacksp=Context; -BOOLEAN r; -int locked; - - DBGSINGLEENTER3("AcquireForReadAhead: FileObject=0x%lX,Context=0x%lX,Wait=%d", - (long)callbacksp->FileObject,(long)callbacksp->LazyWriteContext,Wait); - dump_FileObject(callbacksp->FileObject); - /* Prevent deadlock during File Explorer copy to our destination. */ - locked=unlock_full(); - r=(*callbacksp->Callbacks.AcquireForReadAhead)(callbacksp->LazyWriteContext,Wait); - lock_full(locked); - DBGSINGLELEAVE1("AcquireForReadAhead: r=%d",r); - return r; -} - -static VOID TcInitializeCacheMap_ReleaseFromReadAhead(IN PVOID Context) -{ -struct Callbacks *callbacksp=Context; -int locked; - - DBGSINGLEENTER2("ReleaseFromReadAhead: FileObject=0x%lX,Context=0x%lX", - (long)callbacksp->FileObject,(long)callbacksp->LazyWriteContext); - dump_FileObject(callbacksp->FileObject); - /* Prevent deadlock during File Explorer copy to our destination. */ - locked=unlock_full(); - (*callbacksp->Callbacks.ReleaseFromReadAhead)(callbacksp->LazyWriteContext); - lock_full(locked); - DBGSINGLELEAVE0("ReleaseFromReadAhead"); -} - -static CACHE_MANAGER_CALLBACKS TcInitializeCacheMap_Callbacks={ - TcInitializeCacheMap_AcquireForLazyWrite, - TcInitializeCacheMap_ReleaseFromLazyWrite, - TcInitializeCacheMap_AcquireForReadAhead, - TcInitializeCacheMap_ReleaseFromReadAhead, - }; - -typedef struct _CC_FILE_SIZES { - LARGE_INTEGER AllocationSize; - LARGE_INTEGER FileSize; - LARGE_INTEGER ValidDataLength; - } CC_FILE_SIZES,*PCC_FILE_SIZES; - -VOID -CcInitializeCacheMap ( - IN PFILE_OBJECT FileObject, - IN PCC_FILE_SIZES FileSizes, - IN BOOLEAN PinAccess, - IN PCACHE_MANAGER_CALLBACKS Callbacks, - IN PVOID LazyWriteContext - ); -VOID -TcInitializeCacheMap ( - IN PFILE_OBJECT FileObject, - IN PCC_FILE_SIZES FileSizes, - IN BOOLEAN PinAccess, - IN PCACHE_MANAGER_CALLBACKS Callbacks, - IN PVOID LazyWriteContext - ) -{ -struct Callbacks *callbacksp; - - DBGSINGLEENTER5("CcInitializeCacheMap: FileObject=0x%lX," - "FileSizes,->AllocationSize=0x%lX,->FileSize=0x%lX,->ValidDataLength=0x%lX," - "PinAccess=%d,Callbacks,LazyWriteContext", - (long)FileObject, - (!FileSizes ? -1 : (long)FileSizes->AllocationSize.QuadPart), - (!FileSizes ? -1 : (long)FileSizes->FileSize.QuadPart), - (!FileSizes ? -1 : (long)FileSizes->ValidDataLength.QuadPart), - PinAccess); - dump_FileObject(FileObject); - if ((callbacksp=Callbacks_set(FileObject,Callbacks,LazyWriteContext))) { - Callbacks=&TcInitializeCacheMap_Callbacks; - LazyWriteContext=callbacksp; - if (Callbacks->AcquireForLazyWrite !=TcInitializeCacheMap_AcquireForLazyWrite) - DBGSINGLE1("CcInitializeCacheMap: ERROR: AcquireForLazyWrite =0x%lX",Callbacks->AcquireForLazyWrite); - if (Callbacks->ReleaseFromLazyWrite!=TcInitializeCacheMap_ReleaseFromLazyWrite) - DBGSINGLE1("CcInitializeCacheMap: ERROR: ReleaseFromLazyWrite=0x%lX",Callbacks->ReleaseFromLazyWrite); - if (Callbacks->AcquireForReadAhead !=TcInitializeCacheMap_AcquireForReadAhead) - DBGSINGLE1("CcInitializeCacheMap: ERROR: AcquireForReadAhead =0x%lX",Callbacks->AcquireForReadAhead); - if (Callbacks->ReleaseFromReadAhead!=TcInitializeCacheMap_ReleaseFromReadAhead) - DBGSINGLE1("CcInitializeCacheMap: ERROR: ReleaseFromReadAhead=0x%lX",Callbacks->ReleaseFromReadAhead); - } - CcInitializeCacheMap ( -FileObject, -FileSizes, -PinAccess, -Callbacks, -LazyWriteContext - ); - dump_FileObject(FileObject); - DBGSINGLELEAVE0("CcInitializeCacheMap"); -} - -BOOLEAN -CcMapData ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN ULONG Flags, - OUT PVOID *Bcb, - OUT PVOID *Buffer - ); -BOOLEAN -TcMapData ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN ULONG Flags, - OUT PVOID *Bcb, - OUT PVOID *Buffer - ) -{ -BOOLEAN r; - - DBGSINGLEENTER4("CcMapData: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Flags=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Flags); - dump_FileObject(FileObject); - r=CcMapData ( -FileObject, -FileOffset, -Length, -Flags, -Bcb, -Buffer - ); - DBGSINGLELEAVE3("CcMapData: r=%d,Bcb=0x%lX,Buffer=0x%lX", - r,(!Bcb ? -1 : (long)*Bcb),(!Buffer ? -1 : (long)*Buffer)); - return r; -} - -VOID -CcMdlRead ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - OUT PMDL *MdlChain, - OUT PIO_STATUS_BLOCK IoStatus - ); -VOID -TcMdlRead ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - OUT PMDL *MdlChain, - OUT PIO_STATUS_BLOCK IoStatus - ) -{ - DBGSINGLEENTER3("CcMdlRead: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length); - dump_FileObject(FileObject); - CcMdlRead ( -FileObject, -FileOffset, -Length, -MdlChain, -IoStatus - ); - DBGSINGLELEAVE3("CcMdlRead: MdlChain=0x%lX,IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - (!MdlChain ? -1 : (long)*MdlChain), - (!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); -} - -VOID -CcMdlReadComplete ( - IN PFILE_OBJECT FileObject, - IN PMDL MdlChain - ); -VOID -TcMdlReadComplete ( - IN PFILE_OBJECT FileObject, - IN PMDL MdlChain - ) -{ - DBGSINGLEENTER2("CcMdlReadComplete: FileObject=0x%lX,MdlChain=0x%lX", - (long)FileObject,(long)MdlChain); - dump_FileObject(FileObject); - CcMdlReadComplete ( -FileObject, -MdlChain - ); - DBGSINGLELEAVE0("CcMdlReadComplete"); -} - -VOID -CcMdlWriteAbort ( - IN PFILE_OBJECT FileObject, - IN PMDL MdlChain - ); -VOID -TcMdlWriteAbort ( - IN PFILE_OBJECT FileObject, - IN PMDL MdlChain - ) -{ - DBGSINGLEENTER2("CcMdlWriteAbort: FileObject=0x%lX,MdlChain=0x%lX", - (long)FileObject,(long)MdlChain); - dump_FileObject(FileObject); - CcMdlWriteAbort ( -FileObject, -MdlChain - ); - DBGSINGLELEAVE0("CcMdlWriteAbort"); -} - -VOID -CcMdlWriteComplete ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN PMDL MdlChain - ); -VOID -TcMdlWriteComplete ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN PMDL MdlChain - ) -{ - DBGSINGLEENTER3("CcMdlWriteComplete: FileObject=0x%lX,FileOffset=0x%lX,MdlChain=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),(long)MdlChain); - dump_FileObject(FileObject); - CcMdlWriteComplete ( -FileObject, -FileOffset, -MdlChain - ); - DBGSINGLELEAVE0("CcMdlWriteComplete"); -} - -BOOLEAN -CcPinMappedData ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN ULONG Flags, - IN OUT PVOID *Bcb - ); -BOOLEAN -TcPinMappedData ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN ULONG Flags, - IN OUT PVOID *Bcb - ) -{ -BOOLEAN r; - - DBGSINGLEENTER4("CcPinMappedData: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Flags=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Flags); - dump_FileObject(FileObject); - r=CcPinMappedData ( -FileObject, -FileOffset, -Length, -Flags, -Bcb - ); - DBGSINGLELEAVE2("CcPinMappedData: r=%d,Bcb=0x%lX", - r,(!Bcb ? -1 : (long)*Bcb)); - return r; -} - -BOOLEAN -CcPinRead ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN ULONG Flags, - OUT PVOID *Bcb, - OUT PVOID *Buffer - ); -BOOLEAN -TcPinRead ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN ULONG Flags, - OUT PVOID *Bcb, - OUT PVOID *Buffer - ) -{ -BOOLEAN r; - - DBGSINGLEENTER4("CcPinRead: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Flags=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Flags); - dump_FileObject(FileObject); - r=CcPinRead ( -FileObject, -FileOffset, -Length, -Flags, -Bcb, -Buffer - ); - DBGSINGLELEAVE3("CcPinRead: r=%d,Bcb=0x%lX,Buffer=0x%lX", - r,(!Bcb ? -1 : (long)*Bcb),(!Buffer ? -1 : (long)*Buffer)); - return r; -} - -VOID -CcPrepareMdlWrite ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - OUT PMDL *MdlChain, - OUT PIO_STATUS_BLOCK IoStatus - ); -VOID -TcPrepareMdlWrite ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - OUT PMDL *MdlChain, - OUT PIO_STATUS_BLOCK IoStatus - ) -{ - DBGSINGLEENTER3("CcPrepareMdlWrite: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length); - dump_FileObject(FileObject); - CcPrepareMdlWrite ( -FileObject, -FileOffset, -Length, -MdlChain, -IoStatus - ); - DBGSINGLELEAVE3("CcPrepareMdlWrite: MdlChain=0x%lX,IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - (!MdlChain ? -1 : (long)*MdlChain), - (!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); -} - -BOOLEAN -CcPreparePinWrite ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN BOOLEAN Zero, - IN ULONG Flags, - OUT PVOID *Bcb, - OUT PVOID *Buffer - ); -BOOLEAN -TcPreparePinWrite ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset, - IN ULONG Length, - IN BOOLEAN Zero, - IN ULONG Flags, - OUT PVOID *Bcb, - OUT PVOID *Buffer - ) -{ -BOOLEAN r; - - DBGSINGLEENTER5("CcPreparePinWrite: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Zero=%d,Flags=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Zero,Flags); - dump_FileObject(FileObject); - r=CcPreparePinWrite ( -FileObject, -FileOffset, -Length, -Zero, -Flags, -Bcb, -Buffer - ); - DBGSINGLELEAVE3("CcPreparePinWrite: r=%d,Bcb=0x%lX,Buffer=0x%lX", - r,(!Bcb ? -1 : (long)*Bcb),(!Buffer ? -1 : (long)*Buffer)); - return r; -} - -BOOLEAN -CcPurgeCacheSection ( - IN PSECTION_OBJECT_POINTERS SectionObjectPointer, - IN PLARGE_INTEGER FileOffset OPTIONAL, - IN ULONG Length, - IN BOOLEAN UninitializeCacheMaps - ); -BOOLEAN -TcPurgeCacheSection ( - IN PSECTION_OBJECT_POINTERS SectionObjectPointer, - IN PLARGE_INTEGER FileOffset OPTIONAL, - IN ULONG Length, - IN BOOLEAN UninitializeCacheMaps - ) -{ -BOOLEAN r; - - DBGSINGLEENTER5("CcPurgeCacheSection: SectionObjectPointer=0x%lX,->SharedCacheMap=0x%lX,FileOffset=0x%lX,Length=0x%lX," - "UninitializeCacheMaps=%d", - (long)SectionObjectPointer, - (!SectionObjectPointer ? -1 : (long)SectionObjectPointer->SharedCacheMap), - (!FileOffset ? -1 : (long)FileOffset->QuadPart),Length, - UninitializeCacheMaps); - dump_FileObject(SectionObjectPointer_find(SectionObjectPointer)); - r=CcPurgeCacheSection ( -SectionObjectPointer, -FileOffset, -Length, -UninitializeCacheMaps - ); - dump_FileObject(SectionObjectPointer_find(SectionObjectPointer)); - DBGSINGLELEAVE1("CcPurgeCacheSection: r=%d",r); - return r; -} - -PVOID -CcRemapBcb ( - IN PVOID Bcb - ); -PVOID -TcRemapBcb ( - IN PVOID Bcb - ) -{ -PVOID r; - - DBGSINGLEENTER1("CcRemapBcb: Bcb=0x%lX",(long)Bcb); - r=CcRemapBcb ( -Bcb - ); - DBGSINGLELEAVE1("CcRemapBcb: r=0x%lX",(long)r); - return r; -} - -VOID -CcSetAdditionalCacheAttributes ( - IN PFILE_OBJECT FileObject, - IN BOOLEAN DisableReadAhead, - IN BOOLEAN DisableWriteBehind - ); -VOID -TcSetAdditionalCacheAttributes ( - IN PFILE_OBJECT FileObject, - IN BOOLEAN DisableReadAhead, - IN BOOLEAN DisableWriteBehind - ) -{ - DBGSINGLEENTER3("CcSetAdditionalCacheAttributes: FileObject=0x%lX,DisableReadAhead=%d,DisableWriteBehind=%d", - (long)FileObject,DisableReadAhead,DisableWriteBehind); - dump_FileObject(FileObject); - CcSetAdditionalCacheAttributes ( -FileObject, -DisableReadAhead, -DisableWriteBehind - ); - DBGSINGLELEAVE0("CcSetAdditionalCacheAttributes"); -} - -VOID -CcSetBcbOwnerPointer ( - IN PVOID Bcb, - IN PVOID OwnerPointer - ); -VOID -TcSetBcbOwnerPointer ( - IN PVOID Bcb, - IN PVOID OwnerPointer - ) -{ - DBGSINGLEENTER2("CcSetBcbOwnerPointer: Bcb=0x%lX,OwnerPointer=0x%lX", - (long)Bcb,(long)OwnerPointer); - CcSetBcbOwnerPointer ( -Bcb, -OwnerPointer - ); - DBGSINGLELEAVE0("CcSetBcbOwnerPointer"); -} - -VOID -CcSetDirtyPinnedData ( - IN PVOID BcbVoid, - IN PLARGE_INTEGER Lsn OPTIONAL - ); -VOID -TcSetDirtyPinnedData ( - IN PVOID BcbVoid, - IN PLARGE_INTEGER Lsn OPTIONAL - ) -{ - DBGSINGLEENTER2("CcSetDirtyPinnedData: BcbVoid=0x%lX,Lsn=0x%lX", - (long)BcbVoid,(!Lsn ? -1 : (long)Lsn->QuadPart)); - CcSetDirtyPinnedData ( -BcbVoid, -Lsn - ); - DBGSINGLELEAVE0("CcSetDirtyPinnedData"); -} - -VOID -CcSetFileSizes ( - IN PFILE_OBJECT FileObject, - IN PCC_FILE_SIZES FileSizes - ); -VOID -TcSetFileSizes ( - IN PFILE_OBJECT FileObject, - IN PCC_FILE_SIZES FileSizes - ) -{ - DBGSINGLEENTER4("CcSetFileSizes: FileObject=0x%lX," - "FileSizes,->AllocationSize=0x%lX,->FileSize=0x%lX,->ValidDataLength=0x%lX", - (long)FileObject, - (!FileSizes ? -1 : (long)FileSizes->AllocationSize.QuadPart), - (!FileSizes ? -1 : (long)FileSizes->FileSize.QuadPart), - (!FileSizes ? -1 : (long)FileSizes->ValidDataLength.QuadPart)); - dump_FileObject(FileObject); - CcSetFileSizes ( -FileObject, -FileSizes - ); - DBGSINGLELEAVE0("CcSetFileSizes"); -} - -typedef VOID (*PFLUSH_TO_LSN)(IN PVOID LogHandle,IN LARGE_INTEGER Lsn); - -static struct LogHandle { - PVOID LogHandle; - PFLUSH_TO_LSN FlushToLsnRoutine; - } LogHandle_cache[CACHE_SIZE]; -static int LogHandle_cache_used=0; - -static BOOLEAN LogHandle_set(PVOID LogHandle,PFLUSH_TO_LSN FlushToLsnRoutine) -{ -struct LogHandle *loghandlep; - - for (loghandlep=LogHandle_cache;loghandlepLogHandle==LogHandle) - break; - } - if (loghandlep>=LogHandle_cache+G_N_ELEMENTS(LogHandle_cache)) - return FALSE; - if (loghandlep==LogHandle_cache+LogHandle_cache_used) - LogHandle_cache_used++; - loghandlep->LogHandle=LogHandle; - loghandlep->FlushToLsnRoutine=FlushToLsnRoutine; - return TRUE; -} - -static PFLUSH_TO_LSN LogHandle_find(PVOID LogHandle) -{ -struct LogHandle *loghandlep; - - for (loghandlep=LogHandle_cache;loghandlepLogHandle==LogHandle) - return loghandlep->FlushToLsnRoutine; - } - return NULL; -} - -static VOID TcSetLogHandleForFile_FlushToLsnRoutine(IN PVOID LogHandle,IN LARGE_INTEGER Lsn) -{ -PFLUSH_TO_LSN FlushToLsnRoutine; -int locked; - - DBGSINGLEENTER2("FlushToLsnRoutine: LogHandle=0x%lX,Lsn=0x%lX", - (long)LogHandle,(long)Lsn.QuadPart); - /* Prevent deadlock during display of File Explorer directory listing. */ - locked=unlock_full(); - if ((FlushToLsnRoutine=LogHandle_find(LogHandle))) - (*FlushToLsnRoutine)(LogHandle,Lsn); - lock_full(locked); - DBGSINGLELEAVE0("FlushToLsnRoutine"); -} - -VOID -CcSetLogHandleForFile ( - IN PFILE_OBJECT FileObject, - IN PVOID LogHandle, - IN PFLUSH_TO_LSN FlushToLsnRoutine - ); -VOID -TcSetLogHandleForFile ( - IN PFILE_OBJECT FileObject, - IN PVOID LogHandle, - IN PFLUSH_TO_LSN FlushToLsnRoutine - ) -{ - DBGSINGLEENTER3("CcSetLogHandleForFile: FileObject=0x%lX,LogHandle=0x%lX,FlushToLsnRoutine=0x%lX", - (long)FileObject,(long)LogHandle,(long)FlushToLsnRoutine); - dump_FileObject(FileObject); - if (LogHandle_set(LogHandle,FlushToLsnRoutine)) - FlushToLsnRoutine=TcSetLogHandleForFile_FlushToLsnRoutine; - CcSetLogHandleForFile ( -FileObject, -LogHandle, -FlushToLsnRoutine - ); - DBGSINGLELEAVE0("CcSetLogHandleForFile"); -} - -VOID -CcSetReadAheadGranularity ( - IN PFILE_OBJECT FileObject, - IN ULONG Granularity - ); -VOID -TcSetReadAheadGranularity ( - IN PFILE_OBJECT FileObject, - IN ULONG Granularity - ) -{ - DBGSINGLEENTER2("CcSetReadAheadGranularity: FileObject=0x%lX,Granularity=0x%lX", - (long)FileObject,Granularity); - dump_FileObject(FileObject); - CcSetReadAheadGranularity ( -FileObject, -Granularity - ); - DBGSINGLELEAVE0("CcSetReadAheadGranularity"); -} - -typedef struct _CACHE_UNINITIALIZE_EVENT { - struct _CACHE_UNINITIALIZE_EVENT *Next; - KEVENT Event; - } CACHE_UNINITIALIZE_EVENT,*PCACHE_UNINITIALIZE_EVENT; - -BOOLEAN -CcUninitializeCacheMap ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER TruncateSize OPTIONAL, - IN PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent OPTIONAL - ); -BOOLEAN -TcUninitializeCacheMap ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER TruncateSize OPTIONAL, - IN PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent OPTIONAL - ) -{ -BOOLEAN r; - - DBGSINGLEENTER3("CcUninitializeCacheMap: FileObject=0x%lX,TruncateSize=0x%lX,UninitializeCompleteEvent=0x%lX", - (long)FileObject,(!TruncateSize ? -1 : (long)TruncateSize->QuadPart),(long)UninitializeCompleteEvent); - dump_FileObject(FileObject); - r=CcUninitializeCacheMap ( -FileObject, -TruncateSize, -UninitializeCompleteEvent - ); - dump_FileObject(FileObject); - DBGSINGLELEAVE1("CcUninitializeCacheMap: r=%d",r); - return r; -} - -VOID -CcUnpinData ( - IN PVOID Bcb - ); -VOID -TcUnpinData ( - IN PVOID Bcb - ) -{ - DBGSINGLEENTER1("CcUnpinData: Bcb=0x%lX",(long)Bcb); - CcUnpinData ( -Bcb - ); - DBGSINGLELEAVE0("CcUnpinData"); -} - -VOID -CcUnpinDataForThread ( - IN PVOID Bcb, - IN ERESOURCE_THREAD ResourceThreadId - ); -VOID -TcUnpinDataForThread ( - IN PVOID Bcb, - IN ERESOURCE_THREAD ResourceThreadId - ) -{ - DBGSINGLEENTER2("CcUnpinDataForThread: Bcb=0x%lX,ResourceThreadId=0x%lX", - (long)Bcb,(long)ResourceThreadId); - CcUnpinDataForThread ( -Bcb, -ResourceThreadId - ); - DBGSINGLELEAVE0("CcUnpinDataForThread"); -} - -NTSTATUS -CcWaitForCurrentLazyWriterActivity ( - VOID - ); -NTSTATUS -TcWaitForCurrentLazyWriterActivity ( - VOID - ) -{ -NTSTATUS r; - - DBGSINGLEENTER0("CcWaitForCurrentLazyWriterActivity"); - r=CcWaitForCurrentLazyWriterActivity ( - ); - DBGSINGLELEAVE1("CcWaitForCurrentLazyWriterActivity: r=0x%lX",r); - return r; -} - -BOOLEAN -CcZeroData ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER StartOffset, - IN PLARGE_INTEGER EndOffset, - IN BOOLEAN Wait - ); -BOOLEAN -TcZeroData ( - IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER StartOffset, - IN PLARGE_INTEGER EndOffset, - IN BOOLEAN Wait - ) -{ -BOOLEAN r; - - DBGSINGLEENTER4("CcZeroData: FileObject=0x%lX,StartOffset=0x%lX,EndOffset=0x%lX,Wait=%d", - (long)FileObject, - (!StartOffset ? -1 : (long)StartOffset->QuadPart), - (!EndOffset ? -1 : (long)EndOffset->QuadPart), - Wait); - dump_FileObject(FileObject); - r=CcZeroData ( -FileObject, -StartOffset, -EndOffset, -Wait - ); - DBGSINGLELEAVE1("CcZeroData: r=%d",r); - return r; -} - -BOOLEAN -CcIsThereDirtyData ( - IN PVPB Vpb - ); -BOOLEAN -TcIsThereDirtyData ( - IN PVPB Vpb - ) -{ -BOOLEAN r; - - DBGSINGLEENTER1("CcIsThereDirtyData: Vpb=0x%lX",(long)Vpb); - r=CcIsThereDirtyData ( -Vpb - ); - DBGSINGLELEAVE1("CcIsThereDirtyData: r=%d",r); - return r; -} - -VOID -CcRepinBcb ( - IN PVOID Bcb - ); -VOID -TcRepinBcb ( - IN PVOID Bcb - ) -{ - DBGSINGLEENTER1("CcRepinBcb: Bcb=0x%lX",(long)Bcb); - CcRepinBcb ( -Bcb - ); - DBGSINGLELEAVE0("CcRepinBcb"); -} - -VOID -CcUnpinRepinnedBcb ( - IN PVOID Bcb, - IN BOOLEAN WriteThrough, - OUT PIO_STATUS_BLOCK IoStatus - ); -VOID -TcUnpinRepinnedBcb ( - IN PVOID Bcb, - IN BOOLEAN WriteThrough, - OUT PIO_STATUS_BLOCK IoStatus - ) -{ - DBGSINGLEENTER2("CcUnpinRepinnedBcb: Bcb=0x%lX,WriteThrough=%d", - (long)Bcb,WriteThrough); - CcUnpinRepinnedBcb ( -Bcb, -WriteThrough, -IoStatus - ); - DBGSINGLELEAVE2("CcUnpinRepinnedBcb: IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - (!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); -} diff --git a/src/TraceFS/TraceFS-W32/TraceFS.def b/src/TraceFS/TraceFS-W32/TraceFS.def deleted file mode 100644 index 7418fdf..0000000 --- a/src/TraceFS/TraceFS-W32/TraceFS.def +++ /dev/null @@ -1,58 +0,0 @@ -; $Id$ -; Exports definition file for W32 build of TraceFS by build.exe -; Copyright (C) 2003 Jan Kratochvil -; -; This program is free software; you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation; exactly version 2 of June 1991 is required -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program; if not, write to the Free Software -; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -EXPORTS - ToRegisterFileSystem - - TsCreateSystemThread - TwClose - - TcCanIWrite - TcCopyRead - TcCopyWrite - TcDeferWrite - TcFastCopyRead - TcFastCopyWrite - TcFlushCache - TcGetDirtyPages - TcInitializeCacheMap - TcMapData - TcMdlRead - TcMdlReadComplete - TcMdlWriteAbort - TcMdlWriteComplete - TcPinMappedData - TcPinRead - TcPrepareMdlWrite - TcPreparePinWrite - TcPurgeCacheSection - TcRemapBcb - TcSetAdditionalCacheAttributes - TcSetBcbOwnerPointer - TcSetDirtyPinnedData - TcSetFileSizes - TcSetLogHandleForFile - TcSetReadAheadGranularity - TcUninitializeCacheMap - TcUnpinData - TcUnpinDataForThread - TcWaitForCurrentLazyWriterActivity - TcZeroData - TcIsThereDirtyData - TcRepinBcb - TcUnpinRepinnedBcb diff --git a/src/TraceFS/TraceFS-W32/TraceFS.reg b/src/TraceFS/TraceFS-W32/TraceFS.reg deleted file mode 100644 index 5ed5cf5..0000000 --- a/src/TraceFS/TraceFS-W32/TraceFS.reg +++ /dev/null @@ -1,28 +0,0 @@ -Windows Registry Editor Version 5.00 - - -; $Id$ -; Registry settings to load C:\Windows\System32\Drivers\TraceFS.sys -; Copyright (C) 2003 Jan Kratochvil -; -; This program is free software; you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation; exactly version 2 of June 1991 is required -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program; if not, write to the Free Software -; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TraceFS] -"ErrorControl"=dword:00000001 -"Group"="Base" -"Start"=dword:00000000 -"Tag"=dword:00000001 -"Type"=dword:00000001 - diff --git a/src/TraceFS/TraceFS-W32/TraceFS.sys b/src/TraceFS/TraceFS-W32/TraceFS.sys deleted file mode 100644 index 5b8075fd74d2b6c85cae026b9cf0f0293cd36f80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 63872 zcmeIb3s_ZE`aix=Dl`o$EGjLUv@97r_xnXa2o#X3+7%IwLLv|xyrre0C7v!;PFY!5 zq}kmmGp)RJ)5@Brsm5t)va(vHV@_YEoQcNY=Uw}9);AEf`9IG=_u^%*+q>S+ zdM|tJz1J?hVwu!elB7f&M~_Omm~mOj0)CNOf~!2Uy(rr#QK(Y?2h$bUP0 zDzkM73J>%_L@Owg11^+!WDae19)>YS1ok$Lgb0n!C;Y4Zby*qts-X7_c zgp(6alBDI5G=H*uwqYNB)4-R}-wD!uq;#ABT0QWmH2+^nP_F(^0&?gFl1ic9NceB% z*Ir3F7g?*mlceF4-ObPZ?ZAO|FZE}XB;}2ii%EM+aQ03drOI#oQh!EC($0|q zxgd>Qf(+&>ztuAIdldfX7v+}|{mh9d!$1HI{+muJKk1V6<;dnhePgvG9fXWXR#JcE zw^|6lM@dqa@aL~0D?$fqEzc)NM+c=YOOO_C3npC)ItBEO6IS6o{p>iwpio!8hVtyY zkR&yKP%S2mRh(eRNPd+PXGD>0~heNZzn>@msB0g`Ethg==@iCzJV9JL|Lm{P199);G!0 z844a{PIcYwDyk?bkkDz{fuy#1Nm8(1C?~0HR-)8;(#BDV5Wu`0IY-i;1J8v=-b}bC zRB@yYY*!pXsZd^GdtvAPexZuawpaVKS9IcB@{7{FBVPUEkx*e$s3h^$#4Kk{XG{8m zc}E6g*v)o-kyWX=t|nid;R+AR}-bM zbaw3`JcnJScXm!#sOgOVWP;@U%y+QaXEMdV?SY$h_> zUe90`{O9OV^IMoWTSJ2=o8-s|^R~s?T32(4C55sa9ZP72ko=N%WH}b~Pmp+l&(#8+ zjwYdir*cqafl(dHg#x3#IwP{c=#E#=zuLv<$!U=V@;Wkv7V^G2E3!aA$55d_!Hwrc z7AWr6C3I0dWJqLz@{UCD#M-~Wn3>R7m zUOghRz^smRp}?$9G9nAi?MS&ZEQh(1M@AG_I3KgVqrX&w2)5RX^AXG4yEdM-4WSrG$BW<(}gkT`? z&S7|xQZ^eR2<3DZvk{1mLIb(j_a(G*f_45R@)xQ&T+061CUAIJn8Q5ca3eB_!y1f> z3w|@ZoJbOUM+iN_LnR3wid-rDXgHo=bJ2nlZ3r<#7f}WI0ii@MqlzJDUXCgTQdH5m zFsYpr%A^24CG1}dRThpFP(Zj{#ZBFW5|A>+FNQD2_Rr*w$4$OAP#yGA>_I-6etMjL zLLENkTPJ;M_uYgc zv1Mol)3$9+s?^$VM^5Ka{OljVL#I@PM?7TeqzN1?96OQ#jay9{DV7<8_k31x-*Pgpxx&bk;TtT%Bazw(oaTi1QH2N`z9i z%{wBsCYrbHzY#2_!M7m9E9`9Bo`h&GH0VQEx?2-JqVp8norSE>sqTuT;K?)@@)F&J zM_T*r@3Vi`f_a@}|C^~LYh=CFXbql?*6lug(>QSB}0F*FBNg zcnFy^ys^XvUDv#@Ponnj@4mfevAz4k?X9Br#wqRnjQUD@>k`o3Sp5AG2x;*L!Amfp z@yfSbNTa{U`0nIj|Sas-cKd0#^1w zG5hX%VO$KQRQVnvM&3j&4Xl|MftycWJPUT4M46Ycq>#;@$E4s1`%=LY7uSIHoV^R? z?KMdKq?rbV2+j=^?p?4i3Fq1i_qNU3o0fd@T^K^BVsG+>g-@gI(V>g)#V?dkPe8>X z3K5(Nq8!zN1t4Z|V*gbjM{UEoOZS)T$T{pufk_?*Vj>Z_AnJ+mf|yT)1;h#>Mu1pH z#BV_CB;qU(dx=N^(Mbg4bU5WyjC$`uVH(KzBf2SOTjmI|N<~RkR%ul0KID?Da=%yR z;){yiPLjSqJwZBxBLTzgk7E=LDN+BEfIs`-=o`Mmhm?A@?_I^Ol|`9_Iio9!^NT5z zFW&_;A<`{v&f+HOap&L{fK9zmq3g|_cwe2RX22$J21OcKoq2$s+1?ymcl z(DqK~D}}aW;qi5$EnV)bq3wedQBY`Gj4(Dbv^`(P9}jIMk;BulRG@H}29kX?OXjd0 z^*D!{*$qT?7us@=NVq-9HUgi5ab+Bn9_vKlL3N@r$T|QFyhwByoQpwd7&Kw6Lm6QZ zB>Q=$Ji^CNt2Y>&@^2Y~9fu<@pcNGrgR_yzG1x_5L|k4xuwUelV=xy?XdJEybGVi` zyjfJPW%te5C(VXOilcUL9)5X zBo!D=BkF1COHqN_abZO&koSKP;-~d0Rs8qEopSLP5)KjKKUc>e7ymD<0*Aw})}>64 z;UL*3$RrMLLOn$Vt|zj46^K#(Ji;RYVvxTQ6-EM(wU6dM5*+~Niowzi&XCqUd|Aa&Y01q&cKY9LxiSYanbGVi`yjBlO05QrRp>65qmH9=v<4OxN%MofGhkuA_Bic5t`4-qbj6{dc!WLoVhtAfp zISi6jB9pK=nTFd7@OR*|8H^2{bYzzca1U3me{x~*!ngtF`SjJUm zj{_vzj7;LN4)qk}xQ58?l>;6kMttZ(pbK+W*P%n};3_(M;9WU7cM?ny=v03#^2gE15;=T7%;9e0 z@H~aXcTi73XB&|b=){PJJlAtFWAzzoy=dWw_CokKA<+qcYLg)Rbgcd>6K^O;HX4~E z{6nbK8{toYAtKdCfqZqsr+W;l@T=irx$p-8qDbL?^OeXS7ycWK0*9A}IlPKEd<2=q zVUfz=W|mE4gz%3~AGq{m@E0`yb26hPe<}vW2IxkHp!M$!!njtQr%C=%knC+_(zs@z zR&ON#88=3q>~45?o#g4}jVk$l@Tgq!_Y(vW)4u-8D9Mi%Is9{&!`;N;aD~GUQBRrn zZxI`$(4XTYG z*)n93AUqIYZ=mYnwyKj|1^2Imif&q}P(2HG%b}_w%px?$q~ni6b*jkWFJTU)3&7#Q zYh@1aLp?=vZYNR?6=6d^J<3&ojYsyU8+4A*j{dr@>vp2iasCbHSdi$@8HC|!VP-Mz z_j~UoqrIiM<9!r@lbQ;=FuWEV&gJ~7y~(K+MuvvUOH>9KBv-stK^Lvh_- z07X3#9TbHD0SW^i7*VFA1thx!nFPhhsMQ-g=7nVa&FZ+Ss}s)9Z>XmkP6f) zxN8nnDIpdC)CD^JI8c2=4hP`TB4sM2fMlOfmN^Weo}x4JiHra$Mtv#Et0*5mZi2kb z5`(U&^`eD8_G1V?7l}^z7lC`tmrlyihE@ZTB`QN(hg!W6{+TdAq$TeoI?xH99=%e9 ze*rSN@IN9HB80!@BauHY{KZuQhxdj#TuB^GMkY;XA_Mm*$e z@Uooj3OxF9IpByvC-ilrVL1PNz%Uqz4u)T@6b3opqz!TrNcIUbx&EV8Z&c&&+%k2t zHE`=X80d*u6^4JojdB>CBs?NunEMBjKMuo{B8OYU9Bv~H9SVngQBQ&4FGNPbpqi&x z{RLff3uwfIhgdfnjl13h8n+?Qq0xASfJTZ%Ln9R=D?lcpaRjw`gGMDx4=F_&1g=Aa z9z0Xgmz4hzE^788e0Ad@&8uX4DVjU}=>G-CGO#p5RA zl#-Q-K`(fnXaG*b*w{eb0I~dgaH250RaOmvM?tc8kV(UviCVn@;BVX-b+UWl;B^4d zBi$+h-@&1B09Fzb5$Z5~R}=sRB8MM`IowSgUaWBV5$Y-G@HUa%0uZBp(my;Gn|;#P zjRs`FI{;)Z5}ig|JwX5@9nZ8Y@ySq-%!Nz>|L``nJd)*NB(L3mjI4Ih;fsu0SSnI9la!GjkHz9Uw8{pvJT! zy3ug_@D||sI}#ln?^OtcUFXo?SPzmtiA);o1PG}&aBSg*sguowm)F5TFDa;SybZ6) z;h0OfMCeDMjz11ZhRET;Fo%bT!+r{fFQA^HA5Re39UQUx3)u&kRE#T^ZxO~~r-ZuE zXw>Wk8kIC^>nH-IS z1WN=OTX%^3aWo#p6RKKVJ2%YXeB$tWWD7$<9y$(A@Lzdb{8^foPNlsH%P4E=BblaB9hS|L9g4WNIVC}%8{rc zNFtE1>iFYGq>3E&_h=jr0LlJQB6Iiv>M440Cy`M|#Au(2i(`~>d+lr(eeO|{&xddM8r4p=2*CoQYOT`W^^oKhf4w{{;boe5w@ea4J zr--CCi`JO8UH$4{n%+IzY~|j>6*IHz8(RX}1#@rYr_^z!Pi~yr+7je=U>AWPUbCs` zZA`1R(NxvaLe=mDKD+Eyh(8NSSp1O11x14J4Wl&Wuz+L|GD-GNp;iydv0z>jNxgMa zh2EYQg>eJj>Nr%nbe*i#Tzhz$k+dZk?mKA?LQG7 z%~RC8NooFXs3nhv{fS6Yq}6zF1~wvNS%Rc{(?`}R4tOsy&#um{YRI3^To=Sk(2?(4 zWzg#`E#-|oTY2GSLRDSRJFF(7G!Sf_UDq%bbZ>Fi_0`NP0_hTV)iyvq0SQ5!ydfvG zIC(>13SNsEKyOGDvylY?4Cz^d0)S@ykxMXaKm%Mj>!USprTl6XLb#=9eW}>^XL#{t zNluj6+qqSo3&|TQj+U}DD5_cJJJGjdnU@nAZO9}xE+sbT*}hlUP?e)cmZAf^la(UB zG#Dd3jZL#lxs{88ho9)~ZKMnpsjSv1Q`8sXxNi4GuYr};FF}>T-=U=@BV z(;<91zhO#a^K|*8D)A-J6gGDY@STZ-zf*&^;*K1}&;BI5${E5NW=F2YOA=|N9QY82 z=7@~DZHyrAZP{VmcYIccy0sW34qfJ=U%n0+TQZA-V)>-EoLiGR0H+~ftUHj%Piy)FGE#cUS?+zNj~CX1=Lgl)Y$MG9e_4> z2WW9)i#`s@pqJdR&5TjeSLIKW@@E$YUT@fYhjo}I*?BL02^cR%0;QJqE)=PEm*)y1 zeE%}dnC=G2Y{(=Deu*ZyF@3J9cf?oFd*IB8NNZ`uVBnYrt&YI-R5TRnhX1}v1QbEV zdw9`NLvvc5#!5X%_9QZil?f^9x{`p@8f|$5yC6jVW@2y;7$eHLX?n!h9V=nK4?_6*PV(TuNchVdG1utA5rW$ z?E9(M4FGv5SFlY*#i4#jR~`#4w~J9Tw>p$vL9l1dk#euM=-zWLIf z%J*!;BPU2~bA$IOtMrQ-fbw%lNI+4-4`m5L+BP<9oOgm|Q;|zTI{igOaW+J|>Ib>2 zu1Cle)%ZkIk3@F3!ifqO>nC#HDhR{m0nNV7lsUKq)s$HMCL$?NdsGX|luObW@u_cZ zspb0$;5szc9SAadM2|;nz1C-ekK@+n6!wSp!1-+?s(Y68Mh(`WHrOpei{Y>n6!tEl zEd=3h^-%vBVN2L5FB0C z9Gp$Arp1+B&^R@(s-dP{Sy#!>@^s5BJ%<^+naA1H5gq50mX0fRrI+i^S4Q?<*~*s; z0DCX}UPL$gSMHM7AAV2sA4!*XuEQ%#0YhV8nCE6zIy%C2ttC8_N%P zwLP0nR{GJbShm>y^JtUL;^Nwk)O@na{HjUSV`THGvK~5 zuodYYsV=k>6KTObUZV9RxoVVUeQ%u@9^rlWQuee*7P(HALeQju_Xu}IOQ3C$Q+UlV8v7PK@d5pPjortWVwK2~S2 zNuI1d@}@jf7|9!Vlx+tFu+X!ZLpLF5o0leR0|OhHMwSIOR5mzj=uwdx>H~08i!0lw zBwV6WL~@witsINUmn(;5+nVMUK-pFrwyirsv%@YKl~v$^Y-{r3X=H-r#a%J9N?u&3 z+Sl(9xP%JR5ngp2O&{emEHa#a@ELKwAe_DtU2Ea=BuqwS4%dKWS1EiY5ntqex3XW* zfE-TKJQ*y-G(R${uWPMq4&*jA7gWue-Cc~NfUHabWnqK^-5Z>{>_fPwrR{xak$w5o zfck6kCf07N6MXAeH5GDvLV0_~?_w#y;#m0uAyYXzX$ zTI3RA<-{1N^~)@uNacF=CxT7f4@=hW-syK~0Ls)7$Zc+%-fI8}xZdE_RojY=LKQh= zUpxsZeu_l3z$9J1GgD^>@ymLMHOOm*W-H7-^AF<>LToHHdB9WOs6T%=Rf@XacW}Zbg4$>C(D3Jux8hum{ z3qIkwPiv5wwOubn{sGXIZ2kHY zfUxJ_$h*+50jhrWL4Kru-S)W3U|7HE(Y0n09|tpPkyeEkaj%C63Ds0-Fr z)z{4lsGHMu6XTSjNK3|VeVO&xZJDpL(;3C5{nkgA>Q0PDqcx+kbF{ceSw?YPLuPe# zprwTt^|Pz$>nCG3w3ZCb_$o8um~)_O#+9HwY&EoY(`80~UAtXb^#4Y?VScrV{NLtR zYq*#EDlukPVpeo4gP;K)%rQ}6$uDFm%mF`4Og`Mq%X(+b96+$c$%w;1V74;Su zI^t@bN#^!c%{`@oWLZj!2T_%~ zrjNh3`W7+lya6Tbbg{(-G$VVX(%L3!^81nUxbLSX$(w9aWxiCr1=b&p z@C6nM4V4f^+dOsaBcgB+hO9!Pnq1x#y4*=!&Q-b`u6DVF4N(X5D1{-o@j*9zvB0qo zm#f%k5}3^pY6rk3YsFw&x{=#w4}pC51`{v=>tz7LwcZQi%YE1B6>M z$FY8b-9^dhc4Nf5-8@p<$&`#FetHw*W>;(d@!Pan)sq#EpkMjrYfdTbAFE(74j@r2 zfO-k4-HN64F7*~EnE_1OXEFrDo2s;FI}0QWA(OP<{;)D_S9NvOauc^Bw;}TC?&6Xy zMMHEWKH_r4&zTi(#Ugg+w_IVxx^2w@0cfp1lr z8I55Fa%l`L=!+|JJF6v<8?$M!S^7J%GCIe=M_IoBJ~j1Z`(vFCm;=4UUu_>9W!F~K zsS6#yVh#A62Qf?DM54};h&5n2n3Go{Xk`KhcH`sDNKVv4-<61CPVFTH4U zChYjw#*2j!eM=)!>_4LsEk`bmXcSnWDU-ao0rP|z=}$gwO3Bs9_U^dmOLpV*rusma zPvz)=#zetSOmjtTn+Fo?vz1_cHxeyISMP|wFkBG9xJWoa$|F_3$2Zoey?R8ZdaCk_5G0iHAtc)@4iToykTls@($4KOyrW}Uqe+s=pH10 zHli|3@(xtgOMcIN;oiCAw_hmqd>i$wO#5Zj^8?7Gp7W_^`6|e#GNDO6=K0R$qE5;# zL>{%m`)e^!`{FQ^u)p3596m5*5nc1UTNk`iwo;ivc@8gMIjys+O&T@ZxgfqH~XV1SIa1TZj3*3J@Ux0g5 zy#{w4NcJ)^3GS(A^jL6jK{(TGJWIWF5zjXMj+p(m@$5O`5S|C$s+HbIWB4gu9zzHE zl4k&0LF9iWo-J+;G~rVUFu~p3ZHY41q6L7~_s(BN^`kfXzvh9|{dZy3e1k-tHJu37 zj%p92b}E|39}ZOF+b7Nw=1g%z*xpVA&2B<2O&Zg3S<0yb+%ngkYT3Muhz3H|x&;#&n*sQGctpNuO4&5g8n8SP18 znpffedt+xd-GLdi9*H_*qTEW?k1)3k5rn*~DJA78FbSOHbm2i}tcIl1WiqaWWFw?rJAINbx*R z;~f%h$>;RzG=rH2k}X9h4Z=o)pa5ej8=;Ix_ZTy7>?%Jo`k&TjJo8B3ZBd@C`maA` zl~K`97qtja>*Kw*Rna`stkR;AIk#i_v?A$d`lt_8Y3sD|LsbX@a1&X5q?MkjqBRYy z$P7M50AyRU2FOm3>|bZgfUHJ;9FWCbtjHuUo=O*}bm>0*ulU{!`vKui)Wh)^=!a$% zJ$;qSi@k$lk-_Q8+r;2h4p!!X32n+uYtcBY2gxQV9QIW?e1#oB8(ak<-jz_V-+I(- zZLOs=Fuke?OJMlEinx1j`-z; zP4$yNvFTq~AedQGgL_ns4OR7A4>NpmXV8CwBM_b;vcPw00MDSg3UPFI3}zZ(#?C)D|iTfSBd4-U{!^K52Qs z_D(v$!%wemm)5Tq6a;Ptc9W3kvD5C};%2CPmsXB7wY#?wcXfs51jQ!>>Gmz~{^2wM z??ZFKcpm}H-a{_oJqKJ6-ttp|QJ5z$9!J3fMIP@gqd-(qzY(WLtKaQ6MNEJuk%J}I zYwC9kNLHvY@GsO-)bAjXT>WUF>bUUNo>|6Yfh6}X+>};C(aBtTdcM37s;PUfnSF!BHv)C>MYlOP^f(k*f}1cYlqW2L$>O!+ zQHYLSbh4sw%cE^LI5tA$2A_94cq zUG*W`gXs$ZdM%PD&~pX~!cAEa20aZlJ0H0u-FH#72hcg#LkUaue%mrslx@1Y$HaH@ z!@YA@-x(nEd_DE7EC$V`o*zRl^;||h6PR0Ap2~!F*GIj&kJVpyb@AN=80F3QoF#4i z5q{=PS5vuNnll4HYiRXiUTB!w4f4}4;syD!bXCAa zsV{4e`3A^;B$Dv3_-r32j%xm*@TeAnX8Zcdqxu~x@=(+jcMfqT%MJ^wO5)95mc!A-DtwZHXJRDtJsy^iI%h4svM{T?ofTmk60fPTes= zx7B&tfn-0OC_~VJTCzYC0l%tz ziJs%Kn%#~@cqB&eS+{97n|I9-JEKcS_9R-=rv0*TcPps7B}#V|wL9$pP9(`6Z-CK5 zb+3iJL#+OR*8978ppI|*q}0&+&m~bHe=zwtoP7aW-Ih4oTa*6yXI} z*!~p0iHYhG)aQ-x%pt9^6IjX`F70Zfyt{SP34%DcEfF*bG;<)AG-xk+<47Ijy;wV9 ztf<{AHldL&Za*HHC1NW-9QR(Lz>TFnY(5>J*%QbmZpITgvQrqVGN$fkp=@lUfE=5C z<+qgA2ATtWeM821e3SAFBUGz*@m6#j8g?b@mzhBB2$HY@aj)^`zQV9qEe#KQEok;U za%tF=5LnM%qXGhgr1g$tiLO7)0Bi>{MeJ}tb*RMj2dKj=rNe`$$x(lqeMKb2(H)BO zl^w`2ZH*S|mImNI;Vgs|zh28!tt)$jjWZy`=aEDR@y|Ymtd~0GkX6??8+~6HHy0Gt911&s`0My{u7aU*LxiHpZi}f3@qpAWtqWO zwBdRiTc_5Bm$Z8~XQSIa?k6^r*jcTBCl!eb4>VixuZJ*QG}Arm*6^&$1I;LyBZOw5 zE|=9NWkpZ-WadM(Xt7kip1`fk2(0c4hV5eKQT*V!?!pxQASPC^y0n)nqw>n+kz$r7 z@_9e;sa%4rB0ljz6X)}N^u*x}u{Vh1_o5roqw-YK(P4?p@Tu)#19&=|rv{!{cI+~|>JT2g9F;B~RI+3SW@pKYTYj|4A(|VpZ@ifTOSv;M~)A>AI#M31_y@jXC zc)FaYD|ot+r>l7SC{Ne&^eLXM&^3S6El5{tYM{sP!@g9y(aU8*sazK(yIL6?Z zjAIUtML6!nu?ojCIJV$;AIFzCe!!9VcS#zIV>k{AjyxP!;Aq0J5XWse9>K8z$1WV7 z;ONAWdQg%waQJYH$I*=A7998Ccn-&I9N*yR#L@qIg?Z)I)O&aOh=kTk*f>F&bccN8 z-H{+!a16$gh~p4OonKm9Sy)s#7GHqLDX7fOEGUrFa|PovM^_3TK~m3;&neB%yvqvfoZHo33h{d~J2@w5#gO4x4&@WK+##>g|8~LodS6t1I-b3B4T> z|A|W=E`hiN;u45UATEKp1mY5iOCT? zmLxqsT9RJOm81u;z3P%Nl5`#R&KzHaqXc_zUL#4Dgs|r)_N=_3Mv}%(k)$`KN>V|c zBn_H|eL<&7lB-dY>aUZeCtD<`t`&QN-hzEUXQI7Xl62x6N!oTj^5#j>%L}moXPYGb za}o9(y-AV=+$Kr;ZkD8mc1gMxTTxHOCZAu7lB6}@>p2{oalD1&V;o=O_$Q7&-$>GF zI4;8B!Z8|05spbXnsBt?xC_SvIG)9^9mhvF_Tbo$qyM*(bRG^1j%*y4<7mOL6vy2- zp2V>Q#}_yb;7DMSbOsKRU>~Wklqj7bohY3oB}x6H{?f_P0BN9fij*v+NT*7tNvBJx z(je&!=}ak2I!iiRI!78T4Ux{3&Xdxm^QGTN7f3@TWqZ((HTCsUd3APGLq6XjnCQl) z+4M;eg;YYrLReWHkefDesarhXBuYHFYbf9FSiz>-czY^{w` z_;fdIvQ1P?y~2<}sUJm`^LVeBlN+0Z!rwv>d_Oh(8E_QA-%4{4AMT|*`IEsYqK>6F z@`ITurG9{slk&dRAba}kpPY?7nZ>Wz$tNQ|mnNUozQHB`8Tq*;`D|AoZb430p9kTm z!KotA=r1*>1%&ORaq3uK06-CS6MCtl<4FG@buH`ss0>Yh@4e(am);0?j!M!Df76M;=P^?Bc2*w#%lkZAe4&Yh3B7 z+Ei!ENH>nOr<)80^Q8vIrABkQ!Qrx)To!wJOD(2idd{q-^r1Ao9{bjHD)-Z4d1dc^ zT{ZC|plt_|*v)6r{{NIbjYQqOTK-}ad-iPlgz8PJksckCge{AUYv;4@4%SORv&qP% zowiRwS-yky26?~pZNj(p9%RM3#%p&`&5>fe3H!o3cqf8p{grk%pr*WU{H^$0C};3D zl+tJ0jt-K*6utzd-(vl%G~Gz(BT%nCDvZG-^kt#G9z-sUVT{_>E6h)%{JB1SXo`Qa zZRdC437Ag%J}(RZEmHq~-pAUJkl!dP;po7Ox@xGMK^i@IYH@R2LlE8$xv z8><5?Ez-{kV*}x{irPvCa5k%TYIbd)8a{Wtlrt-A%hj*D6x0RL!;n5>0|kMq8G&qk zu&S=Q3if*{zRD`uQ75zdy4Jd8e0Ej-98AuvYIqB%o?P=s^Z^|VG)L5&gPNrQO#c?G zCaH{wl|I)rEBuN+J{4u?rbO}mnjt@~65RMFB z5Oa~d&>tj#9qaK|#b6d(GdO|7rfWxsN5ua=K-Rxw; zO2<=<*BpOxeCPPL<5cJQPKPtkS?O$a-sHU7`J{8b^N-FyJ3n=P>0Il2#`U~wlj{T5 zUtK4;f8!qE9^)={SGccqKj2>Le$Ktoz197O`$P99?mh1P?ti#D-6whmcm{b!c&r|` zC)YF9Q|`IOQ|p=TY4ObVG^5hbFN2()H@{^5 z!Ths1(K66-hUGlS(P(j5vMp0B(=9EQ*_L}P4_F?ythPLEX|uLlZ?i79K5gA#{nGl2 z^+ek++X$P%X0x4SA80?#o@O`NUG^#V1@@)($L-JB*V|vR-{iQ(afjm`$2!L*$JY+Y z+0QxLInrr%I-MuE2D(mjrMZkQmure^forMjao4l1^{$s(9qz~7&$!pS-*tcN?&BHa zxzLjXNfdj=dosP3c?-Oy-f57;D(}nQ*S%kP_jwO`4|})xUiZD_`-6}9{^1+qcla~? zll)Ws)BM-@aX}#sfJ__)pCQ|jZ!)n(1LHd>cj z@3KB;-Durxea+fod))SnZN2SX+sC#(_96BQ?K$?b_G0^Zd!eJuF%dIprei+l&ko1? zj_)1+#0-+0yPbb?e&yWf?BhDwWp|aju5`_D&37$!gwR5tw*15pB)VTqg^ojFd&ZEvmSAW;nuKlhbNfARn5@1&1sjFP0i_|?adWawi|G7dDJZp<)RjakMq z#xi4*afWfOaiQ@Eu37O^oyylxu5xb^Tp=z=1TL8=EbmB%go;*ddCK#;XP4(k&ruJJc(`|@ z_xHXReVbtsJ_Y_4`7ia~=$A+P4aWEjjjVgHXk(a|54^nB+<&J3r?Io4V3T;{yj zxyiZJ`G)fy=O0~vc75jh%GK#Q!R>Tsy03B9xUY3Lxo7!q@GbH!^*x3e&3r%k&i1GK zFZ5^l^ZnEPE&kaU-Aey9|C|1IfZ{>FG)czqG(N+J8Y&I7hQ)@E;SOm14#RH47lxk= zCmB^jwTrfZ06BF0wju5&MRhup8g1N;Yi-OrQkxy)M#>o(DQop+A+ zS?@+~e_x944Buei_5KC^oBg-?*I>4O>fh^^5S!ssGg6_U%y2nI_?&U0af|VF~VVhu-a9gI?wH%6`mJ7FMGCm-t>In-R=DhHoMb%g6~pau5X;L z-q#EtHV^Z4C#?5A-#>kwzLWeZ{{8-c_U^jqY}Ofu^9)xTrWo1`?S|V7%Q=>x z8}=B#F&;4fU_9BBYOGV`+HNoR-fCK>ATD~$yeuF49oPH?<+{*d*8YK zq5ez!2EWbk@n`w-{6+q9{}tS))%%sNhFS8R{}A+@t``Smu6zn_x7WZ72Mm%a(UfEwV8Y2g_~sCPJ>*=CxaIfGw_tDg bJAcBM`nvkLEH000G#^zX@I|rz$ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# We are named 'makeFile' to prevent being used on UNIX system. - - -!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/src/TraceFS/checktrace.pl b/src/TraceFS/checktrace.pl deleted file mode 100755 index 61c63e8..0000000 --- a/src/TraceFS/checktrace.pl +++ /dev/null @@ -1,1424 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# Checks assumptions on Cc* (Cache Manager) behaviour by reading TraceFS log -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use strict; -use warnings; -use Data::Dumper; -use Carp qw(cluck confess); - - -my $filter=0; -$Data::Dumper::Sortkeys=1; -my $ntfs_blocksize=0x200; - -# $Object->{"by"}="CcSomeFunction"; -# $Object->{"line_enter"}=123; -# $Object->{"line_leave"}=124; -# $Object->{"ProcessThread"}="0x12345678/0x12345678"; -# $Object->{"data"}[dataline]{"FileObject"}="0x12345678"; -# $Object->{"data"}[dataline]{"FileName"}="\filename" or undef() if NULL; -# $Object->{"data"}[dataline]{"Flags"}="0x40100"; -# $Object->{"data"}[dataline]{"SectionObjectPointer"}="0x12345678"; -# $Object->{"data"}[dataline]{"SharedCacheMap"}="0x12345678"; -# $FileObject{$FileObject}{"FileObject"}="0x12345678"; -# $FileObject{$FileObject}{"SectionObjectPointer"}="0x12345678"; -# $SectionObjectPointer{$SectionObjectPointer}{"SectionObjectPointer"}="0x12345678"; -# $SectionObjectPointer{$SectionObjectPointer}{"SharedCacheMap"}="0x12345678"; -# $SharedCacheMap{$SharedCacheMap}{"SharedCacheMap"}="0x12345678"; -# $SharedCacheMap{$SharedCacheMap}{"SectionObjectPointer"}="0x12345678"; -# $SharedCacheMap{$SharedCacheMap}{"AllocationSize"}="0x12345"; -# $SharedCacheMap{$SharedCacheMap}{"FileSize"}="0x12345"; -# $SharedCacheMap{$SharedCacheMap}{"ref_count"}=1; -# $SharedCacheMap{$SharedCacheMap}{"map"}="0x12345678" (Bcb); -# $SharedCacheMap{$SharedCacheMap}{"pin"}{"0x1000"}="0x12345678" (Bcb) if !Bcb->{"OwnerPointer"}; -# $SharedCacheMap{$SharedCacheMap}{"PinAccess"}=0 or 1; -# $SharedCacheMap{$SharedCacheMap}{"LogHandle"}="0x12345678" optional; -# $SharedCacheMap{$SharedCacheMap}{"AcquireForLazyWrite"}=0; # count -# $SharedCacheMap{$SharedCacheMap}{"in_memory"}{"0x4000"}=1; # mapped page? -# $SharedCacheMap{$SharedCacheMap}{"Buffer"}="0x12345678"; -# $LogHandle{$LogHandle}{"LogHandle"}="0x12345678"; -# $Bcb{$Bcb}{"Bcb"}="0x12345678"; -# $Bcb{$Bcb}{"SharedCacheMap"}="0x12345678"; -# $Bcb{$Bcb}{"type"}="pin" or "map"; -# $Bcb{$Bcb}{"ref_count"}=1; -# $Bcb{$Bcb}{"FileOffset"}="0x1000" if {"type"} eq "pin"; -# $Bcb{$Bcb}{"Buffer"}="0x12345678"; # PAGE_SIZE-aligned for "pin", FileOffset_0-aligned for "map" -# $Bcb{$Bcb}{"OwnerPointer"}="0x12345678" optional; -# $Bcb{$Bcb}{"Lsn"}="0x12345678" optional; -# $Bcb{$Bcb}{"dirty"}=1 optional; -# $MdlChain{$MdlChain}{"MdlChain"}="0x12345678"; -# $MdlChain{$MdlChain}{"FileObject"}="0x12345678"; -# $MdlChain{$MdlChain}{"FileOffset"}="0x5000"; -# $MdlChain{$MdlChain}{"Length"}="0x9000"; - -my %FileObject; -my %LogHandle; -my %SectionObjectPointer; -my %SharedCacheMap; -my %Bcb; -my %MdlChain; -my %LastLeave; # $ProcessThread=>[$Object,$Object,...] -my $LastLeave; # ref copy of the last item for the current $ProcessThread -my $ProcessThread; -my %EnterLeave; -my $EnterLeave; # ref copy of the list for the current $ProcessThread - -END { - print Data::Dumper->Dump([\%FileObject,\%SectionObjectPointer,\%SharedCacheMap,\%Bcb], - [qw(%FileObject %SectionObjectPointer %SharedCacheMap %Bcb)]) if !$filter; - } - -my $Object; - -sub tohex($) -{ -my($num)=@_; - - return sprintf("0x%X",$num); -} - -sub FObject($) -{ -my($FileObject)=@_; - - my $FObject=$FileObject{$FileObject}; - if (!$FObject) { - my($package,$filename,$line,$subroutine)=caller 0; - warn "Non-existent FileObject $FileObject by line $line"; - } - return $FObject; -} - -sub delete_FObject($) -{ -my($FObject)=@_; - - my $FileObject=$FObject->{"FileObject"}; - delete $FileObject{$FileObject}; -} - -sub SObject($) -{ -my($SectionObjectPointer)=@_; - - my $SObject=$SectionObjectPointer{$SectionObjectPointer}; - if (!$SObject) { - my($package,$filename,$line,$subroutine)=caller 0; - warn "Non-existent SectionObjectPointer $SectionObjectPointer by line $line" - } - return $SObject; -} - -sub SObject_from_FileObject($) -{ -my($FileObject)=@_; - - return if !(my $FObject=FObject $FileObject); - my $SObject=SObject $FObject->{"SectionObjectPointer"}; - if (!$SObject) { - my($package,$filename,$line,$subroutine)=caller 0; - warn "by line $line"; - } - return $SObject; -} - -sub delete_CObject($) -{ -my($CObject)=@_; - - my $SharedCacheMap=$CObject->{"SharedCacheMap"}; - do { warn "Trailing map $_ of SharedCacheMap $SharedCacheMap during its deletion" if $_; } for ($CObject->{"map"}); - do { warn "Trailing pin $_ of SharedCacheMap $SharedCacheMap during its deletion" if $_; } for (values(%{$CObject->{"pin"}})); - if (my $LogHandle=$CObject->{"LogHandle"}) { - do { warn "INTERNAL: Missing LogHandle $LogHandle for SharedCacheMap $SharedCacheMap"; return; } - if !(my $LObject=$LogHandle{$LogHandle}); - # Do not delete $LogHandle as it may be used by many SharedCacheMap-s - } - warn "ref_count=".$CObject->{"ref_count"}." of SharedCacheMap $SharedCacheMap during its deletion" - if $CObject->{"ref_count"}; - delete $SharedCacheMap{$SharedCacheMap}; -} - -sub CObject($) -{ -my($SharedCacheMap)=@_; - - my $CObject=$SharedCacheMap{$SharedCacheMap}; - if (!$CObject) { - my($package,$filename,$line,$subroutine)=caller 0; - warn "Non-existent SharedCacheMap $SharedCacheMap by line $line"; - } - return $CObject; -} - -sub CObject_from_FileObject($) -{ -my($FileObject)=@_; - - return if !(my $SObject=SObject_from_FileObject $FileObject); - return if !(my $CObject=CObject $SObject->{"SharedCacheMap"}); - return $CObject; -} - -sub SharedCacheMap_valid($) -{ -my($SharedCacheMap)=@_; - - cluck if !defined $SharedCacheMap; - return 0 if "0x".("F"x8) eq $SharedCacheMap; - return 0 if !eval $SharedCacheMap; - return 1; -} - -sub check_data($) -{ -my($data)=@_; - - if (!eval $data->{"SectionObjectPointer"}) { - return if $Object->{"by"} eq "IRP_MJ_CREATE"; # SectionObjectPointer is not yet initialized - warn "Existing FileObject ".$data->{"FileObject"}." but no SectionObjectPointer found" - if $FileObject{$data->{"FileObject"}} && eval($FileObject{$data->{"FileObject"}}{"SectionObjectPointer"}); - return; - } - my $SectionObjectPointer=$data->{"SectionObjectPointer"}; - if (!SharedCacheMap_valid $data->{"SharedCacheMap"} && $SectionObjectPointer{$SectionObjectPointer}) { - return if !(my $SObject=SObject $SectionObjectPointer); - my $SharedCacheMap=$SObject->{"SharedCacheMap"}; - return if !eval $SharedCacheMap; - my $CObject=CObject $SharedCacheMap; - warn "Existing SectionObjectPointer ".$data->{"SectionObjectPointer"}." but no SharedCacheMap found," - ." ref_count of SharedCacheMap is ".$CObject->{"ref_count"} - if $CObject->{"ref_count"}; -# if $SectionObjectPointer{$data->{"SectionObjectPointer"}}; - # SharedCacheMap was droppped by async task as it had ref_count==0. - delete_CObject $CObject; - $SObject->{"SharedCacheMap"}=tohex(0); - # FileObject is still valid! - return; - } - return if !$FileObject{$data->{"FileObject"}}; - return if !(my $FObject=FObject $data->{"FileObject"}); - $SectionObjectPointer=$FObject->{"SectionObjectPointer"}; - return if !(my $SObject=SObject $SectionObjectPointer); - warn "FileObject ".$FObject->{"FileObject"} - ." expected SectionObjectPointer $SectionObjectPointer" - ." but found SectionObjectPointer ".$data->{"SectionObjectPointer"} - if $SectionObjectPointer ne $data->{"SectionObjectPointer"}; - my $SharedCacheMap=$SObject->{"SharedCacheMap"}; - warn "FileObject ".$FObject->{"FileObject"}." SectionObjectPointer ".$SObject->{"SectionObjectPointer"} - ." expected SharedCacheMap $SharedCacheMap" - ." but found SharedCacheMap ".$data->{"SharedCacheMap"} - if $SharedCacheMap ne $data->{"SharedCacheMap"}; - warn "INTERNAL: SharedCacheMap $SharedCacheMap of FileObject ".$FObject->{"FileObject"}." got destroyed" - if !$SharedCacheMap{$SharedCacheMap}; -} - -sub CcInitializeCacheMap($$$$$) -{ -my($FileObject,$AllocationSize,$FileSize,$ValidDataLength,$PinAccess)=@_; - - $ValidDataLength=$FileSize if $ValidDataLength==eval("0x".("F"x8)); - $Object->{"ref_count"}=1; - $Object->{"AllocationSize"}=tohex($AllocationSize); - $Object->{"FileSize"}=tohex($FileSize); - $Object->{"ValidDataLength"}=tohex($ValidDataLength); - $Object->{"map"}=undef(); - $Object->{"pin"}={}; - $Object->{"PinAccess"}=$PinAccess; - $Object->{"FileObject"}=$FileObject; -} - -sub CcInitializeCacheMap_leave() -{ - my $SharedCacheMap=$Object->{"data"}[1]{"SharedCacheMap"}; - $Object->{"SharedCacheMap"}=$SharedCacheMap; - my $old=$SharedCacheMap{$SharedCacheMap}; - if (!SharedCacheMap_valid $Object->{"data"}[0]{"SharedCacheMap"} && $old) { - # SharedCacheMap got deleted in the meantime - delete_CObject CObject $SharedCacheMap; - # Either it got deleted of some foreign SectionObjectPointer - # or of the current one: - if (my $SObject=$SectionObjectPointer{$Object->{"data"}[0]{"SectionObjectPointer"}}) { - $SObject->{"SharedCacheMap"}=tohex(0); - } - $old=undef(); - } - if (!$old != !SharedCacheMap_valid $Object->{"data"}[0]{"SharedCacheMap"}) { - warn "Expecting old SharedCacheMap validity ".(!!$old) - ." but found old SharedCacheMap ".$Object->{"data"}[0]{"SharedCacheMap"}; - } - warn "New SharedCacheMap ".$Object->{"data"}[1]{"SharedCacheMap"}." is not valid" - if !SharedCacheMap_valid $Object->{"data"}[1]{"SharedCacheMap"}; - if (SharedCacheMap_valid $Object->{"data"}[0]{"SharedCacheMap"}) { - warn "Existing SharedCacheMap changed" - ." from ".$Object->{"data"}[0]{"SharedCacheMap"}." to ".$Object->{"data"}[1]{"SharedCacheMap"} - if $Object->{"data"}[0]{"SharedCacheMap"} ne $Object->{"data"}[1]{"SharedCacheMap"}; - } - if ($old) { - for my $field (qw(AllocationSize FileSize PinAccess)) { - warn "SharedCacheMap $SharedCacheMap old instance $field ".$old->{$field} - ." != new instance $field ".$Object->{$field} - if $old->{$field} ne $Object->{$field}; - } - do { warn "Existing map Bcb $_ during CcInitializeCacheMap()" if $_; } for ($old->{"map"}); - do { warn "Existing pin Bcb $_ during CcInitializeCacheMap()" if $_; } for (values(%{$old->{"pin"}})); - $Object->{"ref_count"}+=$old->{"ref_count"}; - } - $SharedCacheMap{$SharedCacheMap}=$Object; - - warn "Changed SectionObjectPointer inside CcInitializeCacheMap()" - ." from ".$Object->{"data"}[0]{"SectionObjectPointer"}." to ".$Object->{"data"}[1]{"SectionObjectPointer"} - if $Object->{"data"}[0]{"SectionObjectPointer"} ne $Object->{"data"}[1]{"SectionObjectPointer"}; - my $SectionObjectPointer=$Object->{"data"}[1]{"SectionObjectPointer"}; - - my $FileObject=$Object->{"FileObject"}; - if (my $FObject=$FileObject{$FileObject}) { - if (my $SObject=$SectionObjectPointer{$FObject->{"SectionObjectPointer"}}) { - warn "Changed SectionObjectPointer of FileObject $FileObject" - ." from ".$FObject->{"SectionObjectPointer"}." to ".$SectionObjectPointer - if $FObject->{"SectionObjectPointer"} ne $SectionObjectPointer; - } - # Otherwise SectionObjectPointer could be deleted and rebuilt async in the meantime. - } - $FileObject{$FileObject}={ - "FileObject"=>$FileObject, - "SectionObjectPointer"=>$SectionObjectPointer, - }; - - if (my $SObject=$SectionObjectPointer{$SectionObjectPointer}) { - warn "Changed SharedCacheMap of SectionObjectPointer $SectionObjectPointer" - ." from ".$SObject->{"SharedCacheMap"}." to ".$SharedCacheMap - if $SObject->{"SharedCacheMap"} ne $SharedCacheMap && eval($SObject->{"SharedCacheMap"}); - } - $SectionObjectPointer{$SectionObjectPointer}={ - "SectionObjectPointer"=>$SectionObjectPointer, - "SharedCacheMap"=>$SharedCacheMap, - }; - - CcSetFileSizes($FileObject,map({ eval($Object->{$_}); } qw(AllocationSize FileSize ValidDataLength))); - delete $Object->{$_} for (qw(FileObject ValidDataLength)); -} - -sub CcUninitializeCacheMap($$) -{ -my($FileObject,$TruncateSize)=@_; - - $Object->{"FileObject"}=$FileObject; -} - -sub CcUninitializeCacheMap_leave($) -{ -my($r)=@_; - - my $FileObject=$Object->{"FileObject"}; - # 'r' means function success. - # r=0 either if no CcInitializeCacheMap() was called at all - # or if Cc was unable to detach SharedCacheMap and it remains valid - # (FIXME: Do we SharedCacheMap->ref_count-- on in such case?). - my $SectionObjectPointer=$FileObject{$FileObject}->{"SectionObjectPointer"} if $FileObject{$FileObject}; - my $SharedCacheMap=$SectionObjectPointer{$SectionObjectPointer}->{"SharedCacheMap"} - if $SectionObjectPointer && $SectionObjectPointer{$SectionObjectPointer}; - warn "Unexpected 'r' result $r for CcUninitializeCacheMap of FileObject $FileObject" - if !(eval($SharedCacheMap) && !SharedCacheMap_valid($Object->{"data"}[1]{"SharedCacheMap"})) != !$r; - if (!eval $SharedCacheMap) { - for my $SharedCacheMap ($Object->{"data"}[0]{"SharedCacheMap"},$Object->{"data"}[1]{"SharedCacheMap"}) { - warn "Not expecting valid SharedCacheMap $SharedCacheMap" - if SharedCacheMap_valid $SharedCacheMap; - } - return; - } - for my $SharedCacheMap ($Object->{"data"}[0]{"SharedCacheMap"}) { - warn "Expecting valid SharedCacheMap $SharedCacheMap" - if !SharedCacheMap_valid $SharedCacheMap; - } - return if !(my $FObject=FObject $FileObject); - return if !(my $SObject=SObject $FObject->{"SectionObjectPointer"}); - return if !(my $CObject=CObject $SObject->{"SharedCacheMap"}); - if (--$CObject->{"ref_count"}) { - for my $SharedCacheMap ($Object->{"data"}[1]{"SharedCacheMap"}) { - warn "Expecting still valid SharedCacheMap $SharedCacheMap after CcUninitializeCacheMap()" - ." with ref_count=".$CObject->{"ref_count"} - if !SharedCacheMap_valid $SharedCacheMap; - } - return; - } - if (!SharedCacheMap_valid $Object->{"data"}[1]{"SharedCacheMap"}) { - delete_CObject $CObject; - $SObject->{"SharedCacheMap"}=tohex(0); - # FileObject is still valid! - } - else { - # FIXME: Do we SharedCacheMap->ref_count-- on in such case? - } -} - -sub CcSetFileSizes($$$$) -{ -my($FileObject,$AllocationSize,$FileSize,$ValidDataLength)=@_; - - return if !(my $CObject=CObject_from_FileObject $FileObject); - my $SharedCacheMap=$CObject->{"SharedCacheMap"}; - if ($AllocationSize!=eval($CObject->{"AllocationSize"})) { - do { warn "Existing map $_ of FileObject $FileObject SharedCacheMap $SharedCacheMap during CcSetAllocationSizes()," - ." AllocationSize=".$CObject->{"AllocationSize"} if $_; } - for ($CObject->{"map"}); - do { warn "Existing pin $_ of FileObject $FileObject SharedCacheMap $SharedCacheMap during CcSetAllocationSizes()," - ." AllocationSize=".$CObject->{"AllocationSize"} if $_; } - for (values(%{$CObject->{"pin"}})); - # Do not: delete $CObject->{"in_memory"}; - # as its keep is required by W32. Squeeze it instead: - $CObject->{"in_memory"}={ map({ - (eval($_)<$AllocationSize ? ($_=>1) : ()); - } keys(%{$CObject->{"in_memory"}})) }; - } - # $ValidDataLength can be > $CObject->{"FileSize"}; - warn "ValidDataLength ".tohex($ValidDataLength)." > FileSize ".tohex($FileSize) - if $ValidDataLength>$FileSize; - warn "0 != AllocationSize ".tohex($AllocationSize)." % ntfs_blocksize ".tohex($ntfs_blocksize) - if 0!=($AllocationSize%$ntfs_blocksize); - # $AllocationSize can be higher - warn "FileSize ".tohex($FileSize)." > AllocationSize ".tohex($AllocationSize) - if $FileSize>$AllocationSize; - $CObject->{"FileSize"}=tohex($FileSize); - $CObject->{"AllocationSize"}=tohex($AllocationSize); - delete $CObject->{"Buffer"} if !eval $AllocationSize; -} - -sub IRP_MJ_CREATE_leave() -{ - do { warn "Non-NULL SectionObjectPointer $_ not expected" if eval($_); } for ($Object->{"data"}[0]{"SectionObjectPointer"}); - my $FileObject=$Object->{"data"}[0]{"FileObject"}; - warn "Existing FileObject $FileObject not expected" if $FileObject{$FileObject}; - my $SectionObjectPointer=$Object->{"data"}[1]{"SectionObjectPointer"}; - # We want to track even FileObject without SectionObjectPointer yet. -# if ($SectionObjectPointer && $SectionObjectPointer{$SectionObjectPointer}) - { - $FileObject{$FileObject}={ - "FileObject"=>$FileObject, - "SectionObjectPointer"=>$SectionObjectPointer, - }; - } - if (eval $SectionObjectPointer) { - my $SharedCacheMap=$Object->{"data"}[1]{"SharedCacheMap"}; - if (my $SObject=$SectionObjectPointer{$SectionObjectPointer}) { - warn "Changed SharedCacheMap from stored ".$SObject->{"SharedCacheMap"}." to ".$SharedCacheMap - if $SObject->{"SharedCacheMap"} ne $SharedCacheMap && $Object->{"by"} ne "IRP_MJ_CREATE"; - } - $SectionObjectPointer{$SectionObjectPointer}={ - "SectionObjectPointer"=>$SectionObjectPointer, - "SharedCacheMap"=>$SharedCacheMap, - }; - } -} - -sub BObject($) -{ -my($Bcb)=@_; - - cluck if !defined $Bcb; - my $BObject=$Bcb{$Bcb}; - if (!$BObject) { - my($package,$filename,$line,$subroutine)=caller 0; - warn "Non-existent Bcb $Bcb by line $line" - } - return $BObject; -} - -sub delete_BObject($) -{ -my($BObject)=@_; - - my $Bcb=$BObject->{"Bcb"}; -# warn "XXX delete_BObject 0x811799B8 line $. BObject=".Dumper $BObject if $Bcb eq "0x811799B8"; - warn "Deleting ref_count=".$BObject->{"ref_count"}." Bcb $Bcb" if $BObject->{"ref_count"}; - # Do not: warn "Deleting dirty Bcb $Bcb" if $BObject->{"dirty"}; - # as it is valid to allow sanity check below. - warn "Deleting dirty Bcb $Bcb" if $BObject->{"dirty"} && $BObject->{"ref_count"}; - return if !(my $CObject=CObject $BObject->{"SharedCacheMap"}); - if ($BObject->{"type"} eq "map") { - for my $pin (values(%{$CObject->{"pin"}})) { - next if !defined $pin; - warn "unpin map but CcPinMappedData pin $pin still exists" - if $Bcb{$pin}->{"by"} eq "CcPinMappedData"; - } - } - else { - warn "unpin of pin Bcb $Bcb of SharedCacheMap ".$CObject->{"SharedCacheMap"} - ." although FileOffset ".$BObject->{"FileOffset"}." not in_memory" - if !($CObject->{"in_memory"}{$BObject->{"FileOffset"}}); - # Do not: delete $CObject->{"in_memory"}{$BObject->{"FileOffset"}}; - # as Cache Manager is not forced to drop it. -# warn "UNMARK: SharedCacheMap ".$CObject->{"SharedCacheMap"}." FileOffset ".$BObject->{"FileOffset"}; - } - for my $ref ($BObject->{"type"} eq "map" ? \$CObject->{"map"} : \$CObject->{"pin"}{$BObject->{"FileOffset"}}) { - warn "Final unpin but ".$BObject->{"type"}." Bcb $Bcb not registered" - ." in SharedCacheMap ".$CObject->{"SharedCacheMap"}." ref ".($$ref || "") - if !defined($BObject->{"OwnerPointer"}) && !($$ref && $$ref eq $Bcb) - && !($BObject->{"ref_count"}==0 && $BObject->{"dirty"}); - if ($$ref && $$ref eq $Bcb) { - $$ref=undef(); - # Do not: delete $CObject->{"pin"}{$BObject->{"FileOffset"}} if $BObject->{"type"} eq "pin"; - # as it would destroy $$ref slot in &Bcb_checkref '($$ref && $Bcb ne $$ref)' codepath. - } - } - delete $Bcb{$Bcb}; -# warn "XXX delete_BObject 0x811799B8 line $. CObject=".Dumper $CObject if $Bcb eq "0x811799B8"; - CObject_Buffer_check($CObject); -} - -sub MObject($) -{ -my($MdlChain)=@_; - - cluck if !defined $MdlChain; - my $MObject=$MdlChain{$MdlChain}; - warn "Non-existent MdlChain $MdlChain" if !$MObject; - return $MObject; -} - -sub CObject_Buffer_check($) -{ -my($CObject)=@_; - - my $any; - for my $BObject ($CObject->{"map"},values(%{$CObject->{"pin"}})) { - # There may exist OwnerPointer-ed or dirty&unreffed standalone Bcbs bound to this SharedCacheMap - # but these are not important for Buffer reset. - next if !$BObject; - $any=1; - last; - } - if (!$any) { - delete $CObject->{"Buffer"}; - } -} - -sub Bcb_conflict($;@) -{ -my($CObject,@Bcb_list)=@_; - - my $arg=0; - my %check=( - "map"=>$CObject->{"map"}, - map(("arg".($arg++)=>$_),@Bcb_list), - %{$CObject->{"pin"}}, - ); - my %reversed; - my $BufferBase; # relativized to FileOffset 0 - my $BufferBase_val; - if ($CObject->{"Buffer"}) { - $BufferBase=eval $CObject->{"Buffer"}; - $BufferBase_val="SharedCacheMap Buffer"; - } - while (my($key,$val)=each(%check)) { - next if !defined $val; - warn "Conflicting Bcb $val of keys $key and ".$reversed{$val}." of SharedCacheMap ".$CObject->{"SharedCacheMap"} - if $reversed{$val}; - # Buffer base should match even between 'map's and 'pin's - # as the data are always mapped only once. - my $BObject=$Bcb{$val}; - warn "Non-existent key=$key Bcb $val" -# ." XXX line $. CObject=".Dumper $CObject - if !$BObject; - if ($BObject) { - my $Buffer=eval $BObject->{"Buffer"}; - $Buffer-=eval($BObject->{"FileOffset"}) if exists $BObject->{"FileOffset"}; - warn "INTERNAL: Non page aligned Buffer ".tohex($Buffer)." of Bcb $val" - if $Buffer & 0xFFF; - warn "Non-matching Bcb ".$BObject->{"type"}." $val Buffer base ".tohex($Buffer) - ." with".($BufferBase_val=~/^SharedCacheMap / ? "" : " Bcb ".$Bcb{$BufferBase_val}->{"type"}) - ." $BufferBase_val BufferBase ".tohex($BufferBase)."; SharedCacheMap=".$CObject->{"SharedCacheMap"} -# ." XXX line $. ".Dumper($CObject,\%Bcb) - if defined($BufferBase) && $Buffer!=$BufferBase; - $BufferBase=$Buffer; - $BufferBase_val=$val; - } - $reversed{$val}=$key; - } -} - -# New $BObject will always be forced as the last stored reference. -sub Bcb_checkref($$) -{ -my($BObject,$ref)=@_; - - return if !(my $CObject=CObject $BObject->{"SharedCacheMap"}); - my $type=$BObject->{"type"}; - my $Bcb=$BObject->{"Bcb"}; - if ($$ref && $Bcb ne $$ref) { - my $BObject2=$Bcb{$$ref}; - warn "new $type Bcb $Bcb != old ".$BObject2->{"type"}." Bcb $$ref"; - delete_BObject $BObject2; - } - if ($Bcb{$Bcb}) { - my $BObject2=$Bcb{$Bcb}; - warn "new $type $Bcb type ".$BObject->{"type"}." != old type $type $Bcb type ".$BObject2->{"type"} - if $BObject->{"type"} ne $BObject2->{"type"}; - warn "new $type $Bcb Buffer ".($BObject->{"Buffer"} || "") - ." != old $type $Bcb Buffer ".($BObject2->{"Buffer"} || "") -# ." XXX line $. ".Dumper($BObject,$BObject2) - if $BObject->{"Buffer"} ne $BObject2->{"Buffer"}; - } - if ($Bcb{$Bcb}) { - warn "Equal Bcb?" if $Bcb{$Bcb} eq $BObject; - $Bcb{$Bcb}->{"ref_count"}+=$BObject->{"ref_count"}; - $BObject=$Bcb{$Bcb}; - } - $Bcb{$Bcb}=$BObject; # &Bcb_conflict needs this reference - Bcb_conflict $CObject,($$ref && $$ref eq $Bcb ? () : ($Bcb)); - $$ref=$Bcb; -} - -sub map_new($;$$) -{ -my($SharedCacheMap,$FileOffset,$Length)=@_; - - return if !(my $CObject=CObject $SharedCacheMap); - if (defined($FileOffset) && defined($Length)) { - warn "Mapping data (end ".tohex($FileOffset+$Length).") out of FileSize ".$CObject->{"FileSize"} - if $FileOffset+$Length>eval($CObject->{"FileSize"}); - } - $Object->{"SharedCacheMap"}=$CObject->{"SharedCacheMap"}; - if (defined $FileOffset) { - $Object->{"FileOffset"}=tohex($FileOffset); - } - $Object->{"type"}="map"; - $Object->{"ref_count"}=1; -} - -sub map_new_from_FileObject($;$$) -{ -my($FileObject,$FileOffset,$Length)=@_; - - return if !(my $CObject=CObject_from_FileObject $FileObject); - map_new $CObject->{"SharedCacheMap"},$FileOffset,$Length; -} - -sub map_new_leave($;$) -{ -my($Bcb,$Buffer)=@_; - - $Object->{"Bcb"}=$Bcb; - return if !(my $CObject=CObject $Object->{"SharedCacheMap"}); - - if (defined $Buffer) { - $Object->{"Buffer"}=tohex(eval($Buffer)-(eval($Object->{"FileOffset"}) || 0)); - } - delete $Object->{"FileOffset"}; - $CObject->{"Buffer"}=$Object->{"Buffer"} if !$CObject->{"Buffer"}; - warn "Unknown Buffer during map_new_leave" if !$Object->{"Buffer"}; - - my $ref=\$CObject->{"map"}; - # There may exist some pin bcbs even if we are creating the new map bcb. - Bcb_checkref $Object,$ref; -} - -sub CcMapData($$$) -{ -my($FileObject,$FileOffset,$Length)=@_; - - map_new_from_FileObject $FileObject,$FileOffset,$Length; -} - -sub CcMapData_leave($$) -{ -my($Bcb,$Buffer)=@_; - - map_new_leave $Bcb,$Buffer; -} - -sub pin_new($$$) -{ -my($FileObject,$FileOffset,$Length)=@_; - - return if !(my $CObject=CObject_from_FileObject $FileObject); - warn "Pinning of non-PinAccess FileObject $FileObject" if !$CObject->{"PinAccess"}; - warn "Mapping data (end ".tohex($FileOffset+$Length).") out of FileSize ".$CObject->{"FileSize"} - if $FileOffset+$Length>eval($CObject->{"FileSize"}); - warn "Pinning Length ".tohex($Length)." > 0x1000" if $Length>0x1000; - warn "Pinning across file page (start=".tohex($FileOffset).",end-1=".tohex($FileOffset+$Length-1).")" - if ($FileOffset&~0xFFF)!=(($FileOffset+$Length-1)&~0xFFF); - $Object->{"SharedCacheMap"}=$CObject->{"SharedCacheMap"}; - $Object->{"FileOffset"}=tohex($FileOffset); - $Object->{"type"}="pin"; - $Object->{"ref_count"}=1; -} - -sub pin_new_leave($$) -{ -my($Bcb,$Buffer)=@_; - - $Object->{"Bcb"}=$Bcb; - return if !(my $CObject=CObject $Object->{"SharedCacheMap"}); - $Object->{"Buffer"}=tohex(eval($Buffer)-(eval($Object->{"FileOffset"})&0xFFF)); - my $shift=eval($Object->{"FileOffset"})&0xFFF; - $Object->{"FileOffset"}=tohex(eval($Object->{"FileOffset"})-$shift); - $Object->{"Buffer"}=tohex(eval($Buffer)-$shift); - - my $Buffer_base=tohex(eval($Object->{"Buffer"})-eval($Object->{"FileOffset"})); - $CObject->{"Buffer"}=$Buffer_base if !$CObject->{"Buffer"}; - - warn "pin_new_leave() while FileOffset ".$Object->{"FileOffset"}." not in_memory" - ." of SharedCacheMap ".$CObject->{"SharedCacheMap"} - if !$CObject->{"in_memory"}{$Object->{"FileOffset"}}; - - my $ref=\$CObject->{"pin"}{$Object->{"FileOffset"}}; - # There may not exist map bcb even if we are creating the new pin bcb. - Bcb_checkref $Object,$ref; -# warn "XXX pin_new_leave line $. BObject=".Dumper $Object if $Bcb eq "0x811799B8"; -} - -sub CcPinRead($$$) -{ -my($FileObject,$FileOffset,$Length)=@_; - - pin_new $FileObject,$FileOffset,$Length; -} - -sub CcPinRead_leave($$) -{ -my($Bcb,$Buffer)=@_; - - pin_new_leave $Bcb,$Buffer; -} - -sub CcPreparePinWrite($$$) -{ -my($FileObject,$FileOffset,$Length)=@_; - - return if !(my $CObject=CObject_from_FileObject $FileObject); - # Full pages do not need to be read: - if (!($FileOffset&0xFFF)) { - $CObject->{"in_memory"}{tohex $FileOffset}=1; - } - - pin_new $FileObject,$FileOffset,$Length; -} - -sub CcPreparePinWrite_leave($$) -{ -my($Bcb,$Buffer)=@_; - - pin_new_leave $Bcb,$Buffer; - my $BObject=BObject $Bcb; - $BObject->{"dirty"}=1; -} - -sub CcPinMappedData($$$) -{ -my($FileObject,$FileOffset,$Length)=@_; - - pin_new $FileObject,$FileOffset,$Length; -} - -sub CcPinMappedData_leave($) -{ -my($Bcb)=@_; - - return if !(my $CObject=CObject $Object->{"SharedCacheMap"}); - # Do not: do { warn "CcPinMappedData() with Bcb $Bcb on non-CcMapData()ed SharedCacheMap ".$CObject->{"SharedCacheMap"}; return; } - # if !$CObject->{"map"}; - # as the only requirement of CcPinMappedData() is to have all the pages already 'in_memory'. - my $Buffer=$CObject->{"Buffer"}; - warn "SharedCacheMap ".$CObject->{"SharedCacheMap"}." Buffer not known during CcPinMappedData()" - if !$Buffer; - $Buffer=tohex(eval($Buffer)+eval($Object->{"FileOffset"})) if $Buffer; - -# my $Bcb2=$CObject->{"pin"}{tohex(eval($Object->{"FileOffset"})&~0xFFF)}; -# my $BObject2=BObject $Bcb2 if $Bcb2; - - pin_new_leave $Bcb,$Buffer; -} - -sub CcSetDirtyPinnedData($$) -{ -my($Bcb,$Lsn)=@_; - - return if !(my $BObject=BObject $Bcb); - # Do not: warn "Lsn already set for Bcb $Bcb as ".$BObject->{"Lsn"}." while current Lsn=$Lsn" if $BObject->{"Lsn"}; - # as it is permitted. - warn "Lsn goes backward for Bcb $Bcb old Lsn ".$BObject->{"Lsn"}." to a new Lsn=$Lsn" - if $BObject->{"Lsn"} && eval($BObject->{"Lsn"})>eval($Lsn); - $BObject->{"Lsn"}=$Lsn if $Lsn ne "0x".("F"x8); - $BObject->{"dirty"}=1; - return if !(my $CObject=CObject $BObject->{"SharedCacheMap"}); -} - -sub FlushToLsnRoutine($$) -{ -my($LogHandle,$Lsn)=@_; - - $Object->{"LogHandle"}=$LogHandle; - $Object->{"Lsn"}=$Lsn; - - my $obj=${$EnterLeave}[$#$EnterLeave-1]; - warn "FLUSH" if $obj->{"by"} eq "CcFlushCache"; -} - -my $LogHandle_static; -sub CcSetLogHandleForFile($$$) -{ -my($FileObject,$LogHandle,$FlushToLsnRoutine)=@_; - - return if !(my $CObject=CObject_from_FileObject $FileObject); - warn "LogHandle ".$CObject->{"LogHandle"}." already exists for SharedCacheMap ".$CObject->{"SharedCacheMap"} - if $CObject->{"LogHandle"}; - return if !eval $LogHandle; # $LogHandle may be "0x0" - # ntfs.sys uses single LogHandle for its whole session: - warn "Non-unique LogHandle $LogHandle while last LogHandle was $LogHandle_static" - if $LogHandle_static && $LogHandle ne $LogHandle_static; - $CObject->{"LogHandle"}=$LogHandle; - if (!$LogHandle{$LogHandle}) { - $LogHandle{$LogHandle}={ - "LogHandle"=>$LogHandle, - }; - } -} - -sub IRP_MJ_WRITE_leave_page($$) -{ -my($ByteOffset,$Lsn_check)=@_; - - my $SharedCacheMap=$Object->{"data"}[0]{"SharedCacheMap"}; - return if !(my $CObject=CObject $SharedCacheMap); - my $FlushToLsnRoutine=$LastLeave if $LastLeave->{"by"} eq "FlushToLsnRoutine"; - # Do not: my $Bcb=$CObject->{"pin"}{$ByteOffset}; - # as Bcbs with $BObject->{"OwnerPointer"} are no longer stored in $CObject->{"pin"}. - my @Bcbs; - for my $Bcb (keys(%Bcb)) { - my $BObject=BObject $Bcb; - if (1 - && $BObject->{"type"} eq "pin" - && $BObject->{"SharedCacheMap"} eq $SharedCacheMap - && $BObject->{"FileOffset"} eq $ByteOffset) { - push @Bcbs,$Bcb; - } - } - if (!@Bcbs) { - do { - warn "Non-Bcb IRP_MJ_WRITE ByteOffset=$ByteOffset as non-toplevel function" - ." (".join(",",map({ $_->{"line_enter"}.":".$_->{"by"}; } @$EnterLeave)).")"; -# warn Dumper $CObject; - # Direct IRP_MJ_WRITE can be from callbacked 'FlushToLsnRoutine'. - # It can occur even from other callbacks ('DirtyPageRoutine' etc.) - # but it was not needed here yet. - } if @$EnterLeave && !(${$EnterLeave}[$#$EnterLeave]->{"by"}=~/^(?:FlushToLsnRoutine\b|IRP_MJ_)/); - warn "Non-Bcb IRP_MJ_WRITE ByteOffset=$ByteOffset but FlushToLsnRoutine was preceding" - if $FlushToLsnRoutine; - return; - } - $CObject->{"in_memory"}{$ByteOffset}=1; - warn "Ambiguous matching Bcbs ".join(",",@Bcbs) - ." to SharedCacheMap $SharedCacheMap WRITE ByteOffset $ByteOffset" - if @Bcbs>=2; - my $Bcb=$Bcbs[0]; - return if !(my $BObject=BObject $Bcb); - warn "IRP_MJ_WRITE on non-dirty Bcb $Bcb" if !$BObject->{"dirty"}; - if ($FlushToLsnRoutine) { - push @$Lsn_check,{ - "Bcb"=>$Bcb, - "Bcb_Lsn",$BObject->{"Lsn"}, - } if $Lsn_check; - } - else { - warn "Missing preceding FlushToLsnRoutine during IRP_MJ_WRITE of Bcb $Bcb with Lsn ".$BObject->{"Lsn"} - if $BObject->{"Lsn"}; - } - warn "IRP_MJ_WRITE with FlushToLsnRoutine although not in AcquireForLazyWrite or CcFlushCache" - if $FlushToLsnRoutine && !((1==@$EnterLeave && ${$EnterLeave}[0]->{"by"} eq "CcFlushCache") - || (2==@$EnterLeave && ${$EnterLeave}[0]->{"by"}=~/^IRP_MJ_/ - && ${$EnterLeave}[1]->{"by"} eq "CcFlushCache")) - && !($CObject->{"AcquireForLazyWrite"}>=1); - warn "IRP_MJ_WRITE not the toplevel function" - ." (".join(",",map({ $_->{"line_enter"}.":".$_->{"by"}; } @$EnterLeave)).")" - if !(0==@$EnterLeave - || (1==@$EnterLeave && ${$EnterLeave}[0]->{"by"} eq "CcFlushCache") - || (2==@$EnterLeave && ${$EnterLeave}[0]->{"by"}=~/^IRP_MJ_/ - && ${$EnterLeave}[1]->{"by"} eq "CcFlushCache")); - my $CcFlushCache=${$EnterLeave}[$#$EnterLeave]; - if ($CcFlushCache && $CcFlushCache->{"by"} eq "CcFlushCache") { - $CcFlushCache->{"CcFlushCached"}++; - if ($CcFlushCache->{"FileOffset"} ne "0x".("F"x8) || $CcFlushCache->{"Length"} ne "0x0") { - warn "IRP_MJ_WRITE outside of range of active CcFlushCache()" - if eval($ByteOffset)< eval($CcFlushCache->{"FileOffset"}) - || eval($ByteOffset)>=eval($CcFlushCache->{"FileOffset"})+eval($CcFlushCache->{"Length"}); - } - } - # Keep $BObject->{"dirty"} there for &delete_BObject sanity checks. - delete_BObject $BObject if $BObject->{"dirty"} && !$BObject->{"ref_count"}; -} - -sub IRP_MJ_WRITE_leave() -{ - return if !(my $CObject=CObject $Object->{"data"}[0]{"SharedCacheMap"}); - # toplevel IRP_MJ_WRITE has no requirements - return if 0==@$EnterLeave - # We do not need any outer function, just 'AcquireForLazyWrite' is enough - # for flushing Cache Manager buffers by some its LazyWriter task. - && !$CObject->{"AcquireForLazyWrite"}; - do { warn "Length $_ not divisible by 0x1000" if eval($_)%0x1000; } for ($Object->{"WRITE"}{"Length"}); - my @Lsn_check; - for my $reloffs (0..(eval($Object->{"WRITE"}{"Length"})/0x1000)-1) { - IRP_MJ_WRITE_leave_page tohex(eval($Object->{"WRITE"}{"ByteOffset"})+0x1000*$reloffs),\@Lsn_check; - } - - if ($LastLeave->{"by"} eq "FlushToLsnRoutine" && (my $FlushToLsnRoutine=$LastLeave)) { - my $Lsn_max; - for (@Lsn_check) { - my $Lsn=eval $_->{"Bcb_Lsn"}; - $Lsn_max=$Lsn if !defined($Lsn_max) || $Lsn_max<$Lsn; - } - warn "FlushToLsnRoutine of line_enter ".$FlushToLsnRoutine->{"line_enter"} - ." got Lsn ".$FlushToLsnRoutine->{"Lsn"}." although Bcbs have " - .join(",",map({ "(".$_->{"Bcb"}.":".$_->{"Bcb_Lsn"}.")"; } @Lsn_check)) - if tohex($Lsn_max) ne $FlushToLsnRoutine->{"Lsn"}; - } -} - -sub IRP_MJ_READ_leave() -{ - # toplevel IRP_MJ_READ has no requirements - return if 0==@$EnterLeave; - my @stack=map({ $_->{"by"}=~/^IRP_MJ_/ ? () : $_ } @$EnterLeave); - my $opObject=$stack[0] if 1==@stack; - warn "IRP_MJ_READ not the expected function stack" - ." (".join(",",map({ $_->{"line_enter"}.":".$_->{"by"}; } @$EnterLeave)).")" - if !($opObject->{"by"} eq "CcMapData" - || $opObject->{"by"} eq "CcCopyRead" - || $opObject->{"by"} eq "CcMdlRead" - || $opObject->{"by"} eq "CcPinRead"); - if ($opObject->{"by"} eq "CcMdlRead") { - do { warn "Length $_ not divisible by 0x1000" if eval($_)%0x1000; } for ($Object->{"READ"}{"Length"}); - } - else { - do { warn "Length $_ not 0x1000" if eval($_)!=0x1000; } for ($Object->{"READ"}{"Length"}); - } - my $SharedCacheMap=$Object->{"data"}[0]{"SharedCacheMap"}; - return if !(my $CObject=CObject $SharedCacheMap); - for my $reloffs (0..eval($Object->{"READ"}{"Length"})/0x1000-1) { - my $ByteOffset=tohex(eval($Object->{"READ"}{"ByteOffset"})+$reloffs*0x1000); - # Do not: warn "Reading ByteOffset $ByteOffset into SharedCacheMap $SharedCacheMap twice" - # if $CObject->{"in_memory"}{$ByteOffset}; - # as it may be still cached there as Cache Manager is not forced to drop it. - $CObject->{"in_memory"}{$ByteOffset}=1; -# warn "MARK: SharedCacheMap ".$CObject->{"SharedCacheMap"}." FileOffset $ByteOffset"; - } -} - -sub CcPurgeCacheSection($$$$$) -{ -my($SectionObjectPointer,$SharedCacheMap,$FileOffset,$Length,$UninitializeCacheMaps)=@_; - - return if !(my $CObject=CObject $SharedCacheMap); - warn "Unexpected UninitializeCacheMaps $UninitializeCacheMaps" if $UninitializeCacheMaps ne "0"; - my $all=($FileOffset eq "0x".("F"x8) && !eval $Length); - warn "Not yet implemented ranged CcPurgeCacheSection()" if !$all; - do { warn "Existing map Bcb $_ during CcPurgeCacheSection()" if $_; } for ($CObject->{"map"}); - do { warn "Existing pin Bcb $_ during CcPurgeCacheSection()" if $_; } for (values(%{$CObject->{"pin"}})); - # Primary goal of this function: - delete $CObject->{"in_memory"}; - # Really needed: - delete $CObject->{"Buffer"}; -} - -sub CcFlushCache($$$$) -{ -my($SectionObjectPointer,$SharedCacheMap,$FileOffset,$Length)=@_; - - $Object->{"CcFlushCached"}=0; - $Object->{"FileOffset"}=$FileOffset; - $Object->{"Length"}=$Length; -} - -sub CcFlushCache_leave($$) -{ -my($Status,$Information)=@_; - - warn "CcFlushCache() not the toplevel function" - ." (".join(",",map({ $_->{"line_enter"}.":".$_->{"by"}; } @$EnterLeave)).")" - if !(0==@$EnterLeave - || (1==@$EnterLeave && ${$EnterLeave}[0]->{"by"}=~/^IRP_MJ_/)); - if ($Status ne "0x".("F"x8) || $Information ne "0x".("F"x8)) { - warn "Unexpected Status $Status" if eval $Status; - warn "Unexpected Information $Information while CcFlushCached=".$Object->{"CcFlushCached"} - if eval($Information)!=eval($Object->{"CcFlushCached"})*0x1000; - } -} - -sub CcPrepareMdlWrite($$$) -{ -my($FileObject,$FileOffset,$Length)=@_; - - $Object->{"FileObject"}=$FileObject; - warn "FileOffset $FileOffset not divisible by 0x1000" if eval($FileOffset)%0x1000; - $Object->{"FileOffset"}=$FileOffset; - warn "Length $Length not divisible by 0x1000" if eval($Length)%0x1000; - $Object->{"Length"}=$Length; -} - -sub CcPrepareMdlWrite_leave($$$) -{ -my($MdlChain,$Status,$Information)=@_; - - do { warn "Unexpected Status $Status"; return; } if eval $Status; - warn "Unexpected Information $Information" if $Information ne $Object->{"Length"}; - warn "MdlChain $MdlChain already exists" if $MdlChain{$MdlChain}; - $MdlChain{$MdlChain}=$Object; -} - -sub CcMdlWriteComplete($$$) -{ -my($FileObject,$FileOffset,$MdlChain)=@_; - - return if !(my $MObject=MObject $MdlChain); - warn "CcMdlWriteComplete() parameter FileObject $FileObject" - ." not matching MdlChain $MdlChain FileObject ".$MObject->{"FileObject"} - if $FileObject ne $MObject->{"FileObject"}; - warn "CcMdlWriteComplete() parameter FileOffset $FileOffset" - ." not matching MdlChain $MdlChain FileOffset ".$MObject->{"FileOffset"} - if $FileOffset ne $MObject->{"FileOffset"}; - # Propose MdlChain to a simulated Bcb. - # We must split it by pages as pin can be just 0x1000 sized. - return if !(my $CObject=CObject_from_FileObject $MObject->{"FileObject"}); - for my $reloffs (0..eval($MObject->{"Length"})/0x1000-1) { - my $BObject={ %$MObject }; - $BObject->{"Bcb"}="MdlChain $MdlChain reloffs $reloffs"; - $BObject->{"FileOffset"}=tohex(eval($MObject->{"FileOffset"})+$reloffs*0x1000); - $BObject->{"SharedCacheMap"}=$CObject->{"SharedCacheMap"}; - $BObject->{"type"}="pin"; - $BObject->{"ref_count"}=0; - $BObject->{"dirty"}=1; - warn "Bcb ".$BObject->{"Bcb"}." already exists" if $Bcb{$BObject->{"Bcb"}}; - $Bcb{$BObject->{"Bcb"}}=$BObject; - } - delete $MdlChain{$MdlChain}; -} - -sub CcMdlWriteAbort($$) -{ -my($FileObject,$MdlChain)=@_; - - warn "CcMdlWriteAbort() not handled"; -} - -sub AcquireForLazyWrite_leave($) -{ -my($r)=@_; - - warn "Unexpected 'r' $r" if $r ne "1"; - warn "AcquireForLazyWrite() not the toplevel function" if @$EnterLeave; - return if !(my $CObject=CObject $Object->{"data"}[0]{"SharedCacheMap"}); - $CObject->{"AcquireForLazyWrite"}++; -} - -sub ReleaseFromLazyWrite_leave() -{ - warn "ReleaseFromLazyWrite() not the toplevel function" if @$EnterLeave; - return if !(my $CObject=CObject $Object->{"data"}[0]{"SharedCacheMap"}); - warn "Invalid 'AcquireForLazyWrite' value ".$CObject->{"AcquireForLazyWrite"} - if !($CObject->{"AcquireForLazyWrite"}>=1); - $CObject->{"AcquireForLazyWrite"}--; -} - -sub CcRemapBcb($) -{ -my($Bcb)=@_; - - return if !(my $BObject=BObject $Bcb); - map_new $BObject->{"SharedCacheMap"}; - $Object->{"Buffer"}=tohex(eval($BObject->{"Buffer"})-eval($BObject->{"FileOffset"} || 0)); -} - -sub CcRemapBcb_leave($) -{ -my($r)=@_; - - map_new_leave $r; -} - -sub unpin($) -{ -my($Bcb)=@_; - - return if !(my $BObject=BObject $Bcb); - return if --$BObject->{"ref_count"}; - if ($BObject->{"dirty"}) { - # last unpin of unreferenced dirty Bcb will no longer allow reincarnation - # of the same Bcb to the pin map of its SharedCacheMap. - return if !(my $CObject=CObject $BObject->{"SharedCacheMap"}); - warn "unpin() of pin Bcb $Bcb but it is already not registered in SharedCacheMap ".$BObject->{"SharedCacheMap"}." pin map" - if (!$CObject->{"pin"}{$BObject->{"FileOffset"}} || $CObject->{"pin"}{$BObject->{"FileOffset"}} ne $Bcb) - && !$BObject->{"OwnerPointer"}; - delete $CObject->{"pin"}{$BObject->{"FileOffset"}} - if $CObject->{"pin"}{$BObject->{"FileOffset"}} && ($CObject->{"pin"}{$BObject->{"FileOffset"}} eq $Bcb); - CObject_Buffer_check $CObject; - return; - } - delete_BObject $BObject; -} - -sub CcUnpinData($) -{ -my($Bcb)=@_; - - unpin $Bcb; -} - -sub CcUnpinDataForThread($) -{ -my($Bcb)=@_; - - unpin $Bcb; -} - -sub CcSetBcbOwnerPointer($$) -{ -my($Bcb,$OwnerPointer)=@_; - - return if !(my $BObject=BObject $Bcb); - warn "CcSetBcbOwnerPointer() on map Bcb $Bcb" if $BObject->{"type"} ne "pin"; - return if !(my $CObject=CObject $BObject->{"SharedCacheMap"}); - warn "Double CcSetBcbOwnerPointer() on Bcb $Bcb" if defined $BObject->{"OwnerPointer"}; - my $val=$CObject->{"pin"}{$BObject->{"FileOffset"}}; - warn "CcSetBcbOwnerPointer() on unregistered pin Bcb $Bcb" if !$val || $val ne $Bcb; - delete $CObject->{"pin"}{$BObject->{"FileOffset"}} if $val && $val eq $Bcb; - $BObject->{"OwnerPointer"}=$OwnerPointer; - CObject_Buffer_check $CObject; -} - -sub IRP_MJ_CLOSE_leave() -{ - my $FileObject=$Object->{"data"}[0]{"FileObject"}; -# # IRP_MJ_CLOSE of FileObject w/o CcInitializeCacheMap()? -# return if !$FileObject{$FileObject}; - return if !(my $FObject=FObject $FileObject); - if (eval(my $SectionObjectPointer=$FObject->{"SectionObjectPointer"})) { - return if !(my $SObject=SObject $SectionObjectPointer); - my $SharedCacheMap=$SObject->{"SharedCacheMap"}; - if (eval $SharedCacheMap) { - return if !(my $CObject=CObject $SObject->{"SharedCacheMap"}); - # SharedCacheMap may still exist for FCB although this FileObject gets destroyed now. -# warn "SectionObjectPointer $SectionObjectPointer still exists during IRP_MJ_CLOSE" -# ." while SharedCacheMap ".$CObject->{"SharedCacheMap"}." ref_count ".$CObject->{"ref_count"} -# if $SectionObjectPointer && $CObject->{"ref_count"}; - } - } - delete_FObject $FObject; -} - - -local $_; -my $hex='0x[\dA-F]+'; -my %last_irp_mj; -while (<>) { - chomp; - s/\r$//; - # We may get some foreign garbage without '\n' before our debug data line: - # Do not use '\bTraceFS' as there really can be precediny _any_ data. - s#^.*?TraceFS[(]($hex/$hex)[)]: ## or do { print "$_\n" if $filter; next; }; - $ProcessThread=$1; - - $Object=undef(); - if (/^enter: (\w+)/) { - $Object={}; - $Object->{"by"}=$1; - $Object->{"line_enter"}=$.; - $Object->{"ProcessThread"}=$ProcessThread; - push @{$EnterLeave{$ProcessThread}},$Object; - } - elsif (/^leave: (\w+)/) { - warn "Empty pop stack during 'leave' of $1" if !($Object=pop @{$EnterLeave{$ProcessThread}}); - warn "Non-matching popped 'by' ".$Object->{"by"}." ne current 'leave' $1" - if $Object->{"by"} ne $1; - $Object->{"line_leave"}=$.; - push @{$LastLeave{$ProcessThread}},$Object; - } - elsif (my($FileObject,$FileName,$Flags,$SectionObjectPointer,$SharedCacheMap)= - /^FileObject=($hex): FileName=(?:NULL|'(.*)'),(?:ref=[+-]\d+,)?Flags=($hex),SectionObjectPointer=($hex),->SharedCacheMap=($hex)/) { - my $aref=$EnterLeave{$ProcessThread}; - warn "Empty stack during 'data' line" if !($Object=${$aref}[$#$aref]); - my $data={ - "FileObject"=>$FileObject, - "FileName"=>$FileName, - "Flags"=>$Flags, - "SectionObjectPointer"=>$SectionObjectPointer, - "SharedCacheMap"=>$SharedCacheMap, - "line"=>$., - }; - push @{$Object->{"data"}},$data; - my $isinit={ map(($_=>1),qw( - CcInitializeCacheMap - CcUninitializeCacheMap - IRP_MJ_CREATE - )) }->{$Object->{"by"}}; - check_data $data - if 1==@{$Object->{"data"}} || !$isinit; - if ($isinit) { - # Prevent 'SharedCacheMap' 0->N change by CcInitializeCacheMap() called inside. - for my $ref (@$aref[0..$#$aref-1]) { - $ref->{"data"}[0]->{"SharedCacheMap"}=$SharedCacheMap; - } - } - if (2<=@{$Object->{"data"}}) { - my $data_prev=$Object->{"data"}[$#{$Object->{"data"}}-1]; - for my $field (qw(FileObject FileName Flags),($isinit ? () : qw(SharedCacheMap))) { - next if !defined(my $prev=$data_prev->{$field}); - next if !defined(my $now=$data->{$field}); - my $by=$Object->{"by"}; - if ($field eq "Flags") { - next if $by eq "IRP_MJ_CREATE" && $field eq "Flags"; - my $FO_CLEANUP_COMPLETE=0x4000; - $now=tohex(eval($now)&~$FO_CLEANUP_COMPLETE) if $by eq "IRP_MJ_CLEANUP"; - my $FO_FILE_FAST_IO_READ=0x80000; - $prev=tohex(eval($prev)&~$FO_FILE_FAST_IO_READ) if $by eq "IRP_MJ_CLEANUP"; - $now=tohex(eval($now)&~$FO_FILE_FAST_IO_READ) if $by eq "IRP_MJ_READ" && !(eval($prev)&$FO_FILE_FAST_IO_READ); - my $FO_FILE_MODIFIED=0x1000; - $now=tohex(eval($now)&~$FO_FILE_MODIFIED) if $by eq "IRP_MJ_WRITE" && !(eval($prev)&$FO_FILE_MODIFIED); - my $FO_FILE_SIZE_CHANGED=0x2000; - $prev=tohex(eval($prev)&~$FO_FILE_MODIFIED) - if $by eq "IRP_MJ_SET_INFORMATION" && !(eval($now)&$FO_FILE_MODIFIED); - $prev=tohex(eval($prev)&~$FO_FILE_SIZE_CHANGED) - if $by eq "IRP_MJ_SET_INFORMATION" && !(eval($now)&$FO_FILE_SIZE_CHANGED); - } - next if $by eq "IRP_MJ_CLOSE" && $field eq "FileName"; - $prev=~s#\\$## if $by eq "IRP_MJ_CREATE"; - $prev="\\" if $by eq "IRP_MJ_CREATE" && $prev eq ""; - $prev=~s#:.*## if $by eq "IRP_MJ_CREATE" && $prev ne $now; - next if $field eq "SharedCacheMap" && !SharedCacheMap_valid $prev && !SharedCacheMap_valid $now; - do { warn "Changed data field $field, prev=".$data_prev->{$field}.", now=".$data->{$field}." by $by"; -# print STDERR Dumper $data_prev,$data; - } if $prev ne $now; - } - } - next; - } - elsif (my($op,$ByteOffset,$Length)= - /^(READ|WRITE): ByteOffset=($hex),Length=($hex)/) { - my $aref=$EnterLeave{$ProcessThread}; - warn "Empty stack during 'data' line" if !($Object=${$aref}[$#$aref]); - $Object->{$op}={ - "ByteOffset"=>$ByteOffset, - "Length"=>$Length, - }; - next; - } - - $LastLeave=${$LastLeave{$ProcessThread}}[$#{$LastLeave{$ProcessThread}}-1]; - $EnterLeave=$EnterLeave{$ProcessThread}; - - if (my($r)= - /^leave: IRP_MJ_\w+: r=($hex)/) { - # Failed requests should make no consequences. - next if eval($r); - } - - if (my($FileObject,$AllocationSize,$FileSize,$ValidDataLength,$PinAccess)= - /^enter: CcInitializeCacheMap: FileObject=($hex),FileSizes,->AllocationSize=($hex),->FileSize=($hex),->ValidDataLength=($hex),PinAccess=([01]),/) { - CcInitializeCacheMap $FileObject,eval($AllocationSize),eval($FileSize),eval($ValidDataLength),eval($PinAccess); - next; - } - if (/^leave: CcInitializeCacheMap\b/) { - CcInitializeCacheMap_leave; - next; - } - - if (my($FileObject,$TruncateSize)= - /^enter: CcUninitializeCacheMap: FileObject=($hex),TruncateSize=($hex),/) { - CcUninitializeCacheMap $FileObject,eval($TruncateSize); - next; - } - if (my($r)= - /^leave: CcUninitializeCacheMap: r=([01])/) { - CcUninitializeCacheMap_leave $r; - next; - } - - if (my($FileObject,$AllocationSize,$FileSize,$ValidDataLength)= - /^enter: CcSetFileSizes: FileObject=($hex),FileSizes,->AllocationSize=($hex),->FileSize=($hex),->ValidDataLength=($hex)/) { - CcSetFileSizes $FileObject,eval($AllocationSize),eval($FileSize),eval($ValidDataLength); - next; - } - - if (/^leave: IRP_MJ_CREATE\b/) { - IRP_MJ_CREATE_leave; - next; - } - - if (/^leave: IRP_MJ_CLOSE\b/) { - IRP_MJ_CLOSE_leave; - next; - } - - if (my($FileObject,$FileOffset,$Length)= - /^enter: CcMapData: FileObject=($hex),FileOffset=($hex),Length=($hex),Flags=0x1/) { - CcMapData $FileObject,eval($FileOffset),eval($Length); - next; - } - if (my($Bcb,$Buffer)= - /^leave: CcMapData: r=1,Bcb=($hex),Buffer=($hex)/) { - CcMapData_leave $Bcb,$Buffer; - next; - } - - if (my($FileObject,$FileOffset,$Length)= - /^enter: CcPinRead: FileObject=($hex),FileOffset=($hex),Length=($hex),Flags=0x1/) { - CcPinRead $FileObject,eval($FileOffset),eval($Length); - next; - } - if (my($Bcb,$Buffer)= - /^leave: CcPinRead: r=1,Bcb=($hex),Buffer=($hex)/) { - CcPinRead_leave $Bcb,$Buffer; - next; - } - - if (my($FileObject,$FileOffset,$Length)= - /^enter: CcPreparePinWrite: FileObject=($hex),FileOffset=($hex),Length=($hex),Zero=([01]),Flags=0x1/) { - CcPreparePinWrite $FileObject,eval($FileOffset),eval($Length); - next; - } - if (my($Bcb,$Buffer)= - /^leave: CcPreparePinWrite: r=1,Bcb=($hex),Buffer=($hex)/) { - CcPreparePinWrite_leave $Bcb,$Buffer; - next; - } - - if (my($FileObject,$FileOffset,$Length)= - /^enter: CcPinMappedData: FileObject=($hex),FileOffset=($hex),Length=($hex),Flags=0x1/) { - CcPinMappedData $FileObject,eval($FileOffset),eval($Length); - next; - } - if (my($Bcb)= - /^leave: CcPinMappedData: r=1,Bcb=($hex)/) { - CcPinMappedData_leave $Bcb; - next; - } - - if (my($BcbVoid,$Lsn)= - /^enter: CcSetDirtyPinnedData: BcbVoid=($hex),Lsn=($hex)/) { - CcSetDirtyPinnedData $BcbVoid,$Lsn; - next; - } - - if (my($LogHandle,$Lsn)= - /^enter: FlushToLsnRoutine: LogHandle=($hex),Lsn=($hex)/) { - FlushToLsnRoutine $LogHandle,$Lsn; - next; - } - - if (/^leave: IRP_MJ_READ\b/) { - IRP_MJ_READ_leave; - next; - } - - if (my($SectionObjectPointer,$SharedCacheMap,$FileOffset,$Length,$UninitializeCacheMaps)= - /^enter: CcPurgeCacheSection: SectionObjectPointer=($hex),->SharedCacheMap=($hex),FileOffset=($hex),Length=($hex),UninitializeCacheMaps=([01])/) { - CcPurgeCacheSection $SectionObjectPointer,$SharedCacheMap,$FileOffset,$Length,$UninitializeCacheMaps; - next; - } - - if (/^leave: IRP_MJ_WRITE\b/) { - IRP_MJ_WRITE_leave; - next; - } - - if (my($SectionObjectPointer,$SharedCacheMap,$FileOffset,$Length)= - /^enter: CcFlushCache: SectionObjectPointer=($hex),->SharedCacheMap=($hex),FileOffset=($hex),Length=($hex)/) { - CcFlushCache $SectionObjectPointer,$SharedCacheMap,$FileOffset,$Length; - next; - } - - if (my($Status,$Information)= - /^leave: CcFlushCache: IoStatus->Status=($hex),IoStatus->Information=($hex)/) { - CcFlushCache_leave $Status,$Information; - next; - } - - if (my($r)= - /^leave: AcquireForLazyWrite: r=([01])/) { - AcquireForLazyWrite_leave $r; - } - - if (/^leave: ReleaseFromLazyWrite\b/) { - ReleaseFromLazyWrite_leave; - } - - if (my($FileObject,$LogHandle,$FlushToLsnRoutine)= - /^enter: CcSetLogHandleForFile: FileObject=($hex),LogHandle=($hex),FlushToLsnRoutine=($hex)/) { - CcSetLogHandleForFile $FileObject,$LogHandle,$FlushToLsnRoutine; - next; - } - - if (my($FileObject,$FileOffset,$Length)= - /^enter: CcPrepareMdlWrite: FileObject=($hex),FileOffset=($hex),Length=($hex)/) { - CcPrepareMdlWrite $FileObject,$FileOffset,$Length; - next; - } - if (my($MdlChain,$Status,$Information)= - /^leave: CcPrepareMdlWrite: MdlChain=($hex),IoStatus->Status=($hex),IoStatus->Information=($hex)/) { - CcPrepareMdlWrite_leave $MdlChain,$Status,$Information; - next; - } - - if (my($FileObject,$FileOffset,$MdlChain)= - /^enter: CcMdlWriteComplete: FileObject=($hex),FileOffset=($hex),MdlChain=($hex)/) { - CcMdlWriteComplete $FileObject,$FileOffset,$MdlChain; - next; - } - - if (my($FileObject,$MdlChain)= - /^enter: CcMdlWriteAbort: FileObject=($hex),MdlChain=($hex)/) { - CcMdlWriteAbort $FileObject,$MdlChain; - next; - } - - if (my($Bcb)= - /^enter: CcRemapBcb: Bcb=($hex)/) { - CcRemapBcb $Bcb; - next; - } - if (my($r)= - /^leave: CcRemapBcb: r=($hex)/) { - CcRemapBcb_leave $r; - next; - } - - if (my($Bcb)= - /^enter: CcUnpinData: Bcb=($hex)/) { - CcUnpinData $Bcb; - next; - } - if (my($Bcb)= - /^enter: CcUnpinDataForThread: Bcb=($hex)/) { - CcUnpinDataForThread $Bcb; - next; - } - - if (my($Bcb,$OwnerPointer)= - /^enter: CcSetBcbOwnerPointer: Bcb=($hex),OwnerPointer=($hex)/) { - CcSetBcbOwnerPointer $Bcb,$OwnerPointer; - next; - } - - print "$_\n" if $filter; - } -for my $FileObject (keys(%FileObject)) { - warn "EXIT: still CcInitializeCacheMap FileObject $FileObject"; - next if !(my $FObject=FObject $FileObject); - } diff --git a/src/TraceFS/hookfs.pl b/src/TraceFS/hookfs.pl deleted file mode 100755 index 9f701e9..0000000 --- a/src/TraceFS/hookfs.pl +++ /dev/null @@ -1,381 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# Redirect system calls of the specified file system driver to TraceFS.sys -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use strict; -use warnings; -use Carp qw(cluck confess); - - -my $D=0; - -my $IMAGE_FILE_IMPORT_DIRECTORY=1; -my $IMAGE_FILE_EXPORT_DIRECTORY=0; -my $IMAGE_DATA_DIRECTORY_sizeof=8; -my $VirtualAddress_rel_to_DATA_DIRECTORY_offs=0; -my $Size_rel_to_DATA_DIRECTORY_offs=4; -my $IMAGE_EXPORT_DIRECTORY_sizeof=0x28; -my $IMAGE_IMPORT_DESCRIPTOR_sizeof=0x14; -my $Name_rel_to_IMAGE_EXPORT_DIRECTORY_offs=0xC; -my $NumberOfNames_rel_to_IMAGE_EXPORT_DIRECTORY_offs=0x18; -my $AddressOfNames_rel_to_IMAGE_EXPORT_DIRECTORY_offs=0x20; -my $OriginalFirstThunk_rel_to_IMPORT_DIRECTORY_offs=0x0; -my $FirstThunk_rel_to_IMPORT_DIRECTORY_offs=0x10; -my $Name_rel_to_IMAGE_IMPORT_BY_NAME_offs=0x2; -my $IMAGE_SECTION_HEADER_sizeof=0x28; -my $Name_rel_to_IMAGE_SECTION_HEADER_offs=0x00; -my $VirtualSize_rel_to_IMAGE_SECTION_HEADER_offs=0x08; -my $VirtualAddress_rel_to_IMAGE_SECTION_HEADER_offs=0x0C; -my $SizeOfRawData_rel_to_IMAGE_SECTION_HEADER_offs=0x10; -my $PointerToRawData_rel_to_IMAGE_SECTION_HEADER_offs=0x14; -my $Characteristics_rel_to_IMAGE_SECTION_HEADER_offs=0x24; - - -sub uintX_get($$$) -{ -my($file,$offset,$bits)=@_; - - my $r=0; - for (my $byte=0;$byte<$bits/8;$byte++) { - confess if !defined $file->[$offset+$byte]; - $r|=($file->[$offset+$byte])<<($byte*8); - } - return $r; -} -sub uint32_get($$) { return uintX_get($_[0],$_[1],32); } -sub uint16_get($$) { return uintX_get($_[0],$_[1],16); } -sub uint8_get($$) { return uintX_get($_[0],$_[1], 8); } - -sub uintX_put($$$$) -{ -my($file,$offset,$num,$bits)=@_; - - for (my $byte=0;$byte<$bits/8;$byte++) { - confess if !defined $offset; - $file->[$offset+$byte]=($num>>($byte*8))&0xFF; - } -} -sub uint32_put($$$) { return uintX_put($_[0],$_[1],$_[2],32); } -sub uint16_put($$$) { return uintX_put($_[0],$_[1],$_[2],16); } -sub uint8_put($$$) { return uintX_put($_[0],$_[1],$_[2], 8); } -sub uint32_push($$) { return uintX_put($_[0],@{$_[0]},$_[1],32); } -sub uint16_push($$) { return uintX_put($_[0],@{$_[0]},$_[1],16); } -sub uint8_push($$) { return uintX_put($_[0],@{$_[0]},$_[1], 8); } - - -sub sum_offs($) -{ -my($file)=@_; - - return uint32_get($file,0x3C) # 3c: Offset to extended header - +0x18 # OptionalHeader - +0x40; # CheckSum -} - -sub sum_get($) -{ -my($file)=@_; - - return uint32_get($file,sum_offs($file)); -} - -sub sum_put($$) -{ -my($file,$sum)=@_; - - return uint32_put($file,sum_offs($file),$sum); -} - -sub sum_calc($) -{ -my($file)=@_; - - $file=[ @$file ]; - sum_put($file,0); - my $length=@$file; - my $sum=0; - while (@$file) { - $sum+=(shift @$file || 0) | (shift @$file || 0)<<8; - $sum=($sum&0xFFFF)+($sum>>16); - } - $sum+=$length; - return $sum; -} - -sub align($$) -{ -my($file,$align)=@_; - - push @$file,0 while @$file%$align; -} - -sub stringz_put($$$) -{ -my($file,$offset,$stringz)=@_; - - $stringz=[ map({ ord(); } split //,$stringz),0 ]; - while (@$stringz) { - uint8_put($file,$offset,shift @$stringz); - $offset++; - } -} - -sub stringz_push($$) -{ -my($file,$stringz)=@_; - - stringz_put($file,@$file,$stringz); - align $file,4; -} - -sub stringz_get($$) -{ -my($file,$offset)=@_; - - my $r=""; - while ((my $ord=uint8_get($file,$offset))) { - $r.=chr $ord; - $offset++; - } - return $r; -} - -sub zeroes_push($$) -{ -my($file,$count)=@_; - - push @$file,0 while $count-->0; -} - -sub SizeOfImage_offs($) -{ -my($file)=@_; - - return uint32_get($file,0x3C) # 3c: Offset to extended header - +0x18 # OptionalHeader - +0x38; # SizeOfImage -} - -my $align=0x80; - -sub sanity($$) -{ -my($file,$file_id)=@_; - - my $calced=sum_calc($file); - if ($calced!=sum_get($file)) { - warn sprintf "$file_id: Original checksum wrong: found=0x%08X, calced=0x%08X",sum_get($file),$calced; - } - - die sprintf "$file_id: Length 0x%X not aligned",scalar(@$file) if @$file%$align; - my $SizeOfImage=uint32_get($file,SizeOfImage_offs($file)); - die sprintf "$file_id: SizeOfImage==0x%X but file size==0x%X",$SizeOfImage,scalar(@$file) if $SizeOfImage!=@$file; -} - -sub export_names_get($) -{ -my($tracefs)=@_; - - my $EXPORT_DIRECTORY_offs=uint32_get($tracefs,0x3C) # 3c: Offset to extended header - +0x18 # OptionalHeader - +0x60 # DataDirectory - +$IMAGE_FILE_EXPORT_DIRECTORY*$IMAGE_DATA_DIRECTORY_sizeof; - my $EXPORT_DIRECTORY_VirtualAddress=uint32_get($tracefs,$EXPORT_DIRECTORY_offs+$VirtualAddress_rel_to_DATA_DIRECTORY_offs); - my $EXPORT_DIRECTORY_Size=uint32_get($tracefs,$EXPORT_DIRECTORY_offs+$Size_rel_to_DATA_DIRECTORY_offs); - die sprintf "EXPORT_DIRECTORY_Size 0x%X less than IMAGE_IMPORT_DESCRIPTOR_sizeof 0x%X", - $EXPORT_DIRECTORY_Size,$IMAGE_IMPORT_DESCRIPTOR_sizeof if $EXPORT_DIRECTORY_Size<$IMAGE_IMPORT_DESCRIPTOR_sizeof; - my $IMAGE_EXPORT_DIRECTORY_Name=uint32_get($tracefs,$EXPORT_DIRECTORY_VirtualAddress - +$Name_rel_to_IMAGE_EXPORT_DIRECTORY_offs); - my $tracefs_export_name=stringz_get($tracefs,$IMAGE_EXPORT_DIRECTORY_Name); - my $tracefs_export_names_num=uint32_get($tracefs,$EXPORT_DIRECTORY_VirtualAddress - +$NumberOfNames_rel_to_IMAGE_EXPORT_DIRECTORY_offs); - my $tracefs_export_AddressOfNames=uint32_get($tracefs,$EXPORT_DIRECTORY_VirtualAddress - +$AddressOfNames_rel_to_IMAGE_EXPORT_DIRECTORY_offs); - my @tracefs_export_names; - print STDERR "$tracefs_export_name exports:\n" if $D; - for (my $namei=0;$namei<$tracefs_export_names_num;$namei++) { - my $name_address=uint32_get($tracefs,$tracefs_export_AddressOfNames+4*$namei); - my $name=stringz_get($tracefs,$name_address); - push @tracefs_export_names,$name; - print STDERR "\t$name\n" if $D; - } - - return ($tracefs_export_name,@tracefs_export_names); -} - - -undef $/; -my $file=[ map({ ord(); } split //,<>) ]; -my $tracefs=[ map({ ord(); } split //,<>) ]; - -sanity($tracefs,"tracefs"); -my($tracefs_export_name,@tracefs_export_names)=export_names_get($tracefs); -for my $tname (@tracefs_export_names) { - die "tracefs exported tname is not /^T/ compliant: $tname" if $tname!~/^T/; - } -# FIXME: compiled to .sys tracefs contains internal export name .dll but we need import .sys ! -$tracefs_export_name=~s/[.]dll$/.sys/i; - -sanity($file,"file"); - - -# import directory load - -my $IMPORT_DIRECTORY_offs=uint32_get($file,0x3C) # 3c: Offset to extended header - +0x18 # OptionalHeader - +0x60 # DataDirectory - +$IMAGE_FILE_IMPORT_DIRECTORY*$IMAGE_DATA_DIRECTORY_sizeof; -my $IMPORT_DIRECTORY_VirtualAddress=uint32_get($file,$IMPORT_DIRECTORY_offs+$VirtualAddress_rel_to_DATA_DIRECTORY_offs); -my $IMPORT_DIRECTORY_Size=uint32_get($file,$IMPORT_DIRECTORY_offs+$Size_rel_to_DATA_DIRECTORY_offs); -die sprintf "IMPORT_DIRECTORY_Size 0x%X not aligned to IMAGE_IMPORT_DESCRIPTOR_sizeof 0x%X", - $IMPORT_DIRECTORY_Size,$IMAGE_IMPORT_DESCRIPTOR_sizeof if $IMPORT_DIRECTORY_Size%$IMAGE_IMPORT_DESCRIPTOR_sizeof; - -my $IMPORT_DIRECTORY=[ @{$file}[$IMPORT_DIRECTORY_VirtualAddress - ..($IMPORT_DIRECTORY_VirtualAddress+$IMPORT_DIRECTORY_Size-1)] ]; -uintX_put($file,$IMPORT_DIRECTORY_VirtualAddress,0,8*$IMPORT_DIRECTORY_Size); # zero the original space -for (my $zerotail=0;$zerotail<$IMAGE_IMPORT_DESCRIPTOR_sizeof;$zerotail++) { - die "IMPORT_DIRECTORY tail not zeroed" if pop @$IMPORT_DIRECTORY; - } - - -# import directory entries processing - -my %name_to_FirstThunk; # name->FirstThunk -my %tname_to_name; # string->string{^.->T} -for ( - my $IMPORT_DIRECTORY_offset=0; - $IMPORT_DIRECTORY_offset<@$IMPORT_DIRECTORY; - $IMPORT_DIRECTORY_offset+=$IMAGE_IMPORT_DESCRIPTOR_sizeof) { - my $OriginalFirstThunk_base=uint32_get($IMPORT_DIRECTORY,$IMPORT_DIRECTORY_offset - +$OriginalFirstThunk_rel_to_IMPORT_DIRECTORY_offs); - my $FirstThunk_base=uint32_get($IMPORT_DIRECTORY,$IMPORT_DIRECTORY_offset - +$FirstThunk_rel_to_IMPORT_DIRECTORY_offs); - for (my $OriginalFirstThunk=$OriginalFirstThunk_base;;$OriginalFirstThunk+=4) { - my $AddressOfData=uint32_get($file,$OriginalFirstThunk); - last if !$AddressOfData; - my $name=stringz_get($file,$AddressOfData+$Name_rel_to_IMAGE_IMPORT_BY_NAME_offs); - print STDERR "import $name\n" if $D; - die "Invalid name import as it has leading 'T': $name" if $name=~/^T/; - (my $tname=$name)=~s/^./T/; - die "Name conflict in tname map: $name->$tname" if exists $tname_to_name{$tname}; - $tname_to_name{$tname}=$name; - die if exists $name_to_FirstThunk{$name}; - $name_to_FirstThunk{$name}=$FirstThunk_base+($OriginalFirstThunk-$OriginalFirstThunk_base); - } - } - - -# add-on import directories generation -my $addon_section_base=@$file; - -my $tracefs_export_name_offs=@$file; -stringz_push($file,$tracefs_export_name); - -my $ordinal=1; -for my $tname (@tracefs_export_names) { - do { warn "tracefs exported tname $tname not found in imports"; next; } if !exists $tname_to_name{$tname}; - my $name=$tname_to_name{$tname}; - my $FirstThunk=$name_to_FirstThunk{$name}; - - my $IMAGE_IMPORT_BY_NAME_offs=@$file; - uint16_push($file,$ordinal++); # Hint - stringz_push($file,$tname); # Name - - my $OriginalFirstThunk_offs=@$file; - uint32_push($file,$IMAGE_IMPORT_BY_NAME_offs); - uint32_push($file,0); # zero terminator - - uint32_push($IMPORT_DIRECTORY,$OriginalFirstThunk_offs); - uint32_push($IMPORT_DIRECTORY,0); # TimeDateStamp - uint32_push($IMPORT_DIRECTORY,0); # ForwarderChain - uint32_push($IMPORT_DIRECTORY,$tracefs_export_name_offs); # Name - uint32_push($IMPORT_DIRECTORY,$FirstThunk); - } - -zeroes_push $IMPORT_DIRECTORY,$IMAGE_IMPORT_DESCRIPTOR_sizeof; -uint32_put($file,$IMPORT_DIRECTORY_offs+$VirtualAddress_rel_to_DATA_DIRECTORY_offs,scalar(@$file)); -uint32_put($file,$IMPORT_DIRECTORY_offs+$Size_rel_to_DATA_DIRECTORY_offs,scalar(@$IMPORT_DIRECTORY)); -push @$file,@$IMPORT_DIRECTORY; - - -# rebuild the sections for add-on data -align $file,$align; -# concatenate .rdata to .data -my $SizeOfOptionalHeader_offs=uint32_get($file,0x3C) # 3c: Offset to extended header - +0x04 # FileHeader - +0x10; # SizeOfOptionalHeader -my $SizeOfOptionalHeader=uint16_get($file,$SizeOfOptionalHeader_offs); -my $NumberOfSections_offs=uint32_get($file,0x3C) # 3c: Offset to extended header - +0x04 # FileHeader - +0x2; # NumberOfSections -my $NumberOfSections=uint16_get($file,$NumberOfSections_offs); -my $IMAGE_SECTION_HEADER_offs=uint32_get($file,0x3C) # 3c: Offset to extended header - +0x18 # OptionalHeader - +$SizeOfOptionalHeader; - -my($offset_data,$offset_rdata); -for ( - my $IMAGE_SECTION_HEADER_offset=$IMAGE_SECTION_HEADER_offs; - $IMAGE_SECTION_HEADER_offset<$IMAGE_SECTION_HEADER_offs+$NumberOfSections*$IMAGE_SECTION_HEADER_sizeof; - $IMAGE_SECTION_HEADER_offset+=$IMAGE_SECTION_HEADER_sizeof) { - my $VirtualAddress=uint32_get($file,$IMAGE_SECTION_HEADER_offset+$VirtualAddress_rel_to_IMAGE_SECTION_HEADER_offs); - my $PointerToRawData=uint32_get($file,$IMAGE_SECTION_HEADER_offset+$PointerToRawData_rel_to_IMAGE_SECTION_HEADER_offs); - die sprintf "VirtualAddress 0x%X != PointerToRawData 0x%X in IMAGE_SECTION_HEADER at 0x%X", - $VirtualAddress,$PointerToRawData,$IMAGE_SECTION_HEADER_offset if $VirtualAddress!=$PointerToRawData; - my $SizeOfRawData=uint32_get($file,$IMAGE_SECTION_HEADER_offset+$SizeOfRawData_rel_to_IMAGE_SECTION_HEADER_offs); - my $VirtualSize=uint32_get($file,$IMAGE_SECTION_HEADER_offset+$VirtualSize_rel_to_IMAGE_SECTION_HEADER_offs); - $VirtualSize+=$align-1; - $VirtualSize-=$VirtualSize%$align; - die sprintf "up_align(VirtualSize,0x%X) 0x%X != SizeOfRawData 0x%X in IMAGE_SECTION_HEADER at 0x%X", - $align,$VirtualSize.$SizeOfRawData,$IMAGE_SECTION_HEADER_offset if $VirtualSize!=$SizeOfRawData; - my $Characteristics=uint32_get($file,$IMAGE_SECTION_HEADER_offset+$Characteristics_rel_to_IMAGE_SECTION_HEADER_offs); - my $is_data =($Characteristics==0xC8000040); - my $is_rdata=($Characteristics==0x48000040); - die sprintf "Duplicate .data in IMAGE_SECTION_HEADER at 0x%X",$IMAGE_SECTION_HEADER_offset if $is_data && $offset_data; - die sprintf "Duplicate .rdata in IMAGE_SECTION_HEADER at 0x%X",$IMAGE_SECTION_HEADER_offset if $is_rdata && $offset_rdata; - $offset_data=$IMAGE_SECTION_HEADER_offset if $is_data; - $offset_rdata=$IMAGE_SECTION_HEADER_offset if $is_rdata; - } -die ".data section not found" if !$offset_data; -die ".rdata section not found" if !$offset_rdata; -my $data_PointerToRawData=uint32_get($file,$offset_data+$PointerToRawData_rel_to_IMAGE_SECTION_HEADER_offs); -my $data_SizeOfRawData=uint32_get($file,$offset_data+$SizeOfRawData_rel_to_IMAGE_SECTION_HEADER_offs); -my $data_VirtualSize=uint32_get($file,$offset_data+$VirtualSize_rel_to_IMAGE_SECTION_HEADER_offs); -my $rdata_PointerToRawData=uint32_get($file,$offset_rdata+$PointerToRawData_rel_to_IMAGE_SECTION_HEADER_offs); -my $rdata_SizeOfRawData=uint32_get($file,$offset_rdata+$SizeOfRawData_rel_to_IMAGE_SECTION_HEADER_offs); -my $rdata_VirtualSize=uint32_get($file,$offset_rdata+$VirtualSize_rel_to_IMAGE_SECTION_HEADER_offs); -die ".data is not right after .rdata" if $rdata_PointerToRawData+$rdata_SizeOfRawData!=$data_PointerToRawData; -uint32_put($file,$offset_data+$PointerToRawData_rel_to_IMAGE_SECTION_HEADER_offs,$rdata_PointerToRawData); -uint32_put($file,$offset_data+$VirtualAddress_rel_to_IMAGE_SECTION_HEADER_offs,$rdata_PointerToRawData); -uint32_put($file,$offset_data+$SizeOfRawData_rel_to_IMAGE_SECTION_HEADER_offs,$rdata_SizeOfRawData+$data_SizeOfRawData); -uint32_put($file,$offset_data+$VirtualSize_rel_to_IMAGE_SECTION_HEADER_offs,$rdata_SizeOfRawData+$data_VirtualSize); -# .rdata coalesced to .data, .rdata to be rebuilt now: -uintX_put($file,$offset_rdata,0,8*$IMAGE_SECTION_HEADER_sizeof); # zero the original space -stringz_put($file,$offset_rdata+$Name_rel_to_IMAGE_SECTION_HEADER_offs,"INIT"); -uint32_put($file,$offset_rdata+$VirtualSize_rel_to_IMAGE_SECTION_HEADER_offs,@$file-$addon_section_base); -uint32_put($file,$offset_rdata+$VirtualAddress_rel_to_IMAGE_SECTION_HEADER_offs,$addon_section_base); -uint32_put($file,$offset_rdata+$SizeOfRawData_rel_to_IMAGE_SECTION_HEADER_offs,@$file-$addon_section_base); -uint32_put($file,$offset_rdata+$PointerToRawData_rel_to_IMAGE_SECTION_HEADER_offs,$addon_section_base); -uint32_put($file,$offset_rdata+$Characteristics_rel_to_IMAGE_SECTION_HEADER_offs,0xE2000020); - - -# file output finalization -uint32_put($file,SizeOfImage_offs($file),scalar(@$file)); -sum_put($file,sum_calc($file)); -print join("",map({ chr; } @$file)); diff --git a/src/client/Makefile.am b/src/client/Makefile.am deleted file mode 100644 index 54221a6..0000000 --- a/src/client/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -# $Id$ -# automake source listing subdirs of all client sources -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -SUBDIRS=cmdline sandbox-server lufs fuse gnomevfs bug-replay diff --git a/src/client/bug-replay/Makefile.am b/src/client/bug-replay/Makefile.am deleted file mode 100644 index 613ada2..0000000 --- a/src/client/bug-replay/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# $Id$ -# automake source for developer replaying of bugreport snapshots -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -captive_bug_replay_SOURCES= \ - main.c -captive_bug_replay_CFLAGS= $(LIBXML_CFLAGS) $(GNOME_VFS_CFLAGS) -captive_bug_replay_LDADD =$(captive_library) $(LIBXML_LIBS) $(GNOME_VFS_LIBS) - -if ENABLE_BUG_REPLAY -captive_bug_replay_cond=captive-bug-replay -endif -bin_PROGRAMS+=$(captive_bug_replay_cond) diff --git a/src/client/bug-replay/main.c b/src/client/bug-replay/main.c deleted file mode 100644 index 2c4b5cf..0000000 --- a/src/client/bug-replay/main.c +++ /dev/null @@ -1,538 +0,0 @@ -/* $Id$ - * developer replaying of bugreport snapshots - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include /* for g_type_init() */ -#include - -#include -#include -#include -#include -#include "../../libcaptive/client/giochannel-blind.h" /* FIXME: pathname */ -#include -#include -#include - - -static gchar *optarg_module_path; - -static const struct poptOption popt_table[]={ -#define BUG_REPLAY_POPT(longname,argInfoP,argP,descripP,argDescripP) \ - { \ - longName: (longname), \ - shortName: 0, \ - argInfo: (argInfoP), \ - arg: (void *)argP, \ - val: 0, \ - descrip: (descripP), \ - argDescrip: (argDescripP), \ - } - - BUG_REPLAY_POPT("module-path",POPT_ARG_STRING,&optarg_module_path,N_("Disk path for W32 modules and filesystem"),N_("path")), - -#undef BUG_REPLAY_POPT - POPT_AUTOHELP - POPT_TABLEEND - }; - - -static void object_hash_key_destroy_func(const xmlChar *xml_object) -{ - g_return_if_fail(xml_object!=NULL); - - xmlFree((xmlChar *)xml_object); -} - -static void object_hash_value_destroy_func(GObject *captive_any_object) -{ - g_return_if_fail(G_IS_OBJECT(captive_any_object)); - - g_object_unref(captive_any_object); -} - - -int main(int argc,char **argv) -{ -poptContext context; -int errint; -const char **cmd_argv; -struct captive_options options; -xmlTextReader *xml_reader; -GList *action_list; /* of 'xmlNode *' */ -gboolean preread; -gboolean module_is_filesystem=FALSE; -CaptiveVfsObject *captive_vfs_object; -gboolean action_is_first; -xmlNode *xml_node; -GHashTable *object_hash; -GObject *object; -gboolean errbool; -CaptiveDirectoryObject *captive_directory_object; -CaptiveFileObject *captive_file_object; -GnomeVFSResult errgnomevfsresult; -struct captive_libxml_string_drop_stack *drop_stack=NULL; -const gchar *xml_object; - - captive_standalone_init(); - - captive_options_init(&options); - - context=poptGetContext( - PACKAGE, /* name */ - argc,(/*en-const*/const char **)argv, /* argc,argv */ - popt_table, /* options */ - POPT_CONTEXT_POSIXMEHARDER); /* flags; && !POPT_CONTEXT_KEEP_FIRST */ - if (context==NULL) { - g_assert_not_reached(); /* argument recognization args_error */ - return EXIT_FAILURE; - } - errint=poptReadDefaultConfig(context, - TRUE); /* useEnv */ - if (errint!=0) { - g_assert_not_reached(); /* argument recognization args_error */ - return EXIT_FAILURE; - } - errint=poptGetNextOpt(context); - if (errint!=-1) { - g_assert_not_reached(); /* some non-callbacked argument reached */ - return EXIT_FAILURE; - } - cmd_argv=poptGetArgs(context); - - if (!cmd_argv || !cmd_argv[0] || cmd_argv[1]) { - g_error("Exactly one argument required - pathname to .captivebug.xml.gz bugreport to replay"); - return EXIT_FAILURE; - } - - options.rwmode=CAPTIVE_OPTION_RWMODE_BLIND; - options.debug_messages=TRUE; - - options.image_iochannel=NULL; - action_list=NULL; - options.media=CAPTIVE_OPTION_MEDIA_UNKNOWN; - - xml_reader=xmlNewTextReaderFilename(cmd_argv[0]); - g_assert(xml_reader!=NULL); - preread=FALSE; - while (preread || 1==xmlTextReaderRead(xml_reader)) { - preread=FALSE; - switch (xmlTextReaderNodeType(xml_reader)) { - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_COMMENT: - break; - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_SIGNIFICANT_WHITESPACE: - break; - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_TEXT: /* Even empty nodes have some '#text'. */ - break; - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_END: /* We do not track tag ends. */ - break; - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_START: { -const xmlChar *xml_name; - - xml_name=xmlTextReaderName(xml_reader); - /**/ if (!xmlStrcmp(xml_name,BAD_CAST "bug")) { /* root tag */ - } - else if (!xmlStrcmp(xml_name,BAD_CAST "captive")) { -const gchar *xml_captive_version; - - xml_captive_version=captive_libxml_string_drop(&drop_stack,xmlTextReaderGetAttribute(xml_reader,BAD_CAST "version")); - g_assert(xml_captive_version!=NULL); - g_assert(!strcmp(xml_captive_version,VERSION)); - } - else if (!xmlStrcmp(xml_name,BAD_CAST "filesystem")) { /* contains */ - module_is_filesystem=TRUE; - } - else if (!xmlStrcmp(xml_name,BAD_CAST "load_module")) { /* contains */ - module_is_filesystem=FALSE; - } - else if (!xmlStrcmp(xml_name,BAD_CAST "module")) { -const gchar *xml_module_basename; -struct captive_options_module *options_module; -gboolean errbool; - - if (module_is_filesystem) - options_module=&options.filesystem; - else { - captive_new(options_module); - options.load_module=g_list_append(options.load_module,options_module); - } - xml_module_basename=captive_libxml_string_drop(&drop_stack,xmlTextReaderGetAttribute(xml_reader,BAD_CAST "basename")); - g_assert(xml_module_basename!=NULL); - g_assert(strchr(xml_module_basename,'/')==NULL); /* a bit of security */ - errbool=captive_options_module_load(options_module, - captive_printf_alloca("%s/%s", - (optarg_module_path ? optarg_module_path : "."),xml_module_basename)); - g_assert(errbool==TRUE); - switch (options_module->type) { - case CAPTIVE_OPTIONS_MODULE_TYPE_PE32: { -const gchar *xml_module_md5,*xml_module_length; - - if (options_module->u.pe32.md5 - && (xml_module_md5=captive_libxml_string_drop(&drop_stack,xmlTextReaderGetAttribute(xml_reader,BAD_CAST "version")))) - g_assert(!strcmp(xml_module_md5,options_module->u.pe32.md5)); - if ((xml_module_length=captive_libxml_string_drop(&drop_stack,xmlTextReaderGetAttribute(xml_reader,BAD_CAST "length")))) - g_assert(!strcmp(xml_module_length, - captive_printf_alloca("%lu",(unsigned long)options_module->u.pe32.length))); - } break; - case CAPTIVE_OPTIONS_MODULE_TYPE_GMODULE: - /* No possibility to check anything. */ - break; - default: g_assert_not_reached(); - } - } - else if (!xmlStrcmp(xml_name,BAD_CAST "action")) { -int xml_action_depth; -gboolean action_done,action_preread; - - g_assert(action_list==NULL); - xml_action_depth=xmlTextReaderDepth(xml_reader); - action_preread=FALSE; - action_done=FALSE; - while (!action_done) { - if (!action_preread) { - errint=xmlTextReaderRead(xml_reader); - g_assert(errint==1); - } - action_preread=FALSE; - g_assert(xml_action_depth<=xmlTextReaderDepth(xml_reader)); - switch (xmlTextReaderNodeType(xml_reader)) { - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_COMMENT: - break; - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_SIGNIFICANT_WHITESPACE: - break; - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_TEXT: /* Even empty nodes have some '#text'. */ - break; - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_END: { /* We do not track tag ends. */ - if ((action_done=(xml_action_depth==xmlTextReaderDepth(xml_reader)))) { -const gchar *xml_name_end; - - xml_name_end=captive_libxml_string_drop(&drop_stack,xmlTextReaderName(xml_reader)); - g_assert(!strcmp(xml_name_end,"action")); - } - } break; - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_START: { -xmlNode *xml_node; - - xml_node=xmlTextReaderExpand(xml_reader); - g_assert(xml_node!=NULL); - xml_node=xmlCopyNode(xml_node, - 1); /* recursive */ - errint=xmlTextReaderNext(xml_reader); - g_assert(errint==1); - action_preread=TRUE; - action_list=g_list_prepend(action_list,xml_node); /* we are prepending to be effective */ - } break; - default: g_assert_not_reached(); - } - } - } - else if (!xmlStrcmp(xml_name,BAD_CAST "media")) { -const xmlChar *xml_media_end_name,*xml_media_type; - - g_assert(options.image_iochannel==NULL); - options.image_iochannel=(GIOChannel *)captive_giochannel_blind_new_from_xml(xml_reader); - g_assert(CAPTIVE_XML_TEXT_READER_NODE_TYPE_END==xmlTextReaderNodeType(xml_reader)); - xml_media_end_name=xmlTextReaderName(xml_reader); - g_assert(xml_media_end_name!=NULL); - g_assert(!xmlStrcmp(xml_media_end_name,BAD_CAST "media")); - xmlFree((xmlChar *)xml_media_end_name); - xml_media_type=xmlTextReaderGetAttribute(xml_reader,BAD_CAST "type"); - g_assert(xml_media_type!=NULL); - /**/ if (!xmlStrcmp(xml_media_type,BAD_CAST "cdrom")) - options.media=CAPTIVE_OPTION_MEDIA_CDROM; - else if (!xmlStrcmp(xml_media_type,BAD_CAST "disk")) - options.media=CAPTIVE_OPTION_MEDIA_DISK; - else g_assert_not_reached(); - xmlFree((xmlChar *)xml_media_type); - } - else if (!xmlStrcmp(xml_name,BAD_CAST "log")) { - errint=xmlTextReaderNext(xml_reader); - g_assert(errint==1); - preread=TRUE; - } - else g_error("Unknown START node: %s",xml_name); - xmlFree((xmlChar *)xml_name); - } break; - - default: g_assert_not_reached(); - } - captive_libxml_string_drop_flush(&drop_stack); - } - xmlFreeTextReader(xml_reader); - - g_assert(options.image_iochannel!=NULL); - action_list=g_list_reverse(action_list); /* we were g_list_prepend()ing for effectivity */ - g_assert(options.media!=CAPTIVE_OPTION_MEDIA_UNKNOWN); - - if (GNOME_VFS_OK!=captive_vfs_new(&captive_vfs_object,&options)) { - g_error(_("captive_vfs_new() failed")); - return EXIT_FAILURE; - } - captive_options_free(&options); - - /* 'cmd_argv' gets cleared by 'poptFreeContext(context);' below */ - poptFreeContext(context); - - object_hash=g_hash_table_new_full( - g_str_hash, /* hash_func */ - g_str_equal, /* key_equal_func */ - (GDestroyNotify)object_hash_key_destroy_func, /* key_destroy_func */ - (GDestroyNotify)object_hash_value_destroy_func); /* value_destroy_func */ - - for ( - action_is_first=TRUE; - action_list; - xmlFreeNode(xml_node),action_is_first=FALSE) { - - captive_libxml_string_drop_flush(&drop_stack); - -#define GET_PROP_STRING(prop_name) ({ \ - const gchar *_get_prop_string_r=captive_libxml_string_drop(&drop_stack,xmlGetProp(xml_node,BAD_CAST (prop_name))); \ - g_assert(_get_prop_string_r!=NULL); \ - _get_prop_string_r; \ - }) -#define GET_PROP_GINT64(prop_name) (captive_libxml_sscanf_gint64(GET_PROP_STRING((prop_name)))) - - xml_node=action_list->data; - g_assert(xml_node!=NULL); - action_list=g_list_delete_link(action_list,action_list); - g_message("replay action: %s()",xml_node->name); - xml_object=GET_PROP_STRING("object"); - object=g_hash_table_lookup(object_hash,xml_object); - g_assert(object==NULL || G_IS_OBJECT(object)); - - if (!xmlStrcmp(xml_node->name,BAD_CAST "vfs_new")) { - g_assert(action_is_first==TRUE); - g_assert(captive_vfs_object!=NULL); - g_assert(object==NULL); - g_hash_table_insert(object_hash,g_strdup(xml_object),captive_vfs_object); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "vfs_commit")) { - g_assert(action_is_first==TRUE); - g_assert(captive_vfs_object!=NULL); - g_assert(object==NULL); - g_hash_table_insert(object_hash,g_strdup(xml_object),captive_vfs_object); - continue; - } - g_assert(action_is_first==FALSE); - if (!xmlStrcmp(xml_node->name,BAD_CAST "vfs_close")) { - g_assert(captive_vfs_object!=NULL); - g_assert(CAPTIVE_VFS_OBJECT(object)==captive_vfs_object); - errbool=g_hash_table_remove(object_hash,xml_object); /* g_object_unref() by object_hash_value_destroy_func() */ - g_assert(errbool==TRUE); - continue; - } - g_assert(captive_vfs_object!=NULL); - if (!xmlStrcmp(xml_node->name,BAD_CAST "vfs_volume_info_get")) { -CaptiveVfsVolumeInfo volume_info; - - errgnomevfsresult=captive_vfs_volume_info_get(captive_vfs_object,&volume_info); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - - /* DIRECTORY */ - if (!xmlStrcmp(xml_node->name,BAD_CAST "directory_new_open")) { - g_assert(object==NULL); - errgnomevfsresult=captive_directory_new_open(&captive_directory_object,captive_vfs_object, - GET_PROP_STRING("pathname")); - g_assert((errgnomevfsresult==GNOME_VFS_OK)==GET_PROP_GINT64("result")); - if (errgnomevfsresult==GNOME_VFS_OK) - g_hash_table_insert(object_hash,g_strdup(xml_object),captive_directory_object); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "directory_new_make")) { - g_assert(object==NULL); - errgnomevfsresult=captive_directory_new_make(&captive_directory_object,captive_vfs_object, - GET_PROP_STRING("pathname"), - GET_PROP_GINT64("perm")); - g_assert((errgnomevfsresult==GNOME_VFS_OK)==GET_PROP_GINT64("result")); - if (errgnomevfsresult==GNOME_VFS_OK) - g_hash_table_insert(object_hash,g_strdup(xml_object),captive_directory_object); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "directory_close")) { - captive_directory_object=CAPTIVE_DIRECTORY_OBJECT(object); - errbool=g_hash_table_remove(object_hash,xml_object); /* g_object_unref() by object_hash_value_destroy_func() */ - g_assert(errbool==TRUE); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "directory_read")) { -GnomeVFSFileInfo file_info; - - captive_directory_object=CAPTIVE_DIRECTORY_OBJECT(object); - errgnomevfsresult=captive_directory_read(captive_directory_object,&file_info); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "directory_remove")) { - captive_directory_object=CAPTIVE_DIRECTORY_OBJECT(object); - errgnomevfsresult=captive_directory_remove(captive_directory_object); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - - /* FILE */ - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_new_open")) { - g_assert(object==NULL); - errgnomevfsresult=captive_file_new_open(&captive_file_object,captive_vfs_object, - GET_PROP_STRING("pathname"), - GET_PROP_GINT64("mode")); - g_assert((errgnomevfsresult==GNOME_VFS_OK)==GET_PROP_GINT64("result")); - if (errgnomevfsresult==GNOME_VFS_OK) - g_hash_table_insert(object_hash,g_strdup(xml_object),captive_file_object); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_new_create")) { - g_assert(object==NULL); - errgnomevfsresult=captive_file_new_create(&captive_file_object,captive_vfs_object, - GET_PROP_STRING("pathname"), - GET_PROP_GINT64("mode"), - GET_PROP_GINT64("exclusive"), - GET_PROP_GINT64("perm")); - g_assert((errgnomevfsresult==GNOME_VFS_OK)==GET_PROP_GINT64("result")); - if (errgnomevfsresult==GNOME_VFS_OK) - g_hash_table_insert(object_hash,g_strdup(xml_object),captive_file_object); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_close")) { - captive_file_object=CAPTIVE_FILE_OBJECT(object); - errbool=g_hash_table_remove(object_hash,xml_object); /* g_object_unref() by object_hash_value_destroy_func() */ - g_assert(errbool==TRUE); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_read")) { -gpointer buffer; -GnomeVFSFileSize num_bytes,bytes_read; - - captive_file_object=CAPTIVE_FILE_OBJECT(object); - num_bytes=GET_PROP_GINT64("num_bytes"); - buffer=g_malloc(num_bytes); - errgnomevfsresult=captive_file_read(captive_file_object,buffer,num_bytes,&bytes_read); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - if (errgnomevfsresult==GNOME_VFS_OK) - g_assert((gint64)bytes_read==GET_PROP_GINT64("bytes_read_return")); - g_free(buffer); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_write")) { -gpointer buffer; -GnomeVFSFileSize num_bytes,bytes_written; - - captive_file_object=CAPTIVE_FILE_OBJECT(object); - num_bytes=GET_PROP_GINT64("num_bytes"); - buffer=g_malloc(num_bytes); - memset(buffer,'X',num_bytes); /* FIXME: better pattern */ - errgnomevfsresult=captive_file_write(captive_file_object,buffer,num_bytes,&bytes_written); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - if (errgnomevfsresult==GNOME_VFS_OK) - g_assert((gint64)bytes_written==GET_PROP_GINT64("bytes_written_return")); - g_free(buffer); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_seek")) { -GnomeVFSSeekPosition whence=GNOME_VFS_SEEK_START; /* Prevent: ... might be used uninitialized in this function */ -const gchar *whence_string; - - captive_file_object=CAPTIVE_FILE_OBJECT(object); - whence_string=GET_PROP_STRING("whence"); - /**/ if (!strcmp(whence_string,"start" )) whence=GNOME_VFS_SEEK_START; - else if (!strcmp(whence_string,"current")) whence=GNOME_VFS_SEEK_CURRENT; - else if (!strcmp(whence_string,"end" )) whence=GNOME_VFS_SEEK_END; - else g_assert_not_reached(); - errgnomevfsresult=captive_file_seek(captive_file_object,whence, - GET_PROP_GINT64("offset")); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_tell")) { -GnomeVFSFileOffset offset; - - captive_file_object=CAPTIVE_FILE_OBJECT(object); - errgnomevfsresult=captive_file_tell(captive_file_object,&offset); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - if (errgnomevfsresult==GNOME_VFS_OK) - g_assert((gint64)offset==GET_PROP_GINT64("offset")); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_remove")) { - captive_file_object=CAPTIVE_FILE_OBJECT(object); - errgnomevfsresult=captive_file_remove(captive_file_object); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_file_info_get")) { -GnomeVFSFileInfo file_info; - - captive_file_object=CAPTIVE_FILE_OBJECT(object); - errgnomevfsresult=captive_file_file_info_get(captive_file_object,&file_info); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_file_info_set")) { -GnomeVFSFileInfo file_info; - - captive_file_object=CAPTIVE_FILE_OBJECT(object); - /* FIXME: We do not have 'file_info' content in the bug file! */ - errgnomevfsresult=captive_file_file_info_get(captive_file_object,&file_info); - g_assert(errgnomevfsresult==GNOME_VFS_OK); - errgnomevfsresult=captive_file_file_info_set(captive_file_object,&file_info, - GET_PROP_GINT64("mask")); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_truncate")) { - captive_file_object=CAPTIVE_FILE_OBJECT(object); - errgnomevfsresult=captive_file_truncate(captive_file_object, - GET_PROP_GINT64("file_size")); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - if (!xmlStrcmp(xml_node->name,BAD_CAST "file_move")) { - captive_file_object=CAPTIVE_FILE_OBJECT(object); - errgnomevfsresult=captive_file_move(captive_file_object, - GET_PROP_STRING("pathname_new"), - GET_PROP_GINT64("force_replace")); - g_assert(!strcmp(gnome_vfs_result_to_string(errgnomevfsresult),GET_PROP_STRING("result"))); - continue; - } - - g_error("Unknown action: %s()",xml_node->name); - -#undef GET_PROP_GINT64 -#undef GET_PROP_STRING - } - - g_error("All actions were processed, no vfs_close() found"); - return EXIT_FAILURE; -} diff --git a/src/client/cmdline/Makefile.am b/src/client/cmdline/Makefile.am deleted file mode 100644 index b456c70..0000000 --- a/src/client/cmdline/Makefile.am +++ /dev/null @@ -1,76 +0,0 @@ -# $Id$ -# automake source for development tests by command-line libcaptive client -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -captive_cmdline_SOURCES= \ - cmd_cd.c \ - cmd_cd.h \ - cmd_close.c \ - cmd_close.h \ - cmd_commit.c \ - cmd_commit.h \ - cmd_create.c \ - cmd_create.h \ - cmd_get.c \ - cmd_get.h \ - cmd_help.c \ - cmd_help.h \ - cmd_info.c \ - cmd_info.h \ - cmd_lcd.c \ - cmd_lcd.h \ - cmd_ls.c \ - cmd_ls.h \ - cmd_mkdir.c \ - cmd_mkdir.h \ - cmd_mv.c \ - cmd_mv.h \ - cmd_open.c \ - cmd_open.h \ - cmd_put.c \ - cmd_put.h \ - cmd_quit.c \ - cmd_quit.h \ - cmd_rm.c \ - cmd_rm.h \ - cmd_rmdir.c \ - cmd_rmdir.h \ - cmd_shell.c \ - cmd_shell.h \ - cmd_volume.c \ - cmd_volume.h \ - file_info.c \ - file_info.h \ - handle.c \ - handle.h \ - main.c \ - main.h \ - utf8.c \ - utf8.h -captive_cmdline_CFLAGS= $(GNOME_VFS_CFLAGS) -captive_cmdline_LDADD =$(captive_library) $(GNOME_VFS_LIBS) $(READLINE_LIBS) $(INTLLIBS) -captive_cmdline_LDFLAGS=$(READLINE_LDFLAGS) -bin_PROGRAMS+=captive-cmdline - -EXTRA_DIST+=captive-cmdline.pod.pl.in -CLEANFILES+=captive-cmdline.pod captive-cmdline.1 -if ENABLE_MAN_PAGES -captive_cmdline_man_cond=captive-cmdline.1 -endif -man_MANS=$(captive_cmdline_man_cond) diff --git a/src/client/cmdline/captive-cmdline.pod.pl.in b/src/client/cmdline/captive-cmdline.pod.pl.in deleted file mode 100644 index a1de663..0000000 --- a/src/client/cmdline/captive-cmdline.pod.pl.in +++ /dev/null @@ -1,71 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for captive-cmdline(1) man page -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -my $sbindir='@sbindir@'; -$sbindir=~s#\$\Q{exec_prefix}\E#'@exec_prefix@';#ge; -$sbindir=~s#\$\Q{prefix}\E#'@prefix@';#ge; -$sbindir="/usr/sbin" if $sbindir=~/^@/; - -print <<'POD_EOF'; -=head1 NAME - -@PACKAGE@-cmdline - Command-line client for B<@PACKAGE@>(7) NTFS disk access - - -=head1 SYNOPSIS - -=for man -\fB@PACKAGE@-cmdline\fP \fB--load-module\fP=\fB/tmp/ntoskrnl.exe\fP -.br - \fB--filesystem\fP=\fB/tmp/ntfs.sys\fP -.br -POD_EOF -print "\t\t".'[\fB--sandbox-server\fP=\fB'.$sbindir.'/@PACKAGE@-sandbox-server\fP]'."\n"; -print <<'POD_EOF'; - [\fB--bug-pathname\fP=\fB/tmp/captive-bug-%FT%T.captivebug.xml.gz\fP] - [\fB--disk\fP|\fB--cdrom\fP] [\fB--ro\fP|\fB--blind\fP|\fB--rw\fP] {\fBimage-file\fP|\fBdevice\fP} - - -=head1 DESCRIPTION - -Simple B(1)-like client to access disks by Microsoft Windows drivers. -Use if B(7) not available; also useful during debugging. - - -POD_EOF -require "../../libcaptive/client/options.pod.pl"; -print <<'POD_EOF'; -=head1 SEE ALSO - -B<@PACKAGE@>(7), B(7) - - -=head1 AUTHOR - -Jan Kratochvil >, - I -POD_EOF -1; diff --git a/src/client/cmdline/cmd_cd.c b/src/client/cmdline/cmd_cd.c deleted file mode 100644 index 84bb8e7..0000000 --- a/src/client/cmdline/cmd_cd.c +++ /dev/null @@ -1,123 +0,0 @@ -/* $Id$ - * client cmdline interface command "cd" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cmd_cd.h" /* self */ -#include "main.h" -#include "utf8.h" - - -/* Config: */ -#define STATICS_NUM (5) - - -const gchar *cmdline_cwd; - - -GQuark cmdline_cmd_cd_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-cd"); - - return r; -} - - -const struct poptOption cmd_cd_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -/* Returns: statically allocated absolute pathname string */ -G_CONST_RETURN gchar *cmdline_path_from_cwd(const gchar *relative) -{ -static gchar *statics[STATICS_NUM]; -static int staticsi=0; -gchar *r,*s; - - /* 'relative' may be NULL for the '.' meaning */ - - if (!cmdline_cwd || (relative && *relative==G_DIR_SEPARATOR)) { /* bootstrap or absolute */ - g_assert(g_path_is_absolute(relative)); - s=g_strdup(relative); - } - else if (!relative) - s=g_strdup(cmdline_cwd); - else - s=g_build_filename(cmdline_cwd,relative,NULL); - g_assert(g_path_is_absolute(s)); - - r=captive_path_normalize(s); - g_free(s); - - g_free(statics[staticsi]); - statics[staticsi++]=r; - staticsi%=G_N_ELEMENTS(statics); - - return r; -} - - -void cmd_cd_internal(const gchar *targetdir,GError **errp) -{ -CaptiveDirectoryObject *captive_directory_object; - - g_return_if_fail(targetdir!=NULL); - g_return_if_fail(!errp || !*errp); - - if (!errvfsresult_to_gerr(errp,captive_directory_new_open( - &captive_directory_object, /* captive_directory_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - targetdir))) { /* pathname */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_CD_ERROR,CMDLINE_CMD_CD_ERROR_CANNOT_OPEN_DIRECTORY, - _("Cannot open directory: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetdir)); - return; - } - - g_object_unref(captive_directory_object); - - g_free((/*de-const*/ gchar *)cmdline_cwd); - cmdline_cwd=g_strdup(targetdir); - g_assert(g_path_is_absolute(cmdline_cwd)); -} - - -void cmd_cd(const char **cmd_argv,GError **errp) -{ - g_return_if_fail(!errp || !*errp); - - if (cmd_argv[0]) - cmd_cd_internal(cmdline_path_from_cwd(cmd_argv[0]),errp); - - printf("Guest-OS CWD: %s\n",cmdline_cwd); -} diff --git a/src/client/cmdline/cmd_cd.h b/src/client/cmdline/cmd_cd.h deleted file mode 100644 index a8f1321..0000000 --- a/src/client/cmdline/cmd_cd.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "cd" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_CD_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_CD_H 1 - - -#include -#include - - -#define CMDLINE_CMD_CD_ERROR (cmdline_cmd_cd_error_quark()) -GQuark cmdline_cmd_cd_error_quark(void); - -typedef enum { - CMDLINE_CMD_CD_ERROR_CANNOT_OPEN_DIRECTORY - } CmdlineCmdCdError; - - -extern const struct poptOption cmd_cd_table[]; - -void cmd_cd_internal(const gchar *targetdir,GError **errp); -void cmd_cd(const char **cmd_argv,GError **errp); - -G_CONST_RETURN gchar *cmdline_path_from_cwd(const gchar *relative); - -extern const gchar *cmdline_cwd; - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_CD_H */ diff --git a/src/client/cmdline/cmd_close.c b/src/client/cmdline/cmd_close.c deleted file mode 100644 index d3438cf..0000000 --- a/src/client/cmdline/cmd_close.c +++ /dev/null @@ -1,58 +0,0 @@ -/* $Id$ - * client cmdline interface command "close" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "cmd_close.h" /* self */ -#include "main.h" -#include "handle.h" - - -GQuark cmdline_cmd_close_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-close"); - - return r; -} - - -const struct poptOption cmd_close_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_close(const char **cmd_argv,GError **errp) -{ -const gchar *handle_name; - - g_return_if_fail(!errp || !*errp); - - handle_name=cmd_argv[0]; - - handle_delete(handle_name,errp); -} diff --git a/src/client/cmdline/cmd_close.h b/src/client/cmdline/cmd_close.h deleted file mode 100644 index 34753e8..0000000 --- a/src/client/cmdline/cmd_close.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "close" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_CLOSE_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_CLOSE_H 1 - - -#include -#include - - -#define CMDLINE_CMD_CLOSE_ERROR (cmdline_cmd_close_error_quark()) -GQuark cmdline_cmd_close_error_quark(void); - -typedef enum { - CMDLINE_CMD_CLOSE_ERROR_UNUSED - } CmdlineCmdCloseError; - - -extern const struct poptOption cmd_close_table[]; - -void cmd_close(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_CLOSE_H */ diff --git a/src/client/cmdline/cmd_commit.c b/src/client/cmdline/cmd_commit.c deleted file mode 100644 index 3f886dd..0000000 --- a/src/client/cmdline/cmd_commit.c +++ /dev/null @@ -1,63 +0,0 @@ -/* $Id$ - * client cmdline interface command "commit" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include "captive/client-vfs.h" - -#include "cmd_commit.h" /* self */ -#include "main.h" - - -GQuark cmdline_cmd_commit_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-commit"); - - return r; -} - - -const struct poptOption cmd_commit_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_commit(const char **cmd_argv,GError **errp) -{ - g_return_if_fail(!errp || !*errp); - - captive_vfs_commit(cmdline_captive_vfs_object); - - if (!errvfsresult_to_gerr(errp,captive_vfs_commit(cmdline_captive_vfs_object))) { - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_COMMIT_ERROR,CMDLINE_CMD_COMMIT_ERROR_CANNOT_COMMIT, - _("Failed to commit disk changes")); - return; - } -} diff --git a/src/client/cmdline/cmd_commit.h b/src/client/cmdline/cmd_commit.h deleted file mode 100644 index e2795fe..0000000 --- a/src/client/cmdline/cmd_commit.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "commit" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_COMMIT_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_COMMIT_H 1 - - -#include -#include - - -#define CMDLINE_CMD_COMMIT_ERROR (cmdline_cmd_commit_error_quark()) -GQuark cmdline_cmd_commit_error_quark(void); - -typedef enum { - CMDLINE_CMD_COMMIT_ERROR_CANNOT_COMMIT - } CmdlineCmdCommitError; - - -extern const struct poptOption cmd_commit_table[]; - -void cmd_commit(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_COMMIT_H */ diff --git a/src/client/cmdline/cmd_create.c b/src/client/cmdline/cmd_create.c deleted file mode 100644 index ceef1f3..0000000 --- a/src/client/cmdline/cmd_create.c +++ /dev/null @@ -1,110 +0,0 @@ -/* $Id$ - * client cmdline interface command "create" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "cmd_create.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "handle.h" -#include "utf8.h" - - -GQuark cmdline_cmd_create_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-create"); - - return r; -} - - -static int optarg_read; -static int optarg_write; -static int optarg_random; -static int optarg_exclusive; -static int optarg_read_only; - -const struct poptOption cmd_create_table[]={ - CMDLINE_POPT("read",'r',POPT_ARG_NONE,&optarg_read, - N_("Create file with 'GNOME_VFS_OPEN_READ' disposition flag"),NULL), - CMDLINE_POPT("write",'w',POPT_ARG_NONE,&optarg_write, - N_("Create file with 'GNOME_VFS_OPEN_WRITE' disposition flag"),NULL), - CMDLINE_POPT("random",'R',POPT_ARG_NONE,&optarg_random, - N_("Create file with 'GNOME_VFS_OPEN_RANDOM' disposition flag"),NULL), - CMDLINE_POPT("exclusive",'x',POPT_ARG_NONE,&optarg_exclusive, - N_("Create file with exclusive access rights"),NULL), - CMDLINE_POPT("read-only",0,POPT_ARG_NONE,&optarg_read_only, - N_("Create file with read-only access mode"),NULL), - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_create(const char **cmd_argv,GError **errp) -{ -CaptiveFileObject *captive_file_object; -const gchar *filename; -GnomeVFSOpenMode mode; -const gchar *handle_name; -gboolean exclusive; -gboolean read_only; - - g_return_if_fail(!errp || !*errp); - - handle_name=cmd_argv[0]; - filename=cmdline_path_from_cwd(cmd_argv[1]); - mode=0 - | (!optarg_read ? 0 : GNOME_VFS_OPEN_READ) - | (!optarg_write ? 0 : GNOME_VFS_OPEN_WRITE) - | (!optarg_random ? 0 : GNOME_VFS_OPEN_RANDOM); - optarg_read=0; - optarg_write=0; - optarg_random=0; - exclusive=!!optarg_exclusive; - optarg_exclusive=0; - read_only=!!optarg_read_only; - optarg_read_only=0; - - if (!handle_check_not_used(handle_name,errp)) - return; - - if (!errvfsresult_to_gerr(errp,captive_file_new_create( - &captive_file_object, /* captive_file_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - filename, /* pathname */ - mode, /* mode */ - exclusive, /* exclusive */ - (read_only ? 0400 : 0000)))) { /* perm */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_CREATE_ERROR,CMDLINE_CMD_CREATE_ERROR_CREATING_FILE, - _("Error creating guest-os file '%s'"),CMD_LOCALE_FROM_UTF8_ALLOCA(filename)); - return; - } - - handle_set(handle_name,captive_file_object); - g_object_unref(captive_file_object); -} diff --git a/src/client/cmdline/cmd_create.h b/src/client/cmdline/cmd_create.h deleted file mode 100644 index 95d2f11..0000000 --- a/src/client/cmdline/cmd_create.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "create" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_CREATE_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_CREATE_H 1 - - -#include -#include - - -#define CMDLINE_CMD_CREATE_ERROR (cmdline_cmd_create_error_quark()) -GQuark cmdline_cmd_create_error_quark(void); - -typedef enum { - CMDLINE_CMD_CREATE_ERROR_CREATING_FILE - } CmdlineCmdCreateError; - - -extern const struct poptOption cmd_create_table[]; - -void cmd_create(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_CREATE_H */ diff --git a/src/client/cmdline/cmd_get.c b/src/client/cmdline/cmd_get.c deleted file mode 100644 index 87daf72..0000000 --- a/src/client/cmdline/cmd_get.c +++ /dev/null @@ -1,171 +0,0 @@ -/* $Id$ - * client cmdline interface command "get" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cmd_get.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "utf8.h" - - -/* Config: */ -#define DEFAULT_TRANSFER_BUFFER_SIZE (0x10000) - - -GQuark cmdline_cmd_get_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-get"); - - return r; -} - - -static gchar *optarg_transfer_buffer; - -const struct poptOption cmd_get_table[]={ - CMDLINE_POPT("buffer-size",'b',POPT_ARG_STRING,&optarg_transfer_buffer, - N_("Transfer buffer size"),N_("size")), - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_get(const char **cmd_argv,GError **errp) -{ -CaptiveFileObject *captive_file_object; -const gchar *sourcefile,*targetfile; -guint perm=0644; -int fdtgt; -guint8 *transfer_buffer; -long transfer_buffer_size=DEFAULT_TRANSFER_BUFFER_SIZE; - - g_return_if_fail(!errp || !*errp); - - if (optarg_transfer_buffer) { -const gchar *string=captive_strdup_alloca(optarg_transfer_buffer); -char *endptr; - - free(optarg_transfer_buffer); - optarg_transfer_buffer=NULL; - - transfer_buffer_size=strtol(string,&endptr,0); - if (transfer_buffer_size<=0 || transfer_buffer_size>=LONG_MAX || (endptr && *endptr)) { - g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_PARSING_TRANSFER_BUFFER_SIZE, - _("Error parsing transfer buffer size: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(string)); - return; - } - } - - sourcefile=cmdline_path_from_cwd(cmd_argv[0]); - if (cmd_argv[1]) - targetfile=captive_strdup_alloca(cmdline_path_from_cwd(cmd_argv[1])); - else { -char *s; - - targetfile=captive_strdup_alloca(sourcefile); - if ((s=strrchr(targetfile,G_DIR_SEPARATOR))) - targetfile=s+1; - } - - if (-1==(fdtgt=open(CMD_FILENAME_FROM_UTF8_ALLOCA(targetfile), - O_CREAT|O_EXCL|O_WRONLY /* flags */ -#ifdef O_BINARY - | O_BINARY -#endif /* O_BINARY */ -#ifdef O_LARGEFILE - | O_LARGEFILE -#endif /* O_LARGEFILE */ - , - perm))) { /* mode */ - g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_CANNOT_CREATE_TARGET_HOSTOS_FILE, - _("Cannot create target host-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile),g_strerror(errno)); - return; - } - - if (!errvfsresult_to_gerr(errp,captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - sourcefile, /* pathname */ - GNOME_VFS_OPEN_READ))) { /* mode */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_OPENING_SOURCE_FILE, - _("Error opening source guest-os file: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(sourcefile)); - goto err_close_fdtgt; - } - - transfer_buffer=g_malloc(transfer_buffer_size); - g_assert(transfer_buffer!=NULL); /* Should not happen. */ - - for (;;) { -GnomeVFSFileSize bytes_read; -GnomeVFSResult errvfsresult; -ssize_t gotssize; - - errvfsresult=captive_file_read( - captive_file_object, /* captive_file_object */ - transfer_buffer, /* buffer */ - transfer_buffer_size, /* num_bytes */ - &bytes_read); /* bytes_read_return */ - g_assert(errvfsresult==GNOME_VFS_OK || errvfsresult==GNOME_VFS_ERROR_EOF); - g_assert((errvfsresult==GNOME_VFS_ERROR_EOF)==(bytes_read==0)); - if (errvfsresult==GNOME_VFS_ERROR_EOF) - break; - if (errvfsresult!=GNOME_VFS_OK) { -gboolean errbool; - - errbool=errvfsresult_to_gerr(errp,errvfsresult); - g_assert(errbool==FALSE); - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_READING_SOURCE_FILE, - _("Error reading source guest-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(sourcefile),g_strerror(errno)); - goto err_free_transfer_buffer; - } - - if (bytes_read!=(GnomeVFSFileSize)(gotssize=write(fdtgt,transfer_buffer,bytes_read))) { - g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_WRITING_TARGET_HOSTOS_FILE, - _("Error writing target host-os file: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile)); - goto err_free_transfer_buffer; - } - } - -err_free_transfer_buffer: - g_free(transfer_buffer); -/* err_unref_captive_file_object: */ - g_object_unref(captive_file_object); -err_close_fdtgt: - if (close(fdtgt)) { - err_cleanup(errp); /* may be clean */ - g_set_error(errp,CMDLINE_CMD_GET_ERROR,CMDLINE_CMD_GET_ERROR_CLOSING_TARGET_HOSTOS_FILE, - _("Error closing target host-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile),g_strerror(errno)); - } -} diff --git a/src/client/cmdline/cmd_get.h b/src/client/cmdline/cmd_get.h deleted file mode 100644 index 402320e..0000000 --- a/src/client/cmdline/cmd_get.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "get" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_GET_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_GET_H 1 - - -#include -#include - - -#define CMDLINE_CMD_GET_ERROR (cmdline_cmd_get_error_quark()) -GQuark cmdline_cmd_get_error_quark(void); - -typedef enum { - CMDLINE_CMD_GET_ERROR_OPENING_SOURCE_FILE, - CMDLINE_CMD_GET_ERROR_CANNOT_CREATE_TARGET_HOSTOS_FILE, - CMDLINE_CMD_GET_ERROR_WRITING_TARGET_HOSTOS_FILE, - CMDLINE_CMD_GET_ERROR_READING_SOURCE_FILE, - CMDLINE_CMD_GET_ERROR_CLOSING_TARGET_HOSTOS_FILE, - CMDLINE_CMD_GET_ERROR_PARSING_TRANSFER_BUFFER_SIZE - } CmdlineCmdGetError; - - -extern const struct poptOption cmd_get_table[]; - -void cmd_get(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_GET_H */ diff --git a/src/client/cmdline/cmd_help.c b/src/client/cmdline/cmd_help.c deleted file mode 100644 index 4744f26..0000000 --- a/src/client/cmdline/cmd_help.c +++ /dev/null @@ -1,72 +0,0 @@ -/* $Id$ - * client cmdline interface command "help" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "cmd_help.h" /* self */ -#include "main.h" /* for cmdline_command_table */ - - -GQuark cmdline_cmd_help_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-help"); - - return r; -} - - -const struct poptOption cmd_help_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_help(const char **cmd_argv,GError **errp) -{ -const struct cmdline_command *commandp; -int cmd_name_maxlen; - - g_return_if_fail(!errp || !*errp); - - if (cmd_argv[0]) { -const char *cmd_help_argv[3]; - - cmd_help_argv[0]=cmd_argv[0]; - cmd_help_argv[1]="--help"; - cmd_help_argv[2]=NULL; - invoke_cmd(2,cmd_help_argv); - return; - } - - cmd_name_maxlen=0; - for (commandp=cmdline_command_table+1;commandp->name;commandp++) - cmd_name_maxlen=MAX(cmd_name_maxlen,(int)strlen(commandp->name)); - for (commandp=cmdline_command_table+1;commandp->name;commandp++) - printf("%-*s\t%s\n",cmd_name_maxlen,commandp->name,_(commandp->description)); -} diff --git a/src/client/cmdline/cmd_help.h b/src/client/cmdline/cmd_help.h deleted file mode 100644 index 77bb352..0000000 --- a/src/client/cmdline/cmd_help.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "help" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_HELP_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_HELP_H 1 - - -#include -#include - - -#define CMDLINE_CMD_HELP_ERROR (cmdline_cmd_help_error_quark()) -GQuark cmdline_cmd_help_error_quark(void); - -typedef enum { - CMDLINE_CMD_HELP_ERROR_UNUSED - } CmdlineCmdHelpError; - - -extern const struct poptOption cmd_help_table[]; - -void cmd_help(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_HELP_H */ diff --git a/src/client/cmdline/cmd_info.c b/src/client/cmdline/cmd_info.c deleted file mode 100644 index f937429..0000000 --- a/src/client/cmdline/cmd_info.c +++ /dev/null @@ -1,88 +0,0 @@ -/* $Id$ - * client cmdline interface command "info" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "cmd_info.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "file_info.h" -#include "utf8.h" - - -GQuark cmdline_cmd_info_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-info"); - - return r; -} - - -const struct poptOption cmd_info_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_info(const char **cmd_argv,GError **errp) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSFileInfo file_info; -const gchar *filepath; - - g_return_if_fail(!errp || !*errp); - - filepath=cmdline_path_from_cwd(cmd_argv[0]); - - if (!errvfsresult_to_gerr(errp,captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - filepath, /* pathname */ - GNOME_VFS_OPEN_READ))) { /* mode */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_INFO_ERROR,CMDLINE_CMD_INFO_ERROR_CANNOT_OPEN_FILE, - _("Cannot open file: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(filepath)); - return; - } - - if (!errvfsresult_to_gerr(errp,captive_file_file_info_get( - captive_file_object, /* captive_file_object */ - &file_info))) { /* file_info */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_INFO_ERROR,CMDLINE_CMD_INFO_ERROR_GETTING_FILE_INFO, - _("Cannot get file information about: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(filepath)); - goto err_unref; - } - file_info_dump_full(&file_info,errp); - if (*errp) - goto err_unref; - -err_unref: - g_object_unref(captive_file_object); -} diff --git a/src/client/cmdline/cmd_info.h b/src/client/cmdline/cmd_info.h deleted file mode 100644 index 593bc56..0000000 --- a/src/client/cmdline/cmd_info.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "info" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_INFO_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_INFO_H 1 - - -#include -#include - - -#define CMDLINE_CMD_INFO_ERROR (cmdline_cmd_info_error_quark()) -GQuark cmdline_cmd_info_error_quark(void); - -typedef enum { - CMDLINE_CMD_INFO_ERROR_CANNOT_OPEN_FILE, - CMDLINE_CMD_INFO_ERROR_GETTING_FILE_INFO - } CmdlineCmdInfoError; - - -extern const struct poptOption cmd_info_table[]; - -void cmd_info(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_INFO_H */ diff --git a/src/client/cmdline/cmd_lcd.c b/src/client/cmdline/cmd_lcd.c deleted file mode 100644 index c1825b7..0000000 --- a/src/client/cmdline/cmd_lcd.c +++ /dev/null @@ -1,74 +0,0 @@ -/* $Id$ - * client cmdline interface command "lcd" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cmd_lcd.h" /* self */ -#include "main.h" /* for CMDLINE_POPT_AUTOHELP */ -#include "utf8.h" - - -const gchar *cmdline_cwd; - - -GQuark cmdline_cmd_lcd_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-lcd"); - - return r; -} - - -const struct poptOption cmd_lcd_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_lcd(const char **cmd_argv,GError **errp) -{ -gchar *currentdir_filename; - - g_return_if_fail(!errp || !*errp); - - if (cmd_argv[0]) { - if (chdir(CMD_FILENAME_FROM_UTF8_ALLOCA(cmd_argv[0]))) { - g_set_error(errp,CMDLINE_CMD_LCD_ERROR,CMDLINE_CMD_LCD_ERROR_CANNOT_CHANGE_HOSTOS_DIRECTORY, - _("Cannot change host-os directory to '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(cmd_argv[0]),g_strerror(errno)); - return; - } - } - - currentdir_filename=g_get_current_dir(); - printf("Host-OS CWD: %s\n",CMD_LOCALE_FROM_UTF8_ALLOCA(CMD_FILENAME_TO_UTF8_ALLOCA(currentdir_filename))); - g_free(currentdir_filename); -} diff --git a/src/client/cmdline/cmd_lcd.h b/src/client/cmdline/cmd_lcd.h deleted file mode 100644 index ab0b799..0000000 --- a/src/client/cmdline/cmd_lcd.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "lcd" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_LCD_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_LCD_H 1 - - -#include -#include - - -#define CMDLINE_CMD_LCD_ERROR (cmdline_cmd_lcd_error_quark()) -GQuark cmdline_cmd_lcd_error_quark(void); - -typedef enum { - CMDLINE_CMD_LCD_ERROR_CANNOT_CHANGE_HOSTOS_DIRECTORY - } CmdlineCmdLcdError; - - -extern const struct poptOption cmd_lcd_table[]; - -void cmd_lcd(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_LCD_H */ diff --git a/src/client/cmdline/cmd_ls.c b/src/client/cmdline/cmd_ls.c deleted file mode 100644 index 0ed1b35..0000000 --- a/src/client/cmdline/cmd_ls.c +++ /dev/null @@ -1,95 +0,0 @@ -/* $Id$ - * client cmdline interface command "ls" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "cmd_ls.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "file_info.h" -#include "utf8.h" - - -GQuark cmdline_cmd_ls_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-ls"); - - return r; -} - - -const struct poptOption cmd_ls_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_ls(const char **cmd_argv,GError **errp) -{ -CaptiveDirectoryObject *captive_directory_object; -GnomeVFSFileInfo file_info; -GnomeVFSResult errvfsresult; -const gchar *targetdir; - - g_return_if_fail(!errp || !*errp); - - targetdir=cmdline_path_from_cwd(cmd_argv[0]); - - if (!errvfsresult_to_gerr(errp,captive_directory_new_open( - &captive_directory_object, /* captive_directory_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - targetdir))) { /* pathname */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_LS_ERROR,CMDLINE_CMD_LS_ERROR_CANNOT_OPEN_DIRECTORY, - _("Cannot open directory: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetdir)); - return; - } - - while (GNOME_VFS_OK==(errvfsresult=captive_directory_read( - captive_directory_object, /* captive_directory_object */ - &file_info))) { /* file_info */ - file_info_dump_line(&file_info,errp); - if (*errp) - goto err_unref; - /* FIXME: Memory leaked 'file_info'? */ - } - if (GNOME_VFS_ERROR_EOF!=errvfsresult) { -gboolean errbool; - - errbool=errvfsresult_to_gerr(errp,errvfsresult); - g_assert(errbool==FALSE); - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_LS_ERROR,CMDLINE_CMD_LS_ERROR_READING_DIRECTORY, - _("Error reading directory: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetdir)); - goto err_unref; - } - -err_unref: - g_object_unref(captive_directory_object); -} diff --git a/src/client/cmdline/cmd_ls.h b/src/client/cmdline/cmd_ls.h deleted file mode 100644 index 8c60730..0000000 --- a/src/client/cmdline/cmd_ls.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "ls" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_LS_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_LS_H 1 - - -#include -#include - - -#define CMDLINE_CMD_LS_ERROR (cmdline_cmd_ls_error_quark()) -GQuark cmdline_cmd_ls_error_quark(void); - -typedef enum { - CMDLINE_CMD_LS_ERROR_CANNOT_OPEN_DIRECTORY, - CMDLINE_CMD_LS_ERROR_READING_DIRECTORY - } CmdlineCmdLsError; - - -extern const struct poptOption cmd_ls_table[]; - -void cmd_ls(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_LS_H */ diff --git a/src/client/cmdline/cmd_mkdir.c b/src/client/cmdline/cmd_mkdir.c deleted file mode 100644 index 2ddb495..0000000 --- a/src/client/cmdline/cmd_mkdir.c +++ /dev/null @@ -1,72 +0,0 @@ -/* $Id$ - * client cmdline interface command "mkdir" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "cmd_mkdir.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "utf8.h" - - -GQuark cmdline_cmd_mkdir_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-mkdir"); - - return r; -} - - -const struct poptOption cmd_mkdir_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_mkdir(const char **cmd_argv,GError **errp) -{ -CaptiveDirectoryObject *captive_directory_object; -guint perms=0755; -const gchar *targetdir; - - g_return_if_fail(!errp || !*errp); - - targetdir=cmdline_path_from_cwd(cmd_argv[0]); - - if (!errvfsresult_to_gerr(errp,captive_directory_new_make( - &captive_directory_object, /* captive_directory_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - targetdir, /* pathname */ - perms))) { /* perms */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_MKDIR_ERROR,CMDLINE_CMD_MKDIR_ERROR_CANNOT_CREATE_DIRECTORY, - _("Cannot create directory: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetdir)); - return; - } - - g_object_unref(captive_directory_object); -} diff --git a/src/client/cmdline/cmd_mkdir.h b/src/client/cmdline/cmd_mkdir.h deleted file mode 100644 index b4c9379..0000000 --- a/src/client/cmdline/cmd_mkdir.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "mkdir" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_MKDIR_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_MKDIR_H 1 - - -#include -#include - - -#define CMDLINE_CMD_MKDIR_ERROR (cmdline_cmd_mkdir_error_quark()) -GQuark cmdline_cmd_mkdir_error_quark(void); - -typedef enum { - CMDLINE_CMD_MKDIR_ERROR_CANNOT_CREATE_DIRECTORY - } CmdlineCmdMkdirError; - - -extern const struct poptOption cmd_mkdir_table[]; - -void cmd_mkdir(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_MKDIR_H */ diff --git a/src/client/cmdline/cmd_mv.c b/src/client/cmdline/cmd_mv.c deleted file mode 100644 index 21f77c0..0000000 --- a/src/client/cmdline/cmd_mv.c +++ /dev/null @@ -1,84 +0,0 @@ -/* $Id$ - * client cmdline interface command "mv" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the temvs of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "cmd_mv.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "utf8.h" - - -GQuark cmdline_cmd_mv_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-mv"); - - return r; -} - - -const struct poptOption cmd_mv_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_mv(const char **cmd_argv,GError **errp) -{ -CaptiveFileObject *captive_file_object; -const gchar *sourcefile,*targetfile; - - g_return_if_fail(!errp || !*errp); - - sourcefile=cmdline_path_from_cwd(cmd_argv[0]); - targetfile=cmdline_path_from_cwd(cmd_argv[1]); - - if (!errvfsresult_to_gerr(errp,captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - sourcefile, /* pathname */ - GNOME_VFS_OPEN_NONE))) { /* mode */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_MV_ERROR,CMDLINE_CMD_MV_ERROR_CANNOT_OPEN_FILE_TO_MOVE, - _("Cannot open file to be moved: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile)); - return; - } - - if (!errvfsresult_to_gerr(errp,captive_file_move( - captive_file_object, /* captive_file_object_old */ - targetfile, /* pathname_new */ - FALSE))) { /* force_replace */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_MV_ERROR,CMDLINE_CMD_MV_ERROR_CANNOT_MOVE_FILE, - _("Cannot move file '%s' to its target name '%s'"), - CMD_LOCALE_FROM_UTF8_ALLOCA(sourcefile),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile)); - goto err_unref; - } - -err_unref: - g_object_unref(captive_file_object); -} diff --git a/src/client/cmdline/cmd_mv.h b/src/client/cmdline/cmd_mv.h deleted file mode 100644 index f3e57f5..0000000 --- a/src/client/cmdline/cmd_mv.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "mv" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the temvs of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_MV_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_MV_H 1 - - -#include -#include - - -#define CMDLINE_CMD_MV_ERROR (cmdline_cmd_mv_error_quark()) -GQuark cmdline_cmd_mv_error_quark(void); - -typedef enum { - CMDLINE_CMD_MV_ERROR_CANNOT_OPEN_FILE_TO_MOVE, - CMDLINE_CMD_MV_ERROR_CANNOT_MOVE_FILE - } CmdlineCmdMvError; - - -extern const struct poptOption cmd_mv_table[]; - -void cmd_mv(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_MV_H */ diff --git a/src/client/cmdline/cmd_open.c b/src/client/cmdline/cmd_open.c deleted file mode 100644 index 0220b93..0000000 --- a/src/client/cmdline/cmd_open.c +++ /dev/null @@ -1,96 +0,0 @@ -/* $Id$ - * client cmdline interface command "open" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "cmd_open.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "handle.h" -#include "utf8.h" - - -GQuark cmdline_cmd_open_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-open"); - - return r; -} - - -static int optarg_read; -static int optarg_write; -static int optarg_random; - -const struct poptOption cmd_open_table[]={ - CMDLINE_POPT("read",'r',POPT_ARG_NONE,&optarg_read, - N_("Open file with 'GNOME_VFS_OPEN_READ' disposition flag"),NULL), - CMDLINE_POPT("write",'w',POPT_ARG_NONE,&optarg_write, - N_("Open file with 'GNOME_VFS_OPEN_WRITE' disposition flag"),NULL), - CMDLINE_POPT("random",'R',POPT_ARG_NONE,&optarg_random, - N_("Open file with 'GNOME_VFS_OPEN_RANDOM' disposition flag"),NULL), - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_open(const char **cmd_argv,GError **errp) -{ -CaptiveFileObject *captive_file_object; -const gchar *filename; -GnomeVFSOpenMode mode; -const gchar *handle_name; - - g_return_if_fail(!errp || !*errp); - - handle_name=cmd_argv[0]; - filename=cmdline_path_from_cwd(cmd_argv[1]); - mode=0 - | (!optarg_read ? 0 : GNOME_VFS_OPEN_READ) - | (!optarg_write ? 0 : GNOME_VFS_OPEN_WRITE) - | (!optarg_random ? 0 : GNOME_VFS_OPEN_RANDOM); - optarg_read=0; - optarg_write=0; - optarg_random=0; - - if (!handle_check_not_used(handle_name,errp)) - return; - - if (!errvfsresult_to_gerr(errp,captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - filename, /* pathname */ - mode))) { /* mode */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_OPEN_ERROR,CMDLINE_CMD_OPEN_ERROR_OPENING_FILE, - _("Error opening guest-os file '%s'"),CMD_LOCALE_FROM_UTF8_ALLOCA(filename)); - return; - } - - handle_set(handle_name,captive_file_object); - g_object_unref(captive_file_object); -} diff --git a/src/client/cmdline/cmd_open.h b/src/client/cmdline/cmd_open.h deleted file mode 100644 index fcf685e..0000000 --- a/src/client/cmdline/cmd_open.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "open" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_OPEN_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_OPEN_H 1 - - -#include -#include - - -#define CMDLINE_CMD_OPEN_ERROR (cmdline_cmd_open_error_quark()) -GQuark cmdline_cmd_open_error_quark(void); - -typedef enum { - CMDLINE_CMD_OPEN_ERROR_OPENING_FILE - } CmdlineCmdOpenError; - - -extern const struct poptOption cmd_open_table[]; - -void cmd_open(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_OPEN_H */ diff --git a/src/client/cmdline/cmd_put.c b/src/client/cmdline/cmd_put.c deleted file mode 100644 index 910eb15..0000000 --- a/src/client/cmdline/cmd_put.c +++ /dev/null @@ -1,167 +0,0 @@ -/* $Id$ - * client cmdline interface command "put" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cmd_put.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "utf8.h" - - -/* Config: */ -#define DEFAULT_TRANSFER_BUFFER_SIZE (0x10000) - - -GQuark cmdline_cmd_put_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-put"); - - return r; -} - - -static gchar *optarg_transfer_buffer; - -const struct poptOption cmd_put_table[]={ - CMDLINE_POPT("buffer-size",'b',POPT_ARG_STRING,&optarg_transfer_buffer, - N_("Transfer buffer size"),N_("size")), - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_put(const char **cmd_argv,GError **errp) -{ -CaptiveFileObject *captive_file_object; -const gchar *sourcefile,*targetfile; -guint perm=0644; -int fdsrc; -guint8 *transfer_buffer; -long transfer_buffer_size=DEFAULT_TRANSFER_BUFFER_SIZE; -int got; - - g_return_if_fail(!errp || !*errp); - - if (optarg_transfer_buffer) { -const gchar *string=captive_strdup_alloca(optarg_transfer_buffer); -char *endptr; - - free(optarg_transfer_buffer); - optarg_transfer_buffer=NULL; - - transfer_buffer_size=strtol(string,&endptr,0); - if (transfer_buffer_size<=0 || transfer_buffer_size>=LONG_MAX || (endptr && *endptr)) { - g_set_error(errp,CMDLINE_CMD_PUT_ERROR,CMDLINE_CMD_PUT_ERROR_PARSING_TRANSFER_BUFFER_SIZE, - _("Error parsing transfer buffer size: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(string)); - return; - } - } - - sourcefile=cmd_argv[0]; - if (cmd_argv[1]) - targetfile=cmdline_path_from_cwd(cmd_argv[1]); - else { -gchar *sourcefile_basename; - - sourcefile_basename=g_path_get_basename(sourcefile); - targetfile=cmdline_path_from_cwd(sourcefile_basename); - g_free(sourcefile_basename); - } - - if (-1==(fdsrc=open(CMD_FILENAME_FROM_UTF8_ALLOCA(sourcefile),O_RDONLY -#ifdef O_BINARY - | O_BINARY -#endif /* O_BINARY */ -#ifdef O_LARGEFILE - | O_LARGEFILE -#endif /* O_LARGEFILE */ - ))) { - g_set_error(errp,CMDLINE_CMD_PUT_ERROR,CMDLINE_CMD_PUT_ERROR_OPENING_SOURCE_FILE, - _("Error opening source host-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(sourcefile),g_strerror(errno)); - return; - } - - if (!errvfsresult_to_gerr(errp,captive_file_new_create( - &captive_file_object, /* captive_file_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - targetfile, /* pathname */ - GNOME_VFS_OPEN_WRITE, /* mode */ - FALSE, /* exclusive */ - perm))) { /* perm */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_PUT_ERROR,CMDLINE_CMD_PUT_ERROR_CANNOT_CREATE_TARGET_GUESTOS_FILE, - _("Cannot create target guest-os file: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile)); - goto err_close_fdsrc; - } - - transfer_buffer=g_malloc(transfer_buffer_size); - g_assert(transfer_buffer!=NULL); /* Should not happen. */ - - while (0<(got=read(fdsrc,transfer_buffer,transfer_buffer_size))) { -GnomeVFSFileSize bytes_written; - - if (!errvfsresult_to_gerr(errp,captive_file_write( - captive_file_object, /* captive_file_object */ - transfer_buffer, /* buffer */ - got, /* num_bytes */ - &bytes_written))) { /* bytes_written_return */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_PUT_ERROR,CMDLINE_CMD_PUT_ERROR_WRITING_TARGET_GUESTOS_FILE, - _("Error writing target guest-os file: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile)); - goto err_free_transfer_buffer; - } - if (bytes_written!=(GnomeVFSFileSize)got) { - g_set_error(errp,CMDLINE_CMD_PUT_ERROR,CMDLINE_CMD_PUT_ERROR_WRITING_TARGET_GUESTOS_FILE, - _("Error writing target guest-os file '%s': requested %d, written %Lu"), - CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile),got,(unsigned long long)bytes_written); - goto err_free_transfer_buffer; - } - } - if (got==-1) { - g_set_error(errp,CMDLINE_CMD_PUT_ERROR,CMDLINE_CMD_PUT_ERROR_READING_SOURCE_FILE, - _("Error reading source host-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(sourcefile),g_strerror(errno)); - goto err_free_transfer_buffer; - } - g_assert(got==0); - -err_free_transfer_buffer: - g_free(transfer_buffer); -/* err_unref_captive_file_object: */ - g_object_unref(captive_file_object); -err_close_fdsrc: - if (close(fdsrc)) { - err_cleanup(errp); /* may be clean */ - g_set_error(errp,CMDLINE_CMD_PUT_ERROR,CMDLINE_CMD_PUT_ERROR_CLOSING_SOURCE_FILE, - _("Error closing source host-os file '%s': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(sourcefile),g_strerror(errno)); - } -} diff --git a/src/client/cmdline/cmd_put.h b/src/client/cmdline/cmd_put.h deleted file mode 100644 index 99ab3b5..0000000 --- a/src/client/cmdline/cmd_put.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "put" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_PUT_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_PUT_H 1 - - -#include -#include - - -#define CMDLINE_CMD_PUT_ERROR (cmdline_cmd_put_error_quark()) -GQuark cmdline_cmd_put_error_quark(void); - -typedef enum { - CMDLINE_CMD_PUT_ERROR_OPENING_SOURCE_FILE, - CMDLINE_CMD_PUT_ERROR_CANNOT_CREATE_TARGET_GUESTOS_FILE, - CMDLINE_CMD_PUT_ERROR_WRITING_TARGET_GUESTOS_FILE, - CMDLINE_CMD_PUT_ERROR_READING_SOURCE_FILE, - CMDLINE_CMD_PUT_ERROR_CLOSING_SOURCE_FILE, - CMDLINE_CMD_PUT_ERROR_PARSING_TRANSFER_BUFFER_SIZE - } CmdlineCmdPutError; - - -extern const struct poptOption cmd_put_table[]; - -void cmd_put(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_PUT_H */ diff --git a/src/client/cmdline/cmd_quit.c b/src/client/cmdline/cmd_quit.c deleted file mode 100644 index e7b0f43..0000000 --- a/src/client/cmdline/cmd_quit.c +++ /dev/null @@ -1,54 +0,0 @@ -/* $Id$ - * client cmdline interface command "quit" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "cmd_quit.h" /* self */ -#include "main.h" - - -GQuark cmdline_cmd_quit_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-quit"); - - return r; -} - - -const struct poptOption cmd_quit_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_quit(const char **cmd_argv,GError **errp) -{ - g_return_if_fail(!errp || !*errp); - - main_exit(); -} diff --git a/src/client/cmdline/cmd_quit.h b/src/client/cmdline/cmd_quit.h deleted file mode 100644 index d9053d0..0000000 --- a/src/client/cmdline/cmd_quit.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "quit" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_QUIT_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_QUIT_H 1 - - -#include -#include - - -#define CMDLINE_CMD_QUIT_ERROR (cmdline_cmd_quit_error_quark()) -GQuark cmdline_cmd_quit_error_quark(void); - -typedef enum { - dfgdfgdfgfg - } CmdlineCmdQuitError; - - -extern const struct poptOption cmd_quit_table[]; - -void cmd_quit(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_QUIT_H */ diff --git a/src/client/cmdline/cmd_rm.c b/src/client/cmdline/cmd_rm.c deleted file mode 100644 index 1c9e5ba..0000000 --- a/src/client/cmdline/cmd_rm.c +++ /dev/null @@ -1,80 +0,0 @@ -/* $Id$ - * client cmdline interface command "rm" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "cmd_rm.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "utf8.h" - - -GQuark cmdline_cmd_rm_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-rm"); - - return r; -} - - -const struct poptOption cmd_rm_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_rm(const char **cmd_argv,GError **errp) -{ -CaptiveFileObject *captive_file_object; -const gchar *targetfile; - - g_return_if_fail(!errp || !*errp); - - targetfile=cmdline_path_from_cwd(cmd_argv[0]); - - if (!errvfsresult_to_gerr(errp,captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - targetfile, /* pathname */ - GNOME_VFS_OPEN_NONE))) { /* mode */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_RM_ERROR,CMDLINE_CMD_RM_ERROR_CANNOT_CREATE_REMOVAL_FILE, - _("Cannot open file for removal: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile)); - return; - } - - if (!errvfsresult_to_gerr(errp,captive_file_remove( - captive_file_object))) { /* captive_file_object */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_RM_ERROR,CMDLINE_CMD_RM_ERROR_CANNOT_SET_FILE_REMOVAL, - _("Cannot set file removal state: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetfile)); - goto err_unref; - } - -err_unref: - g_object_unref(captive_file_object); -} diff --git a/src/client/cmdline/cmd_rm.h b/src/client/cmdline/cmd_rm.h deleted file mode 100644 index a8eba51..0000000 --- a/src/client/cmdline/cmd_rm.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "rm" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_RM_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_RM_H 1 - - -#include -#include - - -#define CMDLINE_CMD_RM_ERROR (cmdline_cmd_rm_error_quark()) -GQuark cmdline_cmd_rm_error_quark(void); - -typedef enum { - CMDLINE_CMD_RM_ERROR_CANNOT_CREATE_REMOVAL_FILE, - CMDLINE_CMD_RM_ERROR_CANNOT_SET_FILE_REMOVAL - } CmdlineCmdRmError; - - -extern const struct poptOption cmd_rm_table[]; - -void cmd_rm(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_RM_H */ diff --git a/src/client/cmdline/cmd_rmdir.c b/src/client/cmdline/cmd_rmdir.c deleted file mode 100644 index be2b8ca..0000000 --- a/src/client/cmdline/cmd_rmdir.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id$ - * client cmdline interface command "rmdir" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "cmd_rmdir.h" /* self */ -#include "cmd_cd.h" /* for cmdline_path_from_cwd() */ -#include "main.h" -#include "utf8.h" - - -GQuark cmdline_cmd_rmdir_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-rmdir"); - - return r; -} - - -const struct poptOption cmd_rmdir_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_rmdir(const char **cmd_argv,GError **errp) -{ -CaptiveDirectoryObject *captive_directory_object; -const gchar *targetdir; - - g_return_if_fail(!errp || !*errp); - - targetdir=cmdline_path_from_cwd(cmd_argv[0]); - - if (!errvfsresult_to_gerr(errp,captive_directory_new_open( - &captive_directory_object, /* captive_directory_object_return */ - cmdline_captive_vfs_object, /* captive_vfs_object */ - targetdir))) { /* pathname */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_RMDIR_ERROR,CMDLINE_CMD_RMDIR_ERROR_CANNOT_CREATE_REMOVAL_DIRECTORY, - _("Cannot open directory for removal: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetdir)); - return; - } - - if (!errvfsresult_to_gerr(errp,captive_directory_remove( - captive_directory_object))) { /* captive_directory_object */ - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_RMDIR_ERROR,CMDLINE_CMD_RMDIR_ERROR_CANNOT_SET_DIRECTORY_REMOVAL, - _("Cannot set directory removal state: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(targetdir)); - goto err_unref; - } - -err_unref: - g_object_unref(captive_directory_object); -} diff --git a/src/client/cmdline/cmd_rmdir.h b/src/client/cmdline/cmd_rmdir.h deleted file mode 100644 index 40ed1d4..0000000 --- a/src/client/cmdline/cmd_rmdir.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "rmdir" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_RMDIR_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_RMDIR_H 1 - - -#include -#include - - -#define CMDLINE_CMD_RMDIR_ERROR (cmdline_cmd_rmdir_error_quark()) -GQuark cmdline_cmd_rmdir_error_quark(void); - -typedef enum { - CMDLINE_CMD_RMDIR_ERROR_CANNOT_CREATE_REMOVAL_DIRECTORY, - CMDLINE_CMD_RMDIR_ERROR_CANNOT_SET_DIRECTORY_REMOVAL - } CmdlineCmdRmdirError; - - -extern const struct poptOption cmd_rmdir_table[]; - -void cmd_rmdir(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_RMDIR_H */ diff --git a/src/client/cmdline/cmd_shell.c b/src/client/cmdline/cmd_shell.c deleted file mode 100644 index fe03e15..0000000 --- a/src/client/cmdline/cmd_shell.c +++ /dev/null @@ -1,127 +0,0 @@ -/* $Id$ - * client cmdline interface command "shell" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_LIBREADLINE -#include -#ifdef HAVE_READLINE_HISTORY_H -#include -#endif /* HAVE_READLINE_HISTORY_H */ -#endif /* HAVE_LIBREADLINE */ - -#include "cmd_shell.h" /* self */ -#include "cmd_quit.h" /* for cmd_quit() */ -#include "main.h" /* for invoke_cmd() */ -#include "cmd_cd.h" - - -/* Config: */ -#define PROMPT_STRING "%s$ " /* %s == 'cmdline_cwd' */ - - -GQuark cmdline_cmd_shell_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-shell"); - - return r; -} - - -const struct poptOption cmd_shell_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -/* Function mostly stolen from the project Partition Surprise. - */ -void cmd_shell(const char **cmd_argv,GError **errp) -{ -char *line; -#ifndef HAVE_LIBREADLINE -char linebuf[1024],*s; -#endif /* HAVE_LIBREADLINE */ -int errint,line_argc; -const char **line_argv=NULL; -gchar *prompt; -const char *cmd_cd_args[]={NULL}; - - g_return_if_fail(!errp || !*errp); - -#ifndef HAVE_LIBREADLINE - puts(_("Line editing not available, please recompile with readline library installed")); -#endif /* HAVE_LIBREADLINE */ - - cmd_cd(cmd_cd_args,errp); /* Show current directory. */ - if (errp && *errp) - return; - - for (;;) { - prompt=g_strdup_printf(PROMPT_STRING,cmdline_cwd); -#ifdef HAVE_LIBREADLINE - line=readline(prompt); -#ifdef HAVE_ADD_HISTORY - if (line && *line) - add_history(line); -#endif /* HAVE_ADD_HISTORY */ -#else /* HAVE_LIBREADLINE */ - fputs(prompt,stdout); fflush(stdout); - line=fgets(linebuf,sizeof(linebuf),stdin); -#endif /* HAVE_LIBREADLINE */ - g_free(prompt); - if (!line) { - cmd_quit( - NULL, /* cmd_argv */ - errp); /* errp */ - g_assert_not_reached(); - } -#ifndef HAVE_LIBREADLINE - if (line && (s=strchr(line,'\n'))) - *s='\0'; -#endif /* HAVE_LIBREADLINE */ - - line_argv=NULL; - errint=poptParseArgvString(line,&line_argc,&line_argv); -#ifdef HAVE_LIBREADLINE - free(line); -#endif /* HAVE_LIBREADLINE */ - if (errint!=0) { - free(line_argv); - g_set_error(errp,CMDLINE_CMD_SHELL_ERROR,CMDLINE_CMD_SHELL_ERROR_LINE_PARSE_ARGUMENTS, - _("Error '%s' parsing arguments of text line: %s"),poptStrerror(errint),line); - err_cleanup(errp); - continue; - } - - invoke_cmd(line_argc,line_argv); /* errors catched inside */ - free(line_argv); - } -} diff --git a/src/client/cmdline/cmd_shell.h b/src/client/cmdline/cmd_shell.h deleted file mode 100644 index cb3501d..0000000 --- a/src/client/cmdline/cmd_shell.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "shell" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_SHELL_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_SHELL_H 1 - - -#include -#include - - -#define CMDLINE_CMD_SHELL_ERROR (cmdline_cmd_shell_error_quark()) -GQuark cmdline_cmd_shell_error_quark(void); - -typedef enum { - CMDLINE_CMD_SHELL_ERROR_LINE_PARSE_ARGUMENTS - } CmdlineCmdShellError; - - -extern const struct poptOption cmd_shell_table[]; - -void cmd_shell(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_SHELL_H */ diff --git a/src/client/cmdline/cmd_volume.c b/src/client/cmdline/cmd_volume.c deleted file mode 100644 index efa0d26..0000000 --- a/src/client/cmdline/cmd_volume.c +++ /dev/null @@ -1,68 +0,0 @@ -/* $Id$ - * client cmdline interface command "volume" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include "captive/client-vfs.h" - -#include "cmd_volume.h" /* self */ -#include "main.h" - - -GQuark cmdline_cmd_volume_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-cmd-volume"); - - return r; -} - - -const struct poptOption cmd_volume_table[]={ - CMDLINE_POPT_AUTOHELP - POPT_TABLEEND - }; - - -void cmd_volume(const char **cmd_argv,GError **errp) -{ -CaptiveVfsVolumeInfo captive_vfs_volume_info; - - g_return_if_fail(!errp || !*errp); - - if (!errvfsresult_to_gerr(errp,captive_vfs_volume_info_get(cmdline_captive_vfs_object,&captive_vfs_volume_info))) { - err_cleanup(errp); - g_set_error(errp,CMDLINE_CMD_VOLUME_ERROR,CMDLINE_CMD_VOLUME_ERROR_CANNOT_GET_VOLUME_INFO, - _("Failed to get volume info")); - return; - } - - printf("Block size: 0x%lX\n",(unsigned long)captive_vfs_volume_info.block_size); - printf("Total bytes: %" G_GUINT64_FORMAT "\n",captive_vfs_volume_info.bytes); - printf("Bytes free total: %" G_GUINT64_FORMAT "\n",captive_vfs_volume_info.bytes_free); - printf("Bytes free without reserved: %" G_GUINT64_FORMAT "\n",captive_vfs_volume_info.bytes_available); -} diff --git a/src/client/cmdline/cmd_volume.h b/src/client/cmdline/cmd_volume.h deleted file mode 100644 index 244dcce..0000000 --- a/src/client/cmdline/cmd_volume.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface command "volume" for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_CMD_VOLUME_H -#define _CAPTIVE_CLIENT_CMDLINE_CMD_VOLUME_H 1 - - -#include -#include - - -#define CMDLINE_CMD_VOLUME_ERROR (cmdline_cmd_volume_error_quark()) -GQuark cmdline_cmd_volume_error_quark(void); - -typedef enum { - CMDLINE_CMD_VOLUME_ERROR_CANNOT_GET_VOLUME_INFO - } CmdlineCmdVolumeError; - - -extern const struct poptOption cmd_volume_table[]; - -void cmd_volume(const char **cmd_argv,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_CMD_VOLUME_H */ diff --git a/src/client/cmdline/file_info.c b/src/client/cmdline/file_info.c deleted file mode 100644 index eab9d62..0000000 --- a/src/client/cmdline/file_info.c +++ /dev/null @@ -1,129 +0,0 @@ -/* $Id$ - * client cmdline interface GnomeVFSFileInfo utils for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - - -#include "file_info.h" /* self */ -#include "utf8.h" - - -GQuark cmdline_file_info_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-file_info"); - - return r; -} - - -void file_info_dump_line(const GnomeVFSFileInfo *file_info,GError **errp) -{ -const gchar *file_type,*file_perms; -gchar *file_size; - - g_return_if_fail(!errp || !*errp); - - switch (!(file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) ? GNOME_VFS_FILE_TYPE_UNKNOWN : file_info->type) { - case GNOME_VFS_FILE_TYPE_REGULAR: file_type="FILE"; break; - case GNOME_VFS_FILE_TYPE_DIRECTORY: file_type="DIR "; break; - case GNOME_VFS_FILE_TYPE_SOCKET: file_type="DEV "; break; - default: file_type="??? "; break; - } - - if (!(file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS)) - file_perms="???"; - else if (file_info->permissions & GNOME_VFS_PERM_USER_WRITE) - file_perms="r/w"; - else - file_perms="r/o"; - - if (file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) - file_size=g_strdup_printf("%8" GNOME_VFS_SIZE_FORMAT_STR,file_info->size); - else - file_size=g_strdup_printf("%8s","???"); - - /* type pm sz nm */ - printf("[%s] %s %s %s\n",file_type,file_perms,file_size,CMD_LOCALE_FROM_UTF8_ALLOCA(file_info->name)); - - g_free(file_size); -} - - -void file_info_dump_full(const GnomeVFSFileInfo *file_info,GError **errp) -{ - g_return_if_fail(!errp || !*errp); - - printf("Filename: %s\n",CMD_LOCALE_FROM_UTF8_ALLOCA(file_info->name)); - - fputs("File type: ",stdout); - switch (!(file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) ? GNOME_VFS_FILE_TYPE_UNKNOWN : file_info->type) { - case GNOME_VFS_FILE_TYPE_REGULAR: puts("REGULAR"); break; - case GNOME_VFS_FILE_TYPE_DIRECTORY: puts("DIRECTORY"); break; - case GNOME_VFS_FILE_TYPE_SOCKET: puts("SOCKET"); break; - default: puts("???"); break; - } - - fputs("File size: ",stdout); - if (file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) - printf("%" GNOME_VFS_SIZE_FORMAT_STR "\n",file_info->size); - else - puts("???"); - - fputs("Block count: ",stdout); - if (file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT) - printf("%" GNOME_VFS_SIZE_FORMAT_STR "\n",file_info->block_count); - else - puts("???"); - - fputs("Writable?: ",stdout); - if (!(file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS)) - puts("???"); - else if (file_info->permissions & GNOME_VFS_PERM_USER_WRITE) - puts("read/write"); - else - puts("read/only"); - - fputs("Access-time (atime): ",stdout); - if (!(file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_ATIME)) - puts("???"); - else - fputs(ctime(&file_info->atime),stdout); - - fputs("Modification-time (mtime): ",stdout); - if (!(file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_MTIME)) - puts("???"); - else - fputs(ctime(&file_info->mtime),stdout); - - fputs("Change-time (ctime): ",stdout); - if (!(file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_CTIME)) - puts("???"); - else - fputs(ctime(&file_info->ctime),stdout); -} diff --git a/src/client/cmdline/file_info.h b/src/client/cmdline/file_info.h deleted file mode 100644 index 8881837..0000000 --- a/src/client/cmdline/file_info.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface GnomeVFSFileInfo utils for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_FILE_INFO_H -#define _CAPTIVE_CLIENT_CMDLINE_FILE_INFO_H 1 - - -#include -#include - - -#define CMDLINE_FILE_INFO_ERROR (cmdline_file_info_error_quark()) -GQuark cmdline_file_info_error_quark(void); - -typedef enum { - CMDLINE_FILE_INFO_ERROR_UNUSED - } CmdlineFileInfoError; - - -void file_info_dump_line(const GnomeVFSFileInfo *file_info,GError **errp); -void file_info_dump_full(const GnomeVFSFileInfo *file_info,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_FILE_INFO_H */ diff --git a/src/client/cmdline/handle.c b/src/client/cmdline/handle.c deleted file mode 100644 index 6e7b7d7..0000000 --- a/src/client/cmdline/handle.c +++ /dev/null @@ -1,129 +0,0 @@ -/* $Id$ - * client cmdline named CaptiveFileObject storage for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include - -#include "handle.h" /* self */ -#include "utf8.h" - - -GQuark cmdline_handle_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-handle"); - - return r; -} - - -static GHashTable *handle_hash; - -static void handle_hash_key_destroy_func(gchar *handle_name /* key */) -{ - g_return_if_fail(handle_name!=NULL); - - g_free(handle_name); -} - -static void handle_hash_value_destroy_func(CaptiveFileObject *captive_file_object /* value */) -{ - g_return_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - - g_object_unref(captive_file_object); -} - -static void handle_hash_init(void) -{ - if (handle_hash) - return; - handle_hash=g_hash_table_new_full( - g_str_hash, /* hash_func */ - g_str_equal, /* key_equal_func */ - (GDestroyNotify)handle_hash_key_destroy_func, /* key_destroy_func */ - (GDestroyNotify)handle_hash_value_destroy_func); /* value_destroy_func */ -} - -CaptiveFileObject *handle_get(const gchar *handle_name,GError **errp) -{ -CaptiveFileObject *r; - - g_return_val_if_fail(handle_name!=NULL,NULL); - g_return_val_if_fail(!errp || !*errp,NULL); - - handle_hash_init(); - - if (!(r=g_hash_table_lookup(handle_hash,handle_name))) - g_set_error(errp,CMDLINE_HANDLE_ERROR,CMDLINE_HANDLE_ERROR_LOOKUP, - _("Error looking up existing handle: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(handle_name)); - - return r; -} - -/* Returns: TRUE if not used. */ -gboolean handle_check_not_used(const gchar *handle_name,GError **errp) -{ -gboolean r; - - g_return_val_if_fail(handle_name!=NULL,FALSE); - g_return_val_if_fail(!errp || !*errp,FALSE); - - handle_hash_init(); - - if (!(r=!g_hash_table_lookup(handle_hash,handle_name))) - g_set_error(errp,CMDLINE_HANDLE_ERROR,CMDLINE_HANDLE_ERROR_ALREADY_USED, - _("Specified handle already used: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(handle_name)); - - return r; -} - -void handle_set(const gchar *handle_name,CaptiveFileObject *captive_file_object) -{ - g_return_if_fail(handle_name!=NULL); - g_return_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - - handle_hash_init(); - - g_return_if_fail(NULL==g_hash_table_lookup(handle_hash,handle_name)); - - g_hash_table_insert(handle_hash, - g_strdup(handle_name), /* key */ - g_object_ref(captive_file_object)); /* value */ -} - -void handle_delete(const gchar *handle_name,GError **errp) -{ - g_return_if_fail(handle_name!=NULL); - g_return_if_fail(!errp || !*errp); - - handle_hash_init(); - - if (!g_hash_table_remove(handle_hash,handle_name)) { - g_set_error(errp,CMDLINE_HANDLE_ERROR,CMDLINE_HANDLE_ERROR_DELETE, - _("Handle to be deleted not found: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(handle_name)); - return; - } - - g_assert(NULL==g_hash_table_lookup(handle_hash,handle_name)); -} diff --git a/src/client/cmdline/handle.h b/src/client/cmdline/handle.h deleted file mode 100644 index 5b5a475..0000000 --- a/src/client/cmdline/handle.h +++ /dev/null @@ -1,45 +0,0 @@ -/* $Id$ - * Include file for client cmdline named CaptiveFileObject storage for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_HANDLE_H -#define _CAPTIVE_CLIENT_CMDLINE_HANDLE_H 1 - - -#include -#include - - -#define CMDLINE_HANDLE_ERROR (cmdline_handle_error_quark()) -GQuark cmdline_handle_error_quark(void); - -typedef enum { - CMDLINE_HANDLE_ERROR_LOOKUP, - CMDLINE_HANDLE_ERROR_ALREADY_USED, - CMDLINE_HANDLE_ERROR_DELETE - } CmdlineHandleError; - - -CaptiveFileObject *handle_get(const gchar *handle_name,GError **errp); -/* Returns: TRUE if not used. */ -gboolean handle_check_not_used(const gchar *handle_name,GError **errp); -void handle_set(const gchar *handle_name,CaptiveFileObject *captive_file_object); -void handle_delete(const gchar *handle_name,GError **errp); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_FILE_INFO_H */ diff --git a/src/client/cmdline/main.c b/src/client/cmdline/main.c deleted file mode 100644 index 76a5be7..0000000 --- a/src/client/cmdline/main.c +++ /dev/null @@ -1,337 +0,0 @@ -/* $Id$ - * client cmdline interface for libcaptive - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "main.h" /* self */ -#include "cmd_shell.h" -#include "cmd_cd.h" -#include "cmd_lcd.h" -#include "cmd_ls.h" -#include "cmd_get.h" -#include "cmd_put.h" -#include "cmd_info.h" -#include "cmd_volume.h" -#include "cmd_rm.h" -#include "cmd_mv.h" -#include "cmd_mkdir.h" -#include "cmd_rmdir.h" -#include "cmd_commit.h" -#include "cmd_open.h" -#include "cmd_create.h" -#include "cmd_close.h" -#include "cmd_quit.h" -#include "cmd_help.h" -#include "utf8.h" - - -CaptiveVfsObject *cmdline_captive_vfs_object; - - -GQuark cmdline_main_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("cmdline-main"); - - return r; -} - - -static const struct poptOption popt_table[]={ - CAPTIVE_POPT_INCLUDE, - POPT_AUTOHELP - POPT_TABLEEND - }; - -const struct cmdline_command cmdline_command_table[]={ - /* First entry is the default if no command name was specified. */ - { "shell" ,N_("Interactive commands shell.") ,cmd_shell_table ,cmd_shell ,0,0 }, - { "cd" ,N_("Print or change current guest-os directory[1].") ,cmd_cd_table ,cmd_cd ,0,1 }, - { "lcd" ,N_("Print or change current host-os directory[1].") ,cmd_lcd_table ,cmd_lcd ,0,1 }, - { "ls" ,N_("Directory[1] listing.") ,cmd_ls_table ,cmd_ls ,0,1 }, - { "get" ,N_("Copy guest-os file[1] to host-os (opt. file[2]).") ,cmd_get_table ,cmd_get ,1,2 }, - { "put" ,N_("Copy host-os file[1] to guest-os (opt. file[2]).") ,cmd_put_table ,cmd_put ,1,2 }, - { "info" ,N_("Query information about guest-os item[1].") ,cmd_info_table ,cmd_info ,1,1 }, - { "volume",N_("Query information about guest-os volume.") ,cmd_volume_table,cmd_volume,0,0 }, - { "rm" ,N_("Remove guest-os file[1].") ,cmd_rm_table ,cmd_rm ,1,1 }, - { "mv" ,N_("Move (rename) guest-os item[1] to guest-os item[2].") ,cmd_mv_table ,cmd_mv ,2,2 }, - { "mkdir" ,N_("Create guest-os directory[1].") ,cmd_mkdir_table ,cmd_mkdir ,1,1 }, - { "rmdir" ,N_("Remove guest-os directory[1].") ,cmd_rmdir_table ,cmd_rmdir ,1,1 }, - { "commit",N_("Write any pending changes and remount the volume.") ,cmd_commit_table,cmd_commit,0,0 }, - { "open" ,N_("Open as[1] file[2] in mode; see 'open --help'") ,cmd_open_table ,cmd_open ,2,2 }, - { "create",N_("Create as[1] file[2] in mode with perm; see 'create --help'"),cmd_create_table,cmd_create,2,2 }, - { "close" ,N_("Close handle[1]") ,cmd_close_table ,cmd_close ,1,1 }, - { "quit" ,N_("Quit this program.") ,cmd_quit_table ,cmd_quit ,0,0 }, - { "help" ,N_("Show this list of commands or help for command[1].") ,cmd_help_table ,cmd_help ,0,1 }, - { NULL }, /* G_N_ELEMENTS() not usable as sizeof() is not visible for 'extern' */ - }; - - -static gboolean displayArgs_hit; - -static void displayArgs(poptContext con,enum poptCallbackReason foo,struct poptOption *key,const char *arg,void *data) -{ - displayArgs_hit=TRUE; - - if (key->shortName=='?') - poptPrintHelp(con,stdout,0); - else - poptPrintUsage(con,stdout,0); -} - -const struct poptOption cmdline_poptHelpOptions[]={ - { argInfo:POPT_ARG_INTL_DOMAIN,arg:"popt" }, - { NULL ,'\0',POPT_ARG_CALLBACK,(void *)&displayArgs,'\0',NULL,NULL }, - { "help" ,'?' ,0 ,NULL,'?',/* N_ */("Show this help message"), NULL }, - { "usage",'\0',0 ,NULL,'u',/* N_ */("Display brief usage message"),NULL }, - POPT_TABLEEND - }; - - -static void invoke_cmd_err(int cmd_argc,const char **cmd_argv,GError **errp) -{ -const struct cmdline_command *commandp; -const char *cmd_name=NULL; -poptContext cmd_context; -int errint; -const char **cmdarg_argv; -int cmdarg_argc,argci; -const char **csp,*cs; -const char *emptyargv_NULL=NULL; - - g_return_if_fail(cmd_argc>=0); - g_return_if_fail(!errp || !*errp); - - /* poptGetContext() cannot be passed argc==0 even if we lass POPT_CONTEXT_KEEP_FIRST - * as it is buggy. Workaround it by keeping the command name as argv[0]. - */ - if (!cmd_argc) { -const char *stub_shell[]={ cmdline_command_table[0].name,NULL }; - - cmd_argc=1; - cmd_argv=stub_shell; - } - - for (argci=0;argciname;commandp++) { - if (!cmd_name /* NULL cmd_name fallback to the first table entry - "shell" */ - || !strcasecmp(cmd_name,commandp->name)) - break; - } - if (!commandp->name) { - g_set_error(errp,CMDLINE_MAIN_ERROR,CMDLINE_MAIN_ERROR_UNKNOWN_COMMAND, - _("Unknown command, try 'help': %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(cmd_name)); - return; - } - displayArgs_hit=FALSE; - cmd_context=poptGetContext( - PACKAGE, /* name */ - cmd_argc,cmd_argv, /* argc,argv */ - commandp->table, /* options */ - POPT_CONTEXT_POSIXMEHARDER); /* flags; !POPT_CONTEXT_KEEP_FIRST */ - if (cmd_context==NULL) { - g_set_error(errp,CMDLINE_MAIN_ERROR,CMDLINE_MAIN_ERROR_INVALID_COMMAND_ARGUMENTS, - _("Invalid arguments for command: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(cmd_name)); - return; - } - errint=poptReadDefaultConfig(cmd_context, - TRUE); /* useEnv */ - if (errint!=0) { - g_set_error(errp,CMDLINE_MAIN_ERROR,CMDLINE_MAIN_ERROR_READING_COMMAND_CONFIG, - _("Error '%s' reading default configuration for command: %s"), - poptStrerror(errint),CMD_LOCALE_FROM_UTF8_ALLOCA(cmd_name)); - goto err_free_context; - } - errint=poptGetNextOpt(cmd_context); - if (errint!=-1) { - g_set_error(errp,CMDLINE_MAIN_ERROR,CMDLINE_MAIN_ERROR_EXCEEDING_COMMAND_OPTION, - _("Exceeding command option for command: %s"),CMD_LOCALE_FROM_UTF8_ALLOCA(cmd_name)); - goto err_free_context; - } - if (!(cmdarg_argv=poptGetArgs(cmd_context))) - cmdarg_argv=&emptyargv_NULL; - - if (displayArgs_hit) - goto err_free_context; - - for (csp=cmdarg_argv,cmdarg_argc=0;*csp;csp++) - cmdarg_argc++; - if (cmdarg_argcargsn_min || cmdarg_argc>commandp->argsn_max) { - g_set_error(errp,CMDLINE_MAIN_ERROR,CMDLINE_MAIN_ERROR_INVALID_COMMAND_ARGUMENT_COUNT, - _("Invalid number of command '%s' arguments: %d; expected from %d to %d incl."), - CMD_LOCALE_FROM_UTF8_ALLOCA(cmd_name),cmdarg_argc,commandp->argsn_min,commandp->argsn_max); - goto err_free_context; - } - - (*commandp->func)(cmdarg_argv,errp); - -err_free_context: - poptFreeContext(cmd_context); -} - - -void err_cleanup(GError **errp) -{ - g_return_if_fail(errp!=NULL); - - if (!*errp) - return; - printf("\nERROR: %s\n",(*errp)->message); - g_clear_error(errp); -} - - -void invoke_cmd(int cmd_argc,const char **cmd_argv) -{ -GError *gerr=NULL; - - invoke_cmd_err(cmd_argc,cmd_argv,&gerr); - err_cleanup(&gerr); -} - - -/* Returns: Success (no error occured). */ -gboolean errvfsresult_to_gerr(GError **errp,GnomeVFSResult errvfsresult) -{ - g_return_val_if_fail(!errp || !*errp,FALSE); - - if (errvfsresult==GNOME_VFS_OK) - return TRUE; - - g_set_error(errp,CMDLINE_MAIN_ERROR,CMDLINE_MAIN_ERROR_GENERIC_ERROR, - _("Generic error: %s"),gnome_vfs_result_to_string(errvfsresult)); - return FALSE; -} - -void main_exit(void) G_GNUC_NORETURN; -void main_exit(void) -{ - if (cmdline_captive_vfs_object) { - g_object_unref(cmdline_captive_vfs_object); - cmdline_captive_vfs_object=NULL; - } - exit(EXIT_SUCCESS); -} - -int main(int argc,char **argv) -{ -poptContext context; -int errint; -const char **cmd_argv,**csp; -int cmd_argc; -GError *gerr=NULL; -struct captive_options options; - - /* Do not set g_log_set_always_fatal() here as we would not be able - * to restart failed children due to communication-failure alarms. - */ - - captive_standalone_init(); - - captive_options_init(&options); - captive_options=&options; /* for parsing by 'CAPTIVE_POPT_INCLUDE' */ - - context=poptGetContext( - PACKAGE, /* name */ - argc,(/*en-const*/const char **)argv, /* argc,argv */ - popt_table, /* options */ - POPT_CONTEXT_POSIXMEHARDER); /* flags; && !POPT_CONTEXT_KEEP_FIRST */ - if (context==NULL) { - g_error(_("Error parsing command-line arguments")); - return EXIT_FAILURE; - } - errint=poptReadDefaultConfig(context, - TRUE); /* useEnv */ - if (errint!=0) - g_warning(_("Error reading default popt configuration")); - errint=poptGetNextOpt(context); - if (errint!=-1) { - g_error(_("Error parsing (dash-prefixed) command-line argument")); - return EXIT_FAILURE; - } - cmd_argv=poptGetArgs(context); - for (csp=cmd_argv,cmd_argc=0;csp && *csp;csp++) - cmd_argc++; - - captive_options=NULL; /* already parsed by 'CAPTIVE_POPT_INCLUDE' */ - - /* image_iochannel */ - if (cmd_argc<=0) { - g_error(_("File/device disk image pathname command-line argument required")); - return EXIT_FAILURE; - } - g_assert(options.image_iochannel==NULL); - if (!(options.image_iochannel=g_io_channel_new_file( - cmd_argv[0], /* filename */ - (options.rwmode==CAPTIVE_OPTION_RWMODE_RW ? "r+" : "r"), /* mode */ - NULL))) { /* error */ - g_error(_("image_iochannel open failed")); - return EXIT_FAILURE; - } - cmd_argc--; - cmd_argv++; - - if (options.filesystem.type==CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY) { - g_error(_("'--filesystem' option required ('ntfs.sys' pathname suggested)")); - return EXIT_FAILURE; - } - if (!options.load_module) { - g_warning(_("'--load-module' option required ('ntoskrnl.exe' pathname suggested)")); - return EXIT_FAILURE; - } - - if (GNOME_VFS_OK!=captive_vfs_new(&cmdline_captive_vfs_object,&options)) { - g_error(_("captive_vfs_new() failed")); - return EXIT_FAILURE; - } - captive_options_free(&options); - - cmd_cd_internal("/",&gerr); - if (gerr) { - err_cleanup(&gerr); - return EXIT_FAILURE; - } - - invoke_cmd(cmd_argc,cmd_argv); - - /* 'cmd_argv' gets cleared by 'poptFreeContext(context);' below */ - poptFreeContext(context); - - main_exit(); /* unref 'cmdline_captive_vfs_object' */ - /* NOTREACHED */ -} diff --git a/src/client/cmdline/main.h b/src/client/cmdline/main.h deleted file mode 100644 index 11c23a8..0000000 --- a/src/client/cmdline/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface control functions for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_MAIN_H -#define _CAPTIVE_CLIENT_CMDLINE_MAIN_H 1 - - -#include -#include -#include - - -#define CMDLINE_POPT(longname,shortname,argInfoP,argP,descripP,argDescripP) \ - { \ - longName: (longname), \ - shortName: (shortname), \ - argInfo: (argInfoP), \ - arg: (void *)argP, \ - val: 0, \ - descrip: (descripP), \ - argDescrip: (argDescripP), \ - } -extern const struct poptOption cmdline_poptHelpOptions[]; -#define CMDLINE_POPT_AUTOHELP \ - { NULL,'\0',POPT_ARG_INCLUDE_TABLE,(struct poptOption *)cmdline_poptHelpOptions,0,"Help options:",NULL }, - - -#define CMDLINE_MAIN_ERROR (cmdline_main_error_quark()) -GQuark cmdline_main_error_quark(void); - -typedef enum { - CMDLINE_MAIN_ERROR_UNKNOWN_COMMAND, - CMDLINE_MAIN_ERROR_INVALID_COMMAND_ARGUMENTS, - CMDLINE_MAIN_ERROR_READING_COMMAND_CONFIG, - CMDLINE_MAIN_ERROR_EXCEEDING_COMMAND_OPTION, - CMDLINE_MAIN_ERROR_INVALID_COMMAND_ARGUMENT_COUNT, - CMDLINE_MAIN_ERROR_GENERIC_ERROR - } CmdlineMainError; - - -struct cmdline_command { - const gchar *name,*description; - const struct poptOption *table; - void (*func)(const char **cmd_argv,GError **errp); - gint argsn_min,argsn_max; - }; - -extern const struct cmdline_command cmdline_command_table[]; - - -extern CaptiveVfsObject *cmdline_captive_vfs_object; - - -void invoke_cmd(int cmd_argc,const char **cmd_argv); -void err_cleanup(GError **errp); -gboolean errvfsresult_to_gerr(GError **errp,GnomeVFSResult errvfsresult); -void main_exit(void); - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_MAIN_H */ diff --git a/src/client/cmdline/utf8.c b/src/client/cmdline/utf8.c deleted file mode 100644 index 9b87671..0000000 --- a/src/client/cmdline/utf8.c +++ /dev/null @@ -1,59 +0,0 @@ -/* $Id$ - * client cmdline interface GnomeVFSFileInfo utils for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include /* for g_get_charset() */ - - -#include "utf8.h" /* self */ - - -gchar *cmd_utf8_macro_malloc_errorchecking( - gchar *(*func)(const gchar *string,gssize len,gsize *bytes_read,gsize *bytes_written,GError **error), - const gchar *func_name, - const gchar *string) -{ -GError *error; -gchar *r; - - g_return_val_if_fail(func!=NULL,NULL); - g_return_val_if_fail(string!=NULL,NULL); - - error=NULL; - r=(*func)( - string, /* opsysstring/utf8string */ - -1, /* len; '\0'-terminated */ - NULL, /* bytes_read */ - NULL, /* bytes_written */ - &error); /* error */ - if (error) { -const gchar *charset; - - g_get_charset(&charset); - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_WARNING,"captivefs %s(): name=\"%s\"; g_get_charset()=\"%s\", %s: %s", - func_name,string,charset, - _("fix environment variables - locale(7), mount(8) and locale(1) commands \"locale\" and \"locale -a\""), - error->message); - g_clear_error(&error); - } - return r; -} diff --git a/src/client/cmdline/utf8.h b/src/client/cmdline/utf8.h deleted file mode 100644 index f0b7acd..0000000 --- a/src/client/cmdline/utf8.h +++ /dev/null @@ -1,60 +0,0 @@ -/* $Id$ - * Include file for client cmdline interface GnomeVFSFileInfo utils for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_CMDLINE_UTF8_H -#define _CAPTIVE_CLIENT_CMDLINE_UTF8_H 1 - - -#include -#include -#include - - -gchar *cmd_utf8_macro_malloc_errorchecking( - gchar *(*func)(const gchar *string,gssize len,gsize *bytes_read,gsize *bytes_written,GError **error), - const gchar *func_name, - const gchar *string); - - -#define CMD_UTF8_MACRO_ALLOCA(func,string) ({ \ - const gchar *_cmd_utf8_macro_alloca_string=(string); \ - gchar *_cmd_utf8_macro_alloca_r_malloc; \ - const gchar *_cmd_utf8_macro_alloca_r; \ - \ - _cmd_utf8_macro_alloca_r_malloc=cmd_utf8_macro_malloc_errorchecking( \ - func, \ - G_STRINGIFY(func), \ - _cmd_utf8_macro_alloca_string); \ - if (!_cmd_utf8_macro_alloca_r_malloc) \ - _cmd_utf8_macro_alloca_r=_cmd_utf8_macro_alloca_string; \ - else { \ - _cmd_utf8_macro_alloca_r=captive_strdup_alloca(_cmd_utf8_macro_alloca_r_malloc); \ - g_free(_cmd_utf8_macro_alloca_r_malloc); \ - } \ - _cmd_utf8_macro_alloca_r; \ - }) - - -#define CMD_FILENAME_TO_UTF8_ALLOCA(string) CMD_UTF8_MACRO_ALLOCA(g_filename_to_utf8,(string)) -#define CMD_FILENAME_FROM_UTF8_ALLOCA(string) CMD_UTF8_MACRO_ALLOCA(g_filename_from_utf8,(string)) -#define CMD_LOCALE_TO_UTF8_ALLOCA(string) CMD_UTF8_MACRO_ALLOCA(g_locale_to_utf8,(string)) -#define CMD_LOCALE_FROM_UTF8_ALLOCA(string) CMD_UTF8_MACRO_ALLOCA(g_locale_from_utf8,(string)) - - -#endif /* _CAPTIVE_CLIENT_CMDLINE_UTF8_H */ diff --git a/src/client/fuse/Makefile.am b/src/client/fuse/Makefile.am deleted file mode 100644 index d551212..0000000 --- a/src/client/fuse/Makefile.am +++ /dev/null @@ -1,119 +0,0 @@ -# $Id$ -# automake source for the fuse module for fuse Makefile -# Copyright (C) 2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -mount_captive_SOURCES= \ - op_statfs.c \ - op_statfs.h \ - op_fsync.c \ - op_fsync.h \ - op_fsyncdir.c \ - op_fsyncdir.h \ - op_opendir.c \ - op_opendir.h \ - op_readdir.c \ - op_readdir.h \ - op_releasedir.c \ - op_releasedir.h \ - op_open.c \ - op_open.h \ - op_read.c \ - op_read.h \ - op_release.c \ - op_release.h \ - op_getattr.c \ - op_getattr.h \ - op_mknod.c \ - op_mknod.h \ - op_unlink.c \ - op_unlink.h \ - op_mkdir.c \ - op_mkdir.h \ - op_rmdir.c \ - op_rmdir.h \ - op_chmod.c \ - op_chmod.h \ - op_truncate.c \ - op_truncate.h \ - op_write.c \ - op_write.h \ - op_rename.c \ - op_rename.h \ - op_utime.c \ - op_utime.h \ - gnomevfsresult.c \ - gnomevfsresult.h \ - gnomevfsfileinfo.c \ - gnomevfsfileinfo.h \ - main.c \ - main.h -mount_captive_CFLAGS= $(GNOME_VFS_CFLAGS) $(FUSE_CFLAGS) -mount_captive_LDADD =$(captive_library) $(GNOME_VFS_LIBS) $(FUSE_LIBS) $(INTLLIBS) -mount_captive_LDFLAGS=$(READLINE_LDFLAGS) - -mount_captive_CFLAGS+=-DLIBEXECDIR="$(libexecdir)" -mount_captive_CFLAGS+=-DVARLIBCAPTIVEDIR="$(localstatedir)/lib/$(PACKAGE)" - -if ENABLE_FUSE -if ENABLE_SBIN_MOUNT -mount_captive_cond=mount.captive -initd_SCRIPTS_cond=captive - -install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(enable_sbin_mountdir) - IFS=:; \ - enable_sbin_mount_fs="$(enable_sbin_mount_fs)"; \ - for fs in $$enable_sbin_mount_fs; do \ - if test $$fs != no; then \ - $(RM) $(DESTDIR)$(enable_sbin_mountdir)/mount.captive-$$fs; \ - $(LN_S) mount.captive $(DESTDIR)$(enable_sbin_mountdir)/mount.captive-$$fs; \ - fi; \ - done - -else -install-exec-hook: - @true - -endif -else -install-exec-hook: - @true - -endif -enable_sbin_mount_PROGRAMS=$(mount_captive_cond) - -EXTRA_DIST+=mount.captive.pod.pl.in -CLEANFILES+=mount.captive.pod mount.captive.1 - -if ENABLE_MAN_PAGES -if ENABLE_FUSE -if ENABLE_SBIN_MOUNT -mount_captive_man_cond=mount.captive.8 -endif -endif -endif -man_MANS=$(mount_captive_man_cond) - -initd_SCRIPTS=$(initd_SCRIPTS_cond) -EXTRA_DIST+=captive.init -CLEANFILES+=captive -captive: captive.init - $(LN_S) $< $@ - diff --git a/src/client/fuse/captive.init b/src/client/fuse/captive.init deleted file mode 100755 index b26498e..0000000 --- a/src/client/fuse/captive.init +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/bash -# -# captive Start/Stop the cron clock daemon. -# -# chkconfig: 2345 99 01 -# description: Captive allows applications running under the GNU/Linux -# operating system to access NTFS drives. File system driver -# compatibility with VFAT, ISO9660 and EXT2 is also provided. - -# Source function library. -. /etc/init.d/functions - -# Never drop this lock - we need to catch manually mounts on system shutdown. -touch /var/lock/subsys/captive - - -start() { - # In fact this part is done during the boot anyway. - grep -q '\' /etc/fstab || return - - fses="$(echo /sbin/mount.captive-*|sed 's#/sbin/mount[.]##g'|tr ' ' ,)" - if [ -z "$fses" ]; then - return - fi - action $"Mounting captive filesystems: " mount -a -t "$fses" - RETVAL=$? - echo - return $RETVAL -} - -stop() { - # I did not find any way how to identify (or even mark) "captive-*" - # filesystems between the mounted ones. - # Devicename really must be set to the real devicename as otherwise - # mount(8) would try to mount "captive-*" twice during boot. - action $"Unmounting captive (FUSE) filesystems: " umount -a -t fuse - RETVAL=$? - return $RETVAL -} - -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - *) - echo $"Usage: $0 {start|stop|restart}" - exit 1 -esac diff --git a/src/client/fuse/gnomevfsfileinfo.c b/src/client/fuse/gnomevfsfileinfo.c deleted file mode 100644 index 4f07b76..0000000 --- a/src/client/fuse/gnomevfsfileinfo.c +++ /dev/null @@ -1,118 +0,0 @@ -/* $Id$ - * Client fuse interface handling of 'GnomeVFSFileInfo' for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include "gnomevfsresult.h" /* self */ -#include "main.h" - - -static CaptiveVfsVolumeInfo volume_info; -static gboolean volume_info_valid=FALSE; - - -int gnomevfsfileinfo_to_stat(struct stat *stat,const GnomeVFSFileInfo *file_info) -{ - g_return_val_if_fail(stat!=NULL,-EINVAL); - g_return_val_if_fail(file_info!=NULL,-EINVAL); - - if (!volume_info_valid) { -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_vfs_volume_info_get(capfuse_captive_vfs_object,&volume_info))) - return -gnomevfsresult_to_errno(errvfsresult); - volume_info_valid=TRUE; - } - - stat->st_mode=0; - - if (file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_TYPE) - switch (file_info->type) { - case GNOME_VFS_FILE_TYPE_REGULAR: - stat->st_mode|=S_IFREG; - if (1 /* !private */) - stat->st_mode|=0444; - break; - case GNOME_VFS_FILE_TYPE_DIRECTORY: - stat->st_mode|=S_IFDIR; - if (1 /* !private */) - stat->st_mode|=0555; - break; - default: - g_warning("Unknown GnomeVFSFileInfo.type=%d of: %s",(int)file_info->type,file_info->name); - return -EINVAL; - } - if (file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) - stat->st_mode|=file_info->permissions & 0777; - else - stat->st_mode|=0600; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT)) - stat->st_nlink=1; - else - stat->st_nlink=file_info->link_count; - - stat->st_uid=0; /* we own the file */ - stat->st_gid=0; /* we own the file */ - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_SIZE)) - stat->st_size=0; - else - stat->st_size=file_info->size; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_ATIME)) - stat->st_atime=time(NULL); - else - stat->st_atime=file_info->atime; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_MTIME)) - stat->st_mtime=time(NULL); - else - stat->st_mtime=file_info->mtime; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_CTIME)) - stat->st_ctime=time(NULL); - else - stat->st_ctime=file_info->ctime; - - stat->st_blksize=volume_info.block_size; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT)) { - /* Rounding? */ - /* 0? */ - stat->st_blocks=stat->st_size/volume_info.block_size; - } - else - stat->st_blocks=file_info->block_count; - - stat->st_dev=0; - stat->st_rdev=0; /* Never to be used. */ - stat->st_ino=0; - - return 0; -} diff --git a/src/client/fuse/gnomevfsfileinfo.h b/src/client/fuse/gnomevfsfileinfo.h deleted file mode 100644 index f37098c..0000000 --- a/src/client/fuse/gnomevfsfileinfo.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface handling of 'GnomeVFSFileInfo' for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_GNOMEVFSFILEINFO_H -#define _CAPTIVE_CLIENT_FUSE_GNOMEVFSFILEINFO_H 1 - - -#include -#include - - -int gnomevfsfileinfo_to_stat(struct stat *stat,const GnomeVFSFileInfo *file_info); - - -#endif /* _CAPTIVE_CLIENT_FUSE_GNOMEVFSFILEINFO_H */ diff --git a/src/client/fuse/gnomevfsresult.c b/src/client/fuse/gnomevfsresult.c deleted file mode 100644 index d0e239e..0000000 --- a/src/client/fuse/gnomevfsresult.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $Id$ - * Client fuse interface handling of 'GnomeVFSResult' for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "gnomevfsresult.h" /* self */ - - -/* Config: */ -#define ERRNO_VALUE_MAX 0x400 - - -/* map: GINT_TO_POINTER(GnomeVFSResult) -> GINT_TO_POINTER(errno) */ -static GHashTable *gnomevfsresult_to_errno_hash; - -static void gnomevfsresult_to_errno_hash_init(void) -{ -int errno_i; - - if (gnomevfsresult_to_errno_hash) - return; - gnomevfsresult_to_errno_hash=g_hash_table_new(g_direct_hash,g_direct_equal); - for (errno_i=1;errno_i - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_GNOMEVFSRESULT_H -#define _CAPTIVE_CLIENT_FUSE_GNOMEVFSRESULT_H 1 - - -#include - - -int gnomevfsresult_to_errno(GnomeVFSResult gnomevfsresult); - - -#endif /* _CAPTIVE_CLIENT_FUSE_GNOMEVFSRESULT_H */ diff --git a/src/client/fuse/main.c b/src/client/fuse/main.c deleted file mode 100644 index 0935914..0000000 --- a/src/client/fuse/main.c +++ /dev/null @@ -1,279 +0,0 @@ -/* $Id$ - * client FUSE interface for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "main.h" /* self */ -#include "op_statfs.h" -#include "op_fsync.h" -#include "op_fsyncdir.h" -#include "op_opendir.h" -#include "op_readdir.h" -#include "op_releasedir.h" -#include "op_open.h" -#include "op_read.h" -#include "op_release.h" -#include "op_getattr.h" -#include "op_mknod.h" -#include "op_unlink.h" -#include "op_mkdir.h" -#include "op_rmdir.h" -#include "op_chmod.h" -#include "op_truncate.h" -#include "op_write.h" -#include "op_rename.h" -#include "op_utime.h" - - -/* Config: */ -/* FIXME: Dupe with libcaptive/client/options.c */ -#define DEFAULT_SYSLOG_FACILITY LOG_DAEMON -/* Each element must be preceded by a comma (',')! */ -#define LIBFUSE_ADDONS ",default_permissions,kernel_cache" - - -CaptiveVfsObject *capfuse_captive_vfs_object; - -static const struct poptOption popt_table[]={ - CAPTIVE_POPT_INCLUDE, - POPT_AUTOHELP - POPT_TABLEEND - }; - -static const struct fuse_operations capfuse_operations={ - statfs: op_statfs, - fsync: op_fsync, - fsyncdir: op_fsyncdir, - opendir: op_opendir, - readdir: op_readdir, - releasedir: op_releasedir, - open: op_open, - read: op_read, - release: op_release, - getattr: op_getattr, - mknod: op_mknod, - unlink: op_unlink, - mkdir: op_mkdir, - rmdir: op_rmdir, - chmod: op_chmod, - truncate: op_truncate, - write: op_write, - rename: op_rename, - utime: op_utime, - }; - -/* argv[0] expected as the program name. */ -/* Only options and mountpoint expected here. */ -static void capfuse_run(int argc,const char **argv) -{ -char *capfuse_mountpoint; -int capfuse_multithreaded,capfuse_fd; -struct fuse *capfuse_fuse; - - if (!(capfuse_fuse=fuse_setup( - argc, /* argc */ - (/*de-const; broken fuset_setup()*/char **)argv, /* argv */ - &capfuse_operations, /* op */ - sizeof(capfuse_operations), /* op_size */ - &capfuse_mountpoint, /* mountpoint */ - &capfuse_multithreaded, /* multithreaded */ - &capfuse_fd))) /* fd */ - g_error(_("FUSE fuse_setup() failed")); - if (fuse_loop(capfuse_fuse)) { - /* Do not: g_error(_("FUSE fuse_loop() error")); - * as it is caused on each umount(8). - * FIXME: Why? - */ - } - fuse_teardown(capfuse_fuse,capfuse_fd,capfuse_mountpoint); -} - -int main(int argc,char **argv) -{ -poptContext context; -int errint; -int rest_argc,i; -const char **rest_argv,**csp; -struct captive_options options; -const char **capfuse_argv; -const char *program_name=argv[0]; -const char *sandbox_server_argv0=G_STRINGIFY(LIBEXECDIR) "/captive-sandbox-server"; -const char *image_filename; - - g_log_set_always_fatal(~(0 - |G_LOG_LEVEL_MESSAGE - |G_LOG_LEVEL_INFO - |G_LOG_LEVEL_DEBUG - )); - - captive_standalone_init(); - - captive_options_init(&options); - captive_options=&options; /* for parsing by 'CAPTIVE_POPT_INCLUDE' */ - - g_assert(!options.sandbox_server_argv); - g_assert(!options.sandbox_server_ior); - /* captive_options_free(&options) will: g_free(options.sandbox_server_argv); */ - /* Allocation is so terrible to be compatible with: captive_options_copy() */ - options.sandbox_server_argv=g_malloc(2*sizeof(*options.sandbox_server_argv)+strlen(sandbox_server_argv0)+1); - options.sandbox_server_argv[0]=(char *)(options.sandbox_server_argv+2); - options.sandbox_server_argv[1]=NULL; - strcpy(options.sandbox_server_argv[0],sandbox_server_argv0); - options.sandbox=TRUE; - - g_assert(!options.bug_pathname); - options.bug_pathname=g_strdup(G_STRINGIFY(VARLIBCAPTIVEDIR) "/bug-%FT%T.captivebug.xml.gz"); - - options.syslog_facility=DEFAULT_SYSLOG_FACILITY; - - context=poptGetContext( - PACKAGE, /* name */ - argc,(/*en-const*/const char **)argv, /* argc,argv */ - popt_table, /* options */ - POPT_CONTEXT_POSIXMEHARDER); /* flags; && !POPT_CONTEXT_KEEP_FIRST */ - if (context==NULL) { - g_error(_("Error parsing command-line arguments")); - return EXIT_FAILURE; - } - errint=poptReadDefaultConfig(context, - TRUE); /* useEnv */ - if (errint!=0) - g_warning(_("Error reading default popt configuration")); - errint=poptGetNextOpt(context); - if (errint!=-1) { - g_error(_("Error parsing (dash-prefixed) command-line argument")); - return EXIT_FAILURE; - } - rest_argv=poptGetArgs(context); - for (csp=rest_argv,rest_argc=0;csp && *csp;csp++) - rest_argc++; - - captive_options=NULL; /* already parsed by 'CAPTIVE_POPT_INCLUDE' */ - - /* Override the (default) Captive options with mount(8) supplied "-o" argument. */ - /* rest_argv[0] is the device now. */ - /* rest_argv[1] is the mountpoint now. */ - if (rest_argc>=4 && !strcmp(rest_argv[2],"-o")) { -const char *cs=rest_argv[3]; - - while (cs&&*cs) { - if ((!strncmp(cs,"ro",2) || !strncmp(cs,"rw",2)) && (cs[2]==',' || !cs[2])) { - if (!strncmp(cs,"ro",2)) - options.rwmode=CAPTIVE_OPTION_RWMODE_RO; - if (!strncmp(cs,"rw",2)) - options.rwmode=CAPTIVE_OPTION_RWMODE_RW; - } - if ((cs=strchr(cs,','))) - cs++; - } - } - - /* image_iochannel */ - if (rest_argc<1) { - g_error(_("File/device disk image pathname command-line argument required")); - return EXIT_FAILURE; - } - g_assert(options.image_iochannel==NULL); - image_filename=rest_argv[0]; - rest_argc--; - rest_argv++; - if (!(options.image_iochannel=g_io_channel_new_file( - image_filename, /* filename */ - (options.rwmode==CAPTIVE_OPTION_RWMODE_RW ? "r+" : "r"), /* mode */ - NULL))) { /* error */ - g_error(_("image_iochannel failed open of: %s"),image_filename); - return EXIT_FAILURE; - } - - if (options.filesystem.type==CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY) { -const char *self_prefix="mount.captive-"; -size_t self_prefix_len=strlen(self_prefix); -const char *fsname; - - if ((fsname=strrchr(program_name,'/'))) - fsname++; - else - fsname=program_name; - if (strncmp(fsname,self_prefix,self_prefix_len)) - g_error(_("Cannot detected default filesystem name from my basename: %s"),fsname); - fsname+=self_prefix_len; - if (!captive_options_module_load(&options.filesystem, - captive_printf_alloca("%s/%s.sys",G_STRINGIFY(VARLIBCAPTIVEDIR),fsname))) - g_error(_("'--filesystem' option requires valid pathname ('ntfs.sys' suggested)")); - g_assert(options.filesystem.type!=CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY); - } - if (!options.load_module) { -struct captive_options_module *options_module; - - captive_new(options_module); - if (!captive_options_module_load(options_module,G_STRINGIFY(VARLIBCAPTIVEDIR) "/ntoskrnl.exe")) - g_error(_("'--load-module' option requires valid pathname ('ntoskrnl.exe' suggested)")); - - options.load_module=g_list_append(options.load_module,options_module); - } - - if (GNOME_VFS_OK!=captive_vfs_new(&capfuse_captive_vfs_object,&options)) { - g_error(_("captive_vfs_new() failed")); - return EXIT_FAILURE; - } - captive_options_free(&options); - - /* Simulate argv[0] there as it got cut by popt. */ - captive_newn_alloca(capfuse_argv,1+rest_argc+1+2); - capfuse_argv[0]=argv[0]; - memcpy(capfuse_argv+1,rest_argv,sizeof(*rest_argv)*(rest_argc+1)); - - for (i=1;capfuse_argv[i];i++) { - if (strcmp(capfuse_argv[i],"-o")) - continue; - capfuse_argv[i+1]=captive_printf_alloca("fsname=%s" LIBFUSE_ADDONS ",%s",image_filename,capfuse_argv[i+1]); - break; - } - if (!capfuse_argv[i]) { - capfuse_argv[i ]="-o"; - capfuse_argv[i+1]=captive_printf_alloca("fsname=%s" LIBFUSE_ADDONS,image_filename); - capfuse_argv[i+2]=NULL; - } - - /* FIXFUSE: fuse_main()/fuse_main_real() would be enough for Captive fuse but - * the public interface of fuse_main() is too broken. - */ - capfuse_run(1+rest_argc,capfuse_argv); - - /* 'rest_argv' gets cleared by 'poptFreeContext(context);' below */ - poptFreeContext(context); - - if (capfuse_captive_vfs_object) { - g_object_unref(capfuse_captive_vfs_object); - capfuse_captive_vfs_object=NULL; - } - - return EXIT_SUCCESS; -} diff --git a/src/client/fuse/main.h b/src/client/fuse/main.h deleted file mode 100644 index 13d72c4..0000000 --- a/src/client/fuse/main.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface control functions for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_MAIN_H -#define _CAPTIVE_CLIENT_FUSE_MAIN_H 1 - - -#include - - -extern CaptiveVfsObject *capfuse_captive_vfs_object; - - -#endif /* _CAPTIVE_CLIENT_FUSE_MAIN_H */ diff --git a/src/client/fuse/mount.captive.pod.pl.in b/src/client/fuse/mount.captive.pod.pl.in deleted file mode 100644 index 4b1e176..0000000 --- a/src/client/fuse/mount.captive.pod.pl.in +++ /dev/null @@ -1,148 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for captive(7) man page -# Copyright (C) 2003-2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -print <<'POD_EOF'; -=head1 NAME - -mount.@PACKAGE@ - B(8) interface for NTFS disk access - - -=head1 SYNOPSIS - -B {B|B} B -[B<-n>] [B<-v>] [B<-o> B] - -B B<-t> B<@PACKAGE@-ntfs> -[B<-n>] [B<-v>] [B<-o> B] -{B|B} B - - -=head1 DESCRIPTION - -B(8) provides B(8) interface to B<@PACKAGE@>(7) library -You should never call this command directly - use B(8) instead. - -B(8) (B<@PACKAGE@> filesystem type) is never used - this command -is provided just as a base mount(8) interface to B<@PACKAGE@>(7). You must always -use @PACKAGE@-B filesystem type such as B<@PACKAGE@-ntfs>. Other supported -filesystem types are: -POD_EOF -print join ", ",map("B<$_>",(split /:/,'@enable_sbin_mount_fs@')); -print <<'POD_EOF'; - - -=head1 OPTIONS - -=over - -=item {B|B} - -Pathname such as B or B. You should refer to the -partition name, not the whole device (B is forbidden). -B may correspond to B -on your system. - - -=item B - -Existing empty target directory where {B|B} will be -mounted. - - -=item B<-n> - -Do not modify B. This option is currently not supported (ignored), -B is modified notwithstanding. - - -=item B<-v> - -Enable verbose mode. Command B(1) being called is shown. - - -=item B<-o> B - -Custom options passed to B<@PACKAGE@>(7) separated by comma (B<,>). -See the B<@PACKAGE@>(7) manpage for details on options prefixed by -double-dashes (B<-->) will be used for B(7) / -B(8). Options without double-dashes (B<-->) will be used for -B(1). You may be interested in these unprefixed options: - -=over - -=item B - -Force the mount of {B|B} despite it appears to be already -mounted according to B(5). You should never mount a device multiple -times in read-write mode. It is safe to mount it multiple times in read-only -mode. It is safe to mount it once in read-write mode and multiple times -in read-only mode although you may encounter filesystem errors by the read-only -filesystems in such case. - -This is the only option is interpreted by B itself; it is not -B(7) nor B(1) option. - -=item B - -B(8) defaults to filesystem files B<644> - read-write for system -root (or the regular user owner) and read-only for others. You can force the -mode B<600> by this option (read-write for the owner, inaccessible for others). -Mode B<755> or <700> applies to directories. Options B/B will -be OR-ed to the private/public permissions set by this option. - -=item B=B<666> - -Octal mask to be OR-ed on file permissions (minimum file permissions). - -=item B=B<777> - -Octal mask to be OR-ed on directory permissions (minimum directory -permissions). - -=item B=B<500> - -Supply the B to be the user identification number owning all the files. - -=item B=B<500> - -Supply the B to be the group identification number owning all the files. - -=back - -=back - - -=head1 SEE ALSO - -B<@PACKAGE@>(7) - - -=head1 AUTHOR - -Jan Kratochvil >, - I -POD_EOF -1; diff --git a/src/client/fuse/op_chmod.c b/src/client/fuse/op_chmod.c deleted file mode 100644 index e09e6c3..0000000 --- a/src/client/fuse/op_chmod.c +++ /dev/null @@ -1,65 +0,0 @@ -/* $Id$ - * Client fuse interface operation "chmod" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "op_chmod.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" -#include "gnomevfsfileinfo.h" - - -int op_chmod(const char *path,mode_t mode) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; -GnomeVFSFileInfo file_info; - - g_return_val_if_fail(path!=NULL,-EINVAL); - - if (1 - && !S_ISREG(mode) - && !S_ISDIR(mode)) - return -EPERM; - - /* Do not: GNOME_VFS_OPEN_WRITE - * as we would get EPERM for setting back: chmod u+w - */ - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,path,0))) - return -gnomevfsresult_to_errno(errvfsresult); - - file_info.valid_fields=0 - |GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS - |GNOME_VFS_FILE_INFO_FIELDS_ACCESS; - file_info.permissions=mode; - errvfsresult=captive_file_file_info_set(captive_file_object,&file_info,GNOME_VFS_SET_FILE_INFO_PERMISSIONS); - - g_object_unref(captive_file_object); - if (GNOME_VFS_OK!=errvfsresult) - return -gnomevfsresult_to_errno(errvfsresult); - - return 0; -} diff --git a/src/client/fuse/op_chmod.h b/src/client/fuse/op_chmod.h deleted file mode 100644 index a6e3d52..0000000 --- a/src/client/fuse/op_chmod.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "chmod" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_CHMOD_H -#define _CAPTIVE_CLIENT_FUSE_OP_CHMOD_H 1 - - -#include -#include - - -int op_chmod(const char *path,mode_t mode); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_CHMOD_H */ diff --git a/src/client/fuse/op_fsync.c b/src/client/fuse/op_fsync.c deleted file mode 100644 index b49d8f7..0000000 --- a/src/client/fuse/op_fsync.c +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id$ - * Client fuse interface operation "fsync" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include - -#include "op_fsync.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_fsync(const char *path,int datasync,struct fuse_file_info *fi) -{ - g_return_val_if_fail(path!=NULL,-EINVAL); - - return -gnomevfsresult_to_errno(captive_vfs_commit(capfuse_captive_vfs_object)); -} diff --git a/src/client/fuse/op_fsync.h b/src/client/fuse/op_fsync.h deleted file mode 100644 index 6830d29..0000000 --- a/src/client/fuse/op_fsync.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "fsync" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_FSYNC_H -#define _CAPTIVE_CLIENT_FUSE_OP_FSYNC_H 1 - - -#include - - -int op_fsync(const char *path,int datasync,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_FSYNC_H */ diff --git a/src/client/fuse/op_fsyncdir.c b/src/client/fuse/op_fsyncdir.c deleted file mode 100644 index 5f680ac..0000000 --- a/src/client/fuse/op_fsyncdir.c +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id$ - * Client fuse interface operation "fsyncdir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include - -#include "op_fsyncdir.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_fsyncdir(const char *path,int datasync,struct fuse_file_info *fi) -{ - g_return_val_if_fail(path!=NULL,-EINVAL); - - return -gnomevfsresult_to_errno(captive_vfs_commit(capfuse_captive_vfs_object)); -} diff --git a/src/client/fuse/op_fsyncdir.h b/src/client/fuse/op_fsyncdir.h deleted file mode 100644 index d567cec..0000000 --- a/src/client/fuse/op_fsyncdir.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "fsyncdir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_FSYNCDIR_H -#define _CAPTIVE_CLIENT_FUSE_OP_FSYNCDIR_H 1 - - -#include - - -int op_fsyncdir(const char *path,int datasync,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_FSYNCDIR_H */ diff --git a/src/client/fuse/op_getattr.c b/src/client/fuse/op_getattr.c deleted file mode 100644 index 071027e..0000000 --- a/src/client/fuse/op_getattr.c +++ /dev/null @@ -1,59 +0,0 @@ -/* $Id$ - * Client fuse interface operation "getattr" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "op_getattr.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" -#include "gnomevfsfileinfo.h" - - -int op_getattr(const char *path,struct stat *buf) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; -GnomeVFSFileInfo file_info; -int errint; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(buf!=NULL,-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,path,0))) - return -gnomevfsresult_to_errno(errvfsresult); - - /* Pre-clear to take care of any fields not touched by libcaptive there. */ - CAPTIVE_MEMZERO(&file_info); - errvfsresult=captive_file_file_info_get(captive_file_object,&file_info); - - g_object_unref(captive_file_object); - if (GNOME_VFS_OK!=errvfsresult) - return -gnomevfsresult_to_errno(errvfsresult); - errint=gnomevfsfileinfo_to_stat(buf,&file_info); - gnome_vfs_file_info_clear(&file_info); - - return errint; -} diff --git a/src/client/fuse/op_getattr.h b/src/client/fuse/op_getattr.h deleted file mode 100644 index 10909f0..0000000 --- a/src/client/fuse/op_getattr.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "getattr" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_GETATTR_H -#define _CAPTIVE_CLIENT_FUSE_OP_GETATTR_H 1 - - -#include -#include - - -int op_getattr(const char *path,struct stat *buf); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_GETATTR_H */ diff --git a/src/client/fuse/op_mkdir.c b/src/client/fuse/op_mkdir.c deleted file mode 100644 index a9a646f..0000000 --- a/src/client/fuse/op_mkdir.c +++ /dev/null @@ -1,54 +0,0 @@ -/* $Id$ - * Client fuse interface operation "mkdir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "op_mkdir.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_mkdir(const char *path,mode_t mode) -{ -CaptiveDirectoryObject *captive_directory_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(path!=NULL,-EINVAL); - - /* Do not: if (!S_ISDIR(mode)) - * as FUSE does not set it. - */ - if (mode&S_IFMT) - return -EPERM; - - if (GNOME_VFS_OK!=(errvfsresult=captive_directory_new_make(&captive_directory_object,capfuse_captive_vfs_object, - path, /* pathname */ - mode))) /* perm */ - return -gnomevfsresult_to_errno(errvfsresult); - - g_object_unref(captive_directory_object); - - return 0; -} diff --git a/src/client/fuse/op_mkdir.h b/src/client/fuse/op_mkdir.h deleted file mode 100644 index 5d851c3..0000000 --- a/src/client/fuse/op_mkdir.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "mkdir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_MKDIR_H -#define _CAPTIVE_CLIENT_FUSE_OP_MKDIR_H 1 - - -#include -#include - - -int op_mkdir(const char *path,mode_t mode); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_MKDIR_H */ diff --git a/src/client/fuse/op_mknod.c b/src/client/fuse/op_mknod.c deleted file mode 100644 index 79a445d..0000000 --- a/src/client/fuse/op_mknod.c +++ /dev/null @@ -1,53 +0,0 @@ -/* $Id$ - * Client fuse interface operation "mknod" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "op_mknod.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_mknod(const char *path,mode_t mode,dev_t rdev) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(path!=NULL,-EINVAL); - - if (!S_ISREG(mode)) - return -EPERM; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_create(&captive_file_object,capfuse_captive_vfs_object, - path, /* pathname */ - 0, /* mode */ - TRUE, /* exclusive */ - mode))) /* perm */ - return -gnomevfsresult_to_errno(errvfsresult); - - g_object_unref(captive_file_object); - - return 0; -} diff --git a/src/client/fuse/op_mknod.h b/src/client/fuse/op_mknod.h deleted file mode 100644 index c4a0cae..0000000 --- a/src/client/fuse/op_mknod.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "mknod" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_MKNOD_H -#define _CAPTIVE_CLIENT_FUSE_OP_MKNOD_H 1 - - -#include -#include - - -int op_mknod(const char *path,mode_t mode,dev_t rdev); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_MKNOD_H */ diff --git a/src/client/fuse/op_open.c b/src/client/fuse/op_open.c deleted file mode 100644 index 9f63503..0000000 --- a/src/client/fuse/op_open.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id$ - * Client fuse interface operation "open" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "op_open.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_open(const char *path,struct fuse_file_info *fi) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(fi!=NULL,-EINVAL); - g_return_val_if_fail(sizeof(fi->fh)==sizeof(unsigned long),-EINVAL); - g_return_val_if_fail(sizeof(fi->fh)>=sizeof(CaptiveFileObject *),-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,path, - GNOME_VFS_OPEN_RANDOM - || (!(fi->flags&(O_RDONLY|O_RDWR)) ? 0 : GNOME_VFS_OPEN_READ) - || (!(fi->flags&(O_WRONLY|O_RDWR|O_APPEND)) ? 0 : GNOME_VFS_OPEN_WRITE)))) - return -gnomevfsresult_to_errno(errvfsresult); - - fi->fh=(unsigned long)captive_file_object; - /* No data can change beneath FUSE. */ - fi->keep_cache=1; - - return 0; -} diff --git a/src/client/fuse/op_open.h b/src/client/fuse/op_open.h deleted file mode 100644 index 2aa7ab7..0000000 --- a/src/client/fuse/op_open.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "open" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_OPEN_H -#define _CAPTIVE_CLIENT_FUSE_OP_OPEN_H 1 - - -#include - - -int op_open(const char *path,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_OPEN_H */ diff --git a/src/client/fuse/op_opendir.c b/src/client/fuse/op_opendir.c deleted file mode 100644 index 53370ac..0000000 --- a/src/client/fuse/op_opendir.c +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ - * Client fuse interface operation "opendir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "op_opendir.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_opendir(const char *path,struct fuse_file_info *fi) -{ -CaptiveDirectoryObject *captive_directory_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(fi!=NULL,-EINVAL); - g_return_val_if_fail(sizeof(fi->fh)==sizeof(unsigned long),-EINVAL); - g_return_val_if_fail(sizeof(fi->fh)>=sizeof(CaptiveDirectoryObject *),-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_directory_new_open(&captive_directory_object,capfuse_captive_vfs_object,path))) - return -gnomevfsresult_to_errno(errvfsresult); - - fi->fh=(unsigned long)captive_directory_object; - /* No data can change beneath FUSE. */ - fi->keep_cache=1; - - return 0; -} diff --git a/src/client/fuse/op_opendir.h b/src/client/fuse/op_opendir.h deleted file mode 100644 index a522f77..0000000 --- a/src/client/fuse/op_opendir.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "opendir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_OPENDIR_H -#define _CAPTIVE_CLIENT_FUSE_OP_OPENDIR_H 1 - - -#include - - -int op_opendir(const char *path,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_OPENDIR_H */ diff --git a/src/client/fuse/op_read.c b/src/client/fuse/op_read.c deleted file mode 100644 index 6482c84..0000000 --- a/src/client/fuse/op_read.c +++ /dev/null @@ -1,54 +0,0 @@ -/* $Id$ - * Client fuse interface operation "read" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "op_read.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_read(const char *path,char *buf,size_t size,off_t off,struct fuse_file_info *fi) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; -GnomeVFSFileSize bytes_read; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(buf!=NULL,-EINVAL); - g_return_val_if_fail(size>0,-EINVAL); - g_return_val_if_fail(off>=0,-EINVAL); - g_return_val_if_fail(fi!=NULL,-EINVAL); - - captive_file_object=(gpointer)fi->fh; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_seek(captive_file_object,GNOME_VFS_SEEK_START,off))) - return -gnomevfsresult_to_errno(errvfsresult); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_read(captive_file_object,buf,size,&bytes_read))) - return -gnomevfsresult_to_errno(errvfsresult); - - return bytes_read; -} diff --git a/src/client/fuse/op_read.h b/src/client/fuse/op_read.h deleted file mode 100644 index bc4cdf4..0000000 --- a/src/client/fuse/op_read.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "read" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_READ_H -#define _CAPTIVE_CLIENT_FUSE_OP_READ_H 1 - - -#include - - -int op_read(const char *path,char *buf,size_t size,off_t off,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_READ_H */ diff --git a/src/client/fuse/op_readdir.c b/src/client/fuse/op_readdir.c deleted file mode 100644 index 5bec35f..0000000 --- a/src/client/fuse/op_readdir.c +++ /dev/null @@ -1,75 +0,0 @@ -/* $Id$ - * Client fuse interface operation "readdir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "op_readdir.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" -#include "gnomevfsfileinfo.h" - - -/* int (*fuse_fill_dir_t)(void *buf,const char *name,const struct stat *stbuf,off_t off); */ - -int op_readdir(const char *path,void *buf,fuse_fill_dir_t fill_dir,off_t off,struct fuse_file_info *fi) -{ -CaptiveDirectoryObject *captive_directory_object; -GnomeVFSResult errvfsresult; -GnomeVFSFileInfo file_info; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(fill_dir!=NULL,-EINVAL); - g_return_val_if_fail(fi!=NULL,-EINVAL); - - captive_directory_object=(gpointer)fi->fh; - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),-EINVAL); - - /* Pre-clear to take care of any fields not touched by libcaptive there. */ - CAPTIVE_MEMZERO(&file_info); - gnome_vfs_file_info_clear(&file_info); - while (GNOME_VFS_OK==(errvfsresult=captive_directory_read( - captive_directory_object, /* captive_directory_object */ - &file_info))) { /* file_info */ -struct stat stat; -int errint; - - if ((errint=gnomevfsfileinfo_to_stat(&stat,&file_info))) - return errint; - errint=(*fill_dir)( - buf, /* buf; opaque */ - file_info.name, /* name */ - &stat, /* stbuf */ - 0); /* off; operation mode 1 - /(*readdir) */ - gnome_vfs_file_info_clear(&file_info); - if (errint) { - /* FIXME: Is it right? Examples do so. */ - break; - } - } - if (GNOME_VFS_ERROR_EOF!=errvfsresult) - return -gnomevfsresult_to_errno(errvfsresult); - - return 0; -} diff --git a/src/client/fuse/op_readdir.h b/src/client/fuse/op_readdir.h deleted file mode 100644 index 344c87d..0000000 --- a/src/client/fuse/op_readdir.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "readdir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_READDIR_H -#define _CAPTIVE_CLIENT_FUSE_OP_READDIR_H 1 - - -#include - - -int op_readdir(const char *path,void *buf,fuse_fill_dir_t fill_dir,off_t off,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_READDIR_H */ diff --git a/src/client/fuse/op_release.c b/src/client/fuse/op_release.c deleted file mode 100644 index 104a451..0000000 --- a/src/client/fuse/op_release.c +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id$ - * Client fuse interface operation "release" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "op_release.h" /* self */ -#include "main.h" - - -int op_release(const char *path,struct fuse_file_info *fi) -{ -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(fi!=NULL,-EINVAL); - - captive_file_object=(gpointer)fi->fh; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),-EINVAL); - - g_object_unref(captive_file_object); - - return 0; -} diff --git a/src/client/fuse/op_release.h b/src/client/fuse/op_release.h deleted file mode 100644 index d8ff150..0000000 --- a/src/client/fuse/op_release.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "release" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_RELEASE_H -#define _CAPTIVE_CLIENT_FUSE_OP_RELEASE_H 1 - - -#include - - -int op_release(const char *path,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_RELEASE_H */ diff --git a/src/client/fuse/op_releasedir.c b/src/client/fuse/op_releasedir.c deleted file mode 100644 index d9c044e..0000000 --- a/src/client/fuse/op_releasedir.c +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id$ - * Client fuse interface operation "releasedir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "op_releasedir.h" /* self */ -#include "main.h" - - -int op_releasedir(const char *path,struct fuse_file_info *fi) -{ -CaptiveDirectoryObject *captive_directory_object; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(fi!=NULL,-EINVAL); - - captive_directory_object=(gpointer)fi->fh; - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),-EINVAL); - - g_object_unref(captive_directory_object); - - return 0; -} diff --git a/src/client/fuse/op_releasedir.h b/src/client/fuse/op_releasedir.h deleted file mode 100644 index ec0f6e7..0000000 --- a/src/client/fuse/op_releasedir.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "releasedir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_RELEASEDIR_H -#define _CAPTIVE_CLIENT_FUSE_OP_RELEASEDIR_H 1 - - -#include - - -int op_releasedir(const char *path,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_RELEASEDIR_H */ diff --git a/src/client/fuse/op_rename.c b/src/client/fuse/op_rename.c deleted file mode 100644 index eb42cf8..0000000 --- a/src/client/fuse/op_rename.c +++ /dev/null @@ -1,57 +0,0 @@ -/* $Id$ - * Client fuse interface operation "rename" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "op_rename.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_rename(const char *oldpath,const char *newpath) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(oldpath!=NULL,-EINVAL); - g_return_val_if_fail(newpath!=NULL,-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,oldpath, - GNOME_VFS_OPEN_WRITE|GNOME_VFS_OPEN_RANDOM))) - return -gnomevfsresult_to_errno(errvfsresult); - - /* Do not: FALSE==force_replace - * as it would really return EEXIST on mv(1) over an existing file. - */ - errvfsresult=captive_file_move( - captive_file_object, /* captive_file_object_old */ - newpath, /* pathname_new */ - TRUE); /* force_replace */ - - g_object_unref(captive_file_object); - if (GNOME_VFS_OK!=errvfsresult) - return -gnomevfsresult_to_errno(errvfsresult); - return 0; -} diff --git a/src/client/fuse/op_rename.h b/src/client/fuse/op_rename.h deleted file mode 100644 index 8cc5e8c..0000000 --- a/src/client/fuse/op_rename.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "rename" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_RENAME_H -#define _CAPTIVE_CLIENT_FUSE_OP_RENAME_H 1 - - -#include -#include - - -int op_rename(const char *oldpath,const char *newpath); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_RENAME_H */ diff --git a/src/client/fuse/op_rmdir.c b/src/client/fuse/op_rmdir.c deleted file mode 100644 index 5648ae8..0000000 --- a/src/client/fuse/op_rmdir.c +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * Client fuse interface operation "rmdir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "op_rmdir.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_rmdir(const char *path) -{ -CaptiveDirectoryObject *captive_directory_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(path!=NULL,-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_directory_new_open(&captive_directory_object,capfuse_captive_vfs_object,path))) - return -gnomevfsresult_to_errno(errvfsresult); - - errvfsresult=captive_directory_remove(captive_directory_object); - g_object_unref(captive_directory_object); - if (GNOME_VFS_OK!=errvfsresult) - return -gnomevfsresult_to_errno(errvfsresult); - - return 0; -} diff --git a/src/client/fuse/op_rmdir.h b/src/client/fuse/op_rmdir.h deleted file mode 100644 index bca2cb4..0000000 --- a/src/client/fuse/op_rmdir.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "rmdir" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_RMDIR_H -#define _CAPTIVE_CLIENT_FUSE_OP_RMDIR_H 1 - - -#include -#include - - -int op_rmdir(const char *path); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_RMDIR_H */ diff --git a/src/client/fuse/op_statfs.c b/src/client/fuse/op_statfs.c deleted file mode 100644 index e34d13b..0000000 --- a/src/client/fuse/op_statfs.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id$ - * Client fuse interface operation "statfs" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "op_statfs.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_statfs(const char *path,struct statfs *stbuf) -{ -CaptiveVfsVolumeInfo volume_info; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(stbuf!=NULL,-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_vfs_volume_info_get(capfuse_captive_vfs_object,&volume_info))) - return -gnomevfsresult_to_errno(errvfsresult); - - /* : The 'f_type' and 'f_fsid' fields are ignored */ - stbuf->f_bsize =volume_info.block_size; - /* Some rounding? Which way? */ - stbuf->f_blocks =volume_info.bytes /volume_info.block_size; - stbuf->f_bfree =volume_info.bytes_free /volume_info.block_size; - stbuf->f_bavail =volume_info.bytes_available/volume_info.block_size; - stbuf->f_files =0; - stbuf->f_ffree =0; - /* For NTFS: http://en.wikipedia.org/wiki/Comparison_of_file_systems */ - stbuf->f_namelen=255; - return 0; -} diff --git a/src/client/fuse/op_statfs.h b/src/client/fuse/op_statfs.h deleted file mode 100644 index 4177807..0000000 --- a/src/client/fuse/op_statfs.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "statfs" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_STATFS_H -#define _CAPTIVE_CLIENT_FUSE_OP_STATFS_H 1 - - -#include - - -int op_statfs(const char *path,struct statfs *stbuf); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_STATFS_H */ diff --git a/src/client/fuse/op_truncate.c b/src/client/fuse/op_truncate.c deleted file mode 100644 index c8f5946..0000000 --- a/src/client/fuse/op_truncate.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $Id$ - * Client fuse interface operation "truncate" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "op_truncate.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_truncate(const char *path,off_t size) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(size>=0,-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,path, - GNOME_VFS_OPEN_WRITE|GNOME_VFS_OPEN_RANDOM))) - return -gnomevfsresult_to_errno(errvfsresult); - - errvfsresult=captive_file_truncate(captive_file_object,size); - g_object_unref(captive_file_object); - if (GNOME_VFS_OK!=errvfsresult) - return -gnomevfsresult_to_errno(errvfsresult); - - return 0; -} diff --git a/src/client/fuse/op_truncate.h b/src/client/fuse/op_truncate.h deleted file mode 100644 index f1aa05e..0000000 --- a/src/client/fuse/op_truncate.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "truncate" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_TRUNCATE_H -#define _CAPTIVE_CLIENT_FUSE_OP_TRUNCATE_H 1 - - -#include -#include - - -int op_truncate(const char *path,off_t size); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_TRUNCATE_H */ diff --git a/src/client/fuse/op_unlink.c b/src/client/fuse/op_unlink.c deleted file mode 100644 index d100ee2..0000000 --- a/src/client/fuse/op_unlink.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * Client fuse interface operation "unlink" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "op_unlink.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_unlink(const char *path) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(path!=NULL,-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,path, - GNOME_VFS_OPEN_WRITE|GNOME_VFS_OPEN_RANDOM))) - return -gnomevfsresult_to_errno(errvfsresult); - - errvfsresult=captive_file_remove(captive_file_object); - - g_object_unref(captive_file_object); - - if (GNOME_VFS_OK!=errvfsresult) - return -gnomevfsresult_to_errno(errvfsresult); - return 0; -} diff --git a/src/client/fuse/op_unlink.h b/src/client/fuse/op_unlink.h deleted file mode 100644 index 5634309..0000000 --- a/src/client/fuse/op_unlink.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "unlink" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_UNLINK_H -#define _CAPTIVE_CLIENT_FUSE_OP_UNLINK_H 1 - - -#include -#include - - -int op_unlink(const char *path); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_UNLINK_H */ diff --git a/src/client/fuse/op_utime.c b/src/client/fuse/op_utime.c deleted file mode 100644 index e106bbd..0000000 --- a/src/client/fuse/op_utime.c +++ /dev/null @@ -1,67 +0,0 @@ -/* $Id$ - * Client fuse interface operation "utime" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "op_utime.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" -#include "gnomevfsfileinfo.h" - - -int op_utime(const char *path,struct utimbuf *buf) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; -GnomeVFSFileInfo file_info; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(buf!=NULL,-EINVAL); - g_return_val_if_fail(buf->actime!=0,-EINVAL); - g_return_val_if_fail(buf->modtime!=0,-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,path, - GNOME_VFS_OPEN_WRITE|GNOME_VFS_OPEN_RANDOM))) - return -gnomevfsresult_to_errno(errvfsresult); - - file_info.valid_fields=0 - |GNOME_VFS_FILE_INFO_FIELDS_ATIME - |GNOME_VFS_FILE_INFO_FIELDS_MTIME; - file_info.atime=buf->actime; - file_info.mtime=buf->modtime; - /* It is probably not GnomeVFS compliant but still libcaptive compatible. - * GnomeVFS looks as assuming all the three fields set. - * GnomeVFS also does not check 'valid_fields' at all. - */ - file_info.ctime=0; /* Just sanity for sure. */ - errvfsresult=captive_file_file_info_set(captive_file_object,&file_info,GNOME_VFS_SET_FILE_INFO_TIME); - - g_object_unref(captive_file_object); - if (GNOME_VFS_OK!=errvfsresult) - return -gnomevfsresult_to_errno(errvfsresult); - - return 0; -} diff --git a/src/client/fuse/op_utime.h b/src/client/fuse/op_utime.h deleted file mode 100644 index 40861d9..0000000 --- a/src/client/fuse/op_utime.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "utime" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_UTIME_H -#define _CAPTIVE_CLIENT_FUSE_OP_UTIME_H 1 - - -#include -#include - - -int op_utime(const char *path,struct utimbuf *buf); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_UTIME_H */ diff --git a/src/client/fuse/op_write.c b/src/client/fuse/op_write.c deleted file mode 100644 index 5be8f2c..0000000 --- a/src/client/fuse/op_write.c +++ /dev/null @@ -1,54 +0,0 @@ -/* $Id$ - * Client fuse interface operation "write" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "op_write.h" /* self */ -#include "main.h" -#include "gnomevfsresult.h" - - -int op_write(const char *path,const char *buf,size_t size,off_t off,struct fuse_file_info *fi) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; -GnomeVFSFileSize bytes_written; - - g_return_val_if_fail(path!=NULL,-EINVAL); - g_return_val_if_fail(buf!=NULL,-EINVAL); - g_return_val_if_fail(size>0,-EINVAL); - g_return_val_if_fail(off>=0,-EINVAL); - g_return_val_if_fail(fi!=NULL,-EINVAL); - - captive_file_object=(gpointer)fi->fh; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),-EINVAL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_seek(captive_file_object,GNOME_VFS_SEEK_START,off))) - return -gnomevfsresult_to_errno(errvfsresult); - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_write(captive_file_object,buf,size,&bytes_written))) - return -gnomevfsresult_to_errno(errvfsresult); - - return bytes_written; -} diff --git a/src/client/fuse/op_write.h b/src/client/fuse/op_write.h deleted file mode 100644 index 47595d2..0000000 --- a/src/client/fuse/op_write.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Id$ - * Include file for client fuse interface operation "write" for libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FUSE_OP_WRITE_H -#define _CAPTIVE_CLIENT_FUSE_OP_WRITE_H 1 - - -#include - - -int op_write(const char *path,const char *buf,size_t size,off_t off,struct fuse_file_info *fi); - - -#endif /* _CAPTIVE_CLIENT_FUSE_OP_WRITE_H */ diff --git a/src/client/gnomevfs/Makefile.am b/src/client/gnomevfs/Makefile.am deleted file mode 100644 index 7c15c6c..0000000 --- a/src/client/gnomevfs/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -# $Id$ -# automake source for the gnomevfs module for gnome-vfs2 Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -gnomevfsmoduleslibdir=$(libdir)/gnome-vfs-2.0/modules -gnomevfsmoduleslib_LTLIBRARIES=libcaptive-gnomevfs.la - -libcaptive_gnomevfs_la_CFLAGS= $(GNOME_VFS_MODULE_CFLAGS) $(LIBXML_CFLAGS) -libcaptive_gnomevfs_la_LIBADD=$(captive_library) $(GNOME_VFS_MODULE_LIBS) -libcaptive_gnomevfs_la_LDFLAGS=-release $(VERSION) -libcaptive_gnomevfs_la_SOURCES= \ - giognomevfs.c \ - giognomevfs.h \ - gnome-vfs-method.c \ - gnome-vfs-method.h \ - gnome-vfs-module.c \ - gnome-vfs-module.h - -gnomevfsmodulesconfdir=$(sysconfdir)/gnome-vfs-2.0/modules -gnomevfsmodulesconf_DATA=captive.conf -EXTRA_DIST+=captive.conf.in diff --git a/src/client/gnomevfs/captive.conf.in b/src/client/gnomevfs/captive.conf.in deleted file mode 100644 index c03663e..0000000 --- a/src/client/gnomevfs/captive.conf.in +++ /dev/null @@ -1,69 +0,0 @@ -captive-ntfs: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/ntfs.sys --disk --rw \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-ntfs-ro: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/ntfs.sys --disk --ro \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-ntfs-blind: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/ntfs.sys --disk --blind \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-fastfat: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/fastfat.sys --disk --rw \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-fastfat-ro: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/fastfat.sys --disk --ro \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-fastfat-blind: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/fastfat.sys --disk --blind \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-cdfs: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/cdfs.sys --cdrom --ro \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-ext2fsd: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/ext2fsd.sys --disk --rw \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-ext2fsd-ro: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/ext2fsd.sys --disk --ro \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog - -captive-ext2fsd-blind: libcaptive-gnomevfs \ - --load-module=@localstatedir@/lib/captive/ntoskrnl.exe \ - --filesystem=@localstatedir@/lib/captive/ext2fsd.sys --disk --blind \ - --sandbox-server=@sbindir@/captive-sandbox-server \ - --bug-pathname=@localstatedir@/lib/captive/bug-%FT%T.captivebug.xml.gz \ - --syslog diff --git a/src/client/gnomevfs/giognomevfs.c b/src/client/gnomevfs/giognomevfs.c deleted file mode 100644 index 23ba237..0000000 --- a/src/client/gnomevfs/giognomevfs.c +++ /dev/null @@ -1,233 +0,0 @@ -/* $Id$ - * glib GIOChannel interface over gnome-vfs GnomeVFSURI for libcaptive - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/macros.h" -#include -#include -#include -#include "gnome-vfs-module.h" -#include "captive/options.h" -#include "../../libcaptive/client/lib.h" /* for captive_giochannel_setup(); FIXME: pathname */ - - -/* FIXME: fill 'err' */ - -struct captive_gnomevfs_giognomevfs { - GIOChannel iochannel; - GnomeVFSHandle *gnomevfshandle; - }; - -G_LOCK_DEFINE_STATIC(giochannel_funcs); -static GIOFuncs giochannel_funcs; - - -static gboolean validate_giognomevfs(struct captive_gnomevfs_giognomevfs *giognomevfs) -{ - g_return_val_if_fail(giognomevfs!=NULL,FALSE); - g_return_val_if_fail(giognomevfs->gnomevfshandle!=NULL,FALSE); - - return TRUE; -} - - -static GIOStatus captive_gnomevfs_giognomevfs_io_read - (GIOChannel *channel,gchar *buf,gsize count,gsize *bytes_read,GError **err) -{ -struct captive_gnomevfs_giognomevfs *giognomevfs=(struct captive_gnomevfs_giognomevfs *)channel; -GnomeVFSResult errvfsresult; -GnomeVFSFileSize bytes_read_local; - - g_return_val_if_fail(validate_giognomevfs(giognomevfs),G_IO_STATUS_ERROR); - g_return_val_if_fail(buf!=NULL,G_IO_STATUS_ERROR); - g_return_val_if_fail(bytes_read!=NULL,G_IO_STATUS_ERROR); - - errvfsresult=gnome_vfs_read( - giognomevfs->gnomevfshandle, /* handle */ - buf, /* buffer */ - count, /* bytes */ - &bytes_read_local); /* bytes_read */ - /* During seek in block device such as on URL file:///dev/hda1#captive-fastfat.sys-ro:/ - * we will do llseek(2) on "/dev/hda1" device from captive_giochannel_size(). - * During read on the end boundary of Linux kernel block device we will - * get GNOME_VFS_ERROR_IO at least from linux-kernel-2.4.19-ac4 - * therefore it must be accepted without complaints by us. - * FIXME: It would be nice to detect the state when we are called from captive_giochannel_size(). - */ - if (errvfsresult==GNOME_VFS_ERROR_IO) { - *bytes_read=0; - return G_IO_STATUS_ERROR; - } - g_return_val_if_fail((errvfsresult==GNOME_VFS_OK || errvfsresult==GNOME_VFS_ERROR_EOF),G_IO_STATUS_ERROR); - - *bytes_read=bytes_read_local; - return (errvfsresult==GNOME_VFS_ERROR_EOF ? G_IO_STATUS_EOF : G_IO_STATUS_NORMAL); -} - - -static GIOStatus captive_gnomevfs_giognomevfs_io_write - (GIOChannel *channel,const gchar *buf,gsize count,gsize *bytes_written,GError **err) -{ -struct captive_gnomevfs_giognomevfs *giognomevfs=(struct captive_gnomevfs_giognomevfs *)channel; -GnomeVFSResult errvfsresult; -GnomeVFSFileSize bytes_written_local; - - g_return_val_if_fail(validate_giognomevfs(giognomevfs),G_IO_STATUS_ERROR); - g_return_val_if_fail(buf!=NULL,G_IO_STATUS_ERROR); - g_return_val_if_fail(bytes_written!=NULL,G_IO_STATUS_ERROR); - - errvfsresult=gnome_vfs_write( - giognomevfs->gnomevfshandle, /* handle */ - buf, /* buffer */ - count, /* bytes */ - &bytes_written_local); /* bytes_written */ - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,G_IO_STATUS_ERROR); - - *bytes_written=bytes_written_local; - return G_IO_STATUS_NORMAL; -} - - -static GIOStatus captive_gnomevfs_giognomevfs_io_seek(GIOChannel *channel,gint64 offset,GSeekType type,GError **err) -{ -struct captive_gnomevfs_giognomevfs *giognomevfs=(struct captive_gnomevfs_giognomevfs *)channel; -GnomeVFSSeekPosition whence; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(validate_giognomevfs(giognomevfs),G_IO_STATUS_ERROR); - - switch (type) { - case G_SEEK_CUR: whence=GNOME_VFS_SEEK_CURRENT; break; - case G_SEEK_SET: whence=GNOME_VFS_SEEK_START; break; - case G_SEEK_END: whence=GNOME_VFS_SEEK_END; break; - default: g_return_val_if_reached(G_IO_STATUS_ERROR); - } - errvfsresult=gnome_vfs_seek(giognomevfs->gnomevfshandle,whence,offset); - /* During seek in block device such as on URL file:///dev/hda1#captive-fastfat.sys-ro:/ - * we will do llseek(2) on "/dev/hda1" device from captive_giochannel_size(). - * Although we are allowed to seek behind EOF on regular files - * at least linux-kernel-2.4.19-ac4/fs/block_dev.c/block_llseek() will give - * EINVAL on seek behind EOF therefore it must be accepted without complaints by us. - */ - if (errvfsresult!=GNOME_VFS_OK) - return G_IO_STATUS_ERROR; - - return G_IO_STATUS_NORMAL; -} - - -static GIOStatus captive_gnomevfs_giognomevfs_io_close(GIOChannel *channel,GError **err) -{ -struct captive_gnomevfs_giognomevfs *giognomevfs=(struct captive_gnomevfs_giognomevfs *)channel; - - g_return_val_if_fail(validate_giognomevfs(giognomevfs),G_IO_STATUS_ERROR); - - gnome_vfs_close(giognomevfs->gnomevfshandle); - - return G_IO_STATUS_NORMAL; -} - - -static GSource* captive_gnomevfs_giognomevfs_io_create_watch(GIOChannel *channel,GIOCondition condition) -{ -struct captive_gnomevfs_giognomevfs *giognomevfs=(struct captive_gnomevfs_giognomevfs *)channel; - - g_return_val_if_fail(validate_giognomevfs(giognomevfs),NULL); - - g_return_val_if_reached(NULL); /* FIXME: NOT IMPLEMENTED YET */ -} - - -static void captive_gnomevfs_giognomevfs_io_free(GIOChannel *channel) -{ -struct captive_gnomevfs_giognomevfs *giognomevfs=(struct captive_gnomevfs_giognomevfs *)channel; - - g_return_if_fail(validate_giognomevfs(giognomevfs)); - - g_free(giognomevfs); -} - - -static GIOStatus captive_gnomevfs_giognomevfs_io_set_flags(GIOChannel *channel,GIOFlags flags,GError **err) -{ -struct captive_gnomevfs_giognomevfs *giognomevfs=(struct captive_gnomevfs_giognomevfs *)channel; - - g_return_val_if_fail(validate_giognomevfs(giognomevfs),G_IO_STATUS_ERROR); - - /* no G_IO_FLAG_APPEND and no G_IO_FLAG_NONBLOCK */ - g_return_val_if_fail((flags&G_IO_FLAG_SET_MASK)==0,G_IO_STATUS_ERROR); - - return G_IO_STATUS_NORMAL; -} - - -static GIOFlags captive_gnomevfs_giognomevfs_io_get_flags(GIOChannel *channel) -{ -struct captive_gnomevfs_giognomevfs *giognomevfs=(struct captive_gnomevfs_giognomevfs *)channel; - - g_return_val_if_fail(validate_giognomevfs(giognomevfs),0); - - return 0; /* | !G_IO_FLAG_APPEND | !G_IO_FLAG_NONBLOCK */ -} - - -GnomeVFSResult captive_gnomevfs_giognomevfs_new - (struct captive_gnomevfs_giognomevfs **giognomevfsp,GnomeVFSURI *uri,enum captive_option_rwmode rwmode) -{ -GnomeVFSHandle *handle; -struct captive_gnomevfs_giognomevfs *giognomevfs; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(giognomevfsp!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(uri!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=gnome_vfs_open_uri(&handle,uri, - 0 /* open_mode */ - | GNOME_VFS_OPEN_RANDOM /* mandatory; otherwise we will get truncation if GNOME_VFS_OPEN_WRITE */ - | GNOME_VFS_OPEN_READ - | (rwmode==CAPTIVE_OPTION_RWMODE_RW ? GNOME_VFS_OPEN_WRITE : 0)); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(giochannel_funcs); - giochannel_funcs.io_read =captive_gnomevfs_giognomevfs_io_read; - giochannel_funcs.io_write =captive_gnomevfs_giognomevfs_io_write; - giochannel_funcs.io_seek =captive_gnomevfs_giognomevfs_io_seek; - giochannel_funcs.io_close =captive_gnomevfs_giognomevfs_io_close; - giochannel_funcs.io_create_watch=captive_gnomevfs_giognomevfs_io_create_watch; - giochannel_funcs.io_free =captive_gnomevfs_giognomevfs_io_free; - giochannel_funcs.io_set_flags =captive_gnomevfs_giognomevfs_io_set_flags; - giochannel_funcs.io_get_flags =captive_gnomevfs_giognomevfs_io_get_flags; - G_UNLOCK(giochannel_funcs); - - captive_new(giognomevfs); - g_assert(G_STRUCT_OFFSET(struct captive_gnomevfs_giognomevfs,iochannel)==0); /* safely re-type-able */ - g_io_channel_init(&giognomevfs->iochannel); - giognomevfs->iochannel.funcs=&giochannel_funcs; - giognomevfs->iochannel.is_seekable=TRUE; - giognomevfs->iochannel.is_readable=TRUE; - giognomevfs->iochannel.is_writeable=(rwmode!=CAPTIVE_OPTION_RWMODE_RO); - giognomevfs->iochannel.close_on_unref=TRUE; /* run g_io_channel_shutdown() flush on last unref */ - giognomevfs->gnomevfshandle=handle; - - captive_giochannel_setup(&giognomevfs->iochannel); - - *giognomevfsp=giognomevfs; - return GNOME_VFS_OK; -} diff --git a/src/client/gnomevfs/giognomevfs.h b/src/client/gnomevfs/giognomevfs.h deleted file mode 100644 index cc94096..0000000 --- a/src/client/gnomevfs/giognomevfs.h +++ /dev/null @@ -1,38 +0,0 @@ -/* $Id$ - * Include file for glib GIOChannel interface over gnome-vfs GnomeVFSURI for libcaptive - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_GNOMEVFS_GIOGNOMEVFS_H -#define _CAPTIVE_GNOMEVFS_GIOGNOMEVFS_H 1 - - -#include -#include "captive/options.h" - - -G_BEGIN_DECLS - -struct captive_gnomevfs_giognomevfs; - -GnomeVFSResult captive_gnomevfs_giognomevfs_new - (struct captive_gnomevfs_giognomevfs **giognomevfsp,GnomeVFSURI *uri,captive_option_rwmode_t rwmode); - -G_END_DECLS - - -#endif /* _CAPTIVE_GNOMEVFS_GIOGNOMEVFS_H */ diff --git a/src/client/gnomevfs/gnome-vfs-method.c b/src/client/gnomevfs/gnome-vfs-method.c deleted file mode 100644 index 447925b..0000000 --- a/src/client/gnomevfs/gnome-vfs-method.c +++ /dev/null @@ -1,785 +0,0 @@ -/* $Id$ - * gnome-vfs init/shutdown implementation of interface to libcaptive - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "gnome-vfs-method.h" /* self */ -#include "giognomevfs.h" -#include -#include -#include "captive/macros.h" -#include "gnome-vfs-module.h" -#include "captive/client-directory.h" -#include "captive/client-file.h" -#include "captive/client-vfs.h" -#include - - -static GnomeVFSMethod GnomeVFSMethod_static; -G_LOCK_DEFINE_STATIC(GnomeVFSMethod_static); - - -/* map: (gchar *)method_name -> (struct method_name_info *) */ -static GHashTable *method_name_hash; -G_LOCK_DEFINE_STATIC(method_name_hash); - -struct method_name_info { - gchar *captive_args; - struct captive_options captive_options; - }; - -static void method_name_hash_key_destroy_func(gchar *key) -{ - g_return_if_fail(key!=NULL); - - g_free(key); -} - -static void method_name_hash_value_destroy_func(struct method_name_info *value) -{ - g_return_if_fail(value!=NULL); - - g_free(value->captive_args); - captive_options_free(&value->captive_options); - g_free(value); -} - -static void method_name_hash_init(void) -{ - G_LOCK(method_name_hash); - if (!method_name_hash) { - method_name_hash=g_hash_table_new_full( - g_str_hash, /* hash_func */ - g_str_equal, /* key_equal_func */ - (GDestroyNotify)method_name_hash_key_destroy_func, /* key_destroy_func */ - (GDestroyNotify)method_name_hash_value_destroy_func); /* value_destroy_func */ - } - G_UNLOCK(method_name_hash); -} - - -/* map: (gchar *)uri_parent_string "method_name:uri_parent" -> (CaptiveVfsObject *)captive_vfs_object */ -static GHashTable *uri_parent_string_hash; -G_LOCK_DEFINE_STATIC(uri_parent_string_hash); - -static void uri_parent_string_hash_key_destroy_func(gchar *key) -{ - g_return_if_fail(key!=NULL); - - g_free(key); -} - -static void uri_parent_string_hash_value_destroy_func(CaptiveVfsObject *value) -{ - g_return_if_fail(value!=NULL); - - g_object_unref(value); -} - -static void uri_parent_string_hash_init(void) -{ - G_LOCK(uri_parent_string_hash); - if (!uri_parent_string_hash) { - uri_parent_string_hash=g_hash_table_new_full( - g_str_hash, /* hash_func */ - g_str_equal, /* key_equal_func */ - (GDestroyNotify)uri_parent_string_hash_key_destroy_func, /* key_destroy_func */ - (GDestroyNotify)uri_parent_string_hash_value_destroy_func); /* value_destroy_func */ - } - G_UNLOCK(uri_parent_string_hash); -} - - -static GnomeVFSResult captive_gnomevfs_uri_parent_init(CaptiveVfsObject **captive_vfs_object_return,GnomeVFSURI *uri) -{ -const gchar *uri_parent_string; -gchar *uri_parent_string_parent; -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; - - g_return_val_if_fail(uri!=NULL,GNOME_VFS_ERROR_INVALID_URI); - g_return_val_if_fail(captive_vfs_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - uri_parent_string_hash_init(); - - if (!uri->parent) - return GNOME_VFS_ERROR_INVALID_URI; - if (!uri->text) /* not needed here but we don't permit non-specific fs-image reference */ - return GNOME_VFS_ERROR_INVALID_URI; - uri_parent_string_parent=gnome_vfs_uri_to_string(uri->parent,GNOME_VFS_URI_HIDE_NONE); - g_assert(uri_parent_string_parent!=NULL); - - uri_parent_string=captive_printf_alloca("%s:%s",uri->method_string,uri_parent_string_parent); - g_assert(uri_parent_string!=NULL); - - G_LOCK(uri_parent_string_hash); - captive_vfs_object=g_hash_table_lookup(uri_parent_string_hash,uri_parent_string); - G_UNLOCK(uri_parent_string_hash); - if (!captive_vfs_object) { -struct method_name_info *method_name_info; -struct captive_options options_captive; - - G_LOCK(method_name_hash); - method_name_info=g_hash_table_lookup(method_name_hash,uri->method_string); - G_UNLOCK(method_name_hash); - if (!method_name_info) - g_return_val_if_reached(GNOME_VFS_ERROR_INVALID_URI); /* should not happend */ - captive_options_copy(&options_captive,&method_name_info->captive_options); - - g_assert(options_captive.image_iochannel==NULL); - errvfsresult=captive_gnomevfs_giognomevfs_new( - (struct captive_gnomevfs_giognomevfs **)&options_captive.image_iochannel, /* giognomevfsp */ - uri->parent, /* uri */ - options_captive.rwmode); /* rwmode */ - if (errvfsresult!=GNOME_VFS_OK) { - captive_options_free(&options_captive); - g_assert_not_reached(); - return errvfsresult; - } - - errvfsresult=captive_vfs_new(&captive_vfs_object,&options_captive); - if (errvfsresult!=GNOME_VFS_OK) { - captive_options_free(&options_captive); - g_assert_not_reached(); - return errvfsresult; - } - captive_options_free(&options_captive); - G_LOCK(uri_parent_string_hash); - g_hash_table_insert(uri_parent_string_hash,g_strdup(uri_parent_string),captive_vfs_object); - G_UNLOCK(uri_parent_string_hash); - } - - *captive_vfs_object_return=captive_vfs_object; - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_gnomevfs_open_directory(GnomeVFSMethod *method, - GnomeVFSMethodHandle **method_handle,GnomeVFSURI *uri,GnomeVFSFileInfoOptions options,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveDirectoryObject *captive_directory_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(method_handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_directory_new_open( - &captive_directory_object, /* captive_directory_object_return */ - captive_vfs_object, /* captive_vfs_object */ - uri->text); /* pathname */ - G_UNLOCK(libcaptive); - - *method_handle=(GnomeVFSMethodHandle *)captive_directory_object; - return errvfsresult; -} - - -static GnomeVFSResult captive_gnomevfs_close_directory(GnomeVFSMethod *method, - GnomeVFSMethodHandle *method_handle,GnomeVFSContext *context) -{ -CaptiveDirectoryObject *captive_directory_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_directory_object=(CaptiveDirectoryObject *)method_handle; - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - G_LOCK(libcaptive); - g_object_unref(captive_directory_object); - G_UNLOCK(libcaptive); - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_gnomevfs_read_directory(GnomeVFSMethod *method, - GnomeVFSMethodHandle *method_handle,GnomeVFSFileInfo *file_info,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveDirectoryObject *captive_directory_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_directory_object=(CaptiveDirectoryObject *)method_handle; - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - G_LOCK(libcaptive); - errvfsresult=captive_directory_read(captive_directory_object,file_info); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -static GnomeVFSResult captive_gnomevfs_make_directory(GnomeVFSMethod *method, - GnomeVFSURI *uri,guint perm,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveDirectoryObject *captive_directory_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_directory_new_make( - &captive_directory_object, /* captive_directory_object_return */ - captive_vfs_object, /* captive_vfs_object */ - uri->text, /* pathname */ - perm); /* perm */ - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - - G_LOCK(libcaptive); - g_object_unref(captive_directory_object); - G_UNLOCK(libcaptive); - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_gnomevfs_remove_directory(GnomeVFSMethod *method, - GnomeVFSURI *uri,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveDirectoryObject *captive_directory_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_directory_new_open( - &captive_directory_object, /* captive_directory_object_return */ - captive_vfs_object, /* captive_vfs_object */ - uri->text); /* pathname */ - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - - G_LOCK(libcaptive); - errvfsresult=captive_directory_remove(captive_directory_object); - G_UNLOCK(libcaptive); - - G_LOCK(libcaptive); - g_object_unref(captive_directory_object); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -static GnomeVFSResult captive_gnomevfs_open(GnomeVFSMethod *method, - GnomeVFSMethodHandle **method_handle_return,GnomeVFSURI *uri,GnomeVFSOpenMode mode,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(method_handle_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - captive_vfs_object, /* captive_vfs_object */ - uri->text, /* pathname */ - mode); /* mode */ - G_UNLOCK(libcaptive); - - *method_handle_return=(GnomeVFSMethodHandle *)captive_file_object; - return errvfsresult; -} - - -static GnomeVFSResult captive_gnomevfs_create(GnomeVFSMethod *method, - GnomeVFSMethodHandle **method_handle_return,GnomeVFSURI *uri,GnomeVFSOpenMode mode,gboolean exclusive,guint perm, - GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(method_handle_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_file_new_create( - &captive_file_object, /* captive_file_object_return */ - captive_vfs_object, /* captive_vfs_object */ - uri->text, /* pathname */ - mode, /* mode */ - exclusive, /* exclusive */ - perm); /* perm */ - G_UNLOCK(libcaptive); - - *method_handle_return=(GnomeVFSMethodHandle *)captive_file_object; - return errvfsresult; -} - - -GnomeVFSResult captive_gnomevfs_unlink(GnomeVFSMethod *method, - GnomeVFSURI *uri,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - captive_vfs_object, /* captive_vfs_object */ - uri->text, /* pathname */ - (GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_WRITE | GNOME_VFS_OPEN_RANDOM)); /* mode; is it OK? */ - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - - G_LOCK(libcaptive); - errvfsresult=captive_file_remove(captive_file_object); - G_UNLOCK(libcaptive); - - G_LOCK(libcaptive); - g_object_unref(captive_file_object); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -static GnomeVFSResult captive_gnomevfs_close(GnomeVFSMethod *method, - GnomeVFSMethodHandle *method_handle,GnomeVFSContext *context) -{ -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_file_object=(CaptiveFileObject *)method_handle; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - G_LOCK(libcaptive); - g_object_unref(captive_file_object); - G_UNLOCK(libcaptive); - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_gnomevfs_read(GnomeVFSMethod *method,GnomeVFSMethodHandle *method_handle, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_file_object=(CaptiveFileObject *)method_handle; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_read_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - G_LOCK(libcaptive); - errvfsresult=captive_file_read(captive_file_object,buffer,num_bytes,bytes_read_return); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -static GnomeVFSResult captive_gnomevfs_write(GnomeVFSMethod *method,GnomeVFSMethodHandle *method_handle, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_file_object=(CaptiveFileObject *)method_handle; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_written_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - G_LOCK(libcaptive); - errvfsresult=captive_file_write(captive_file_object,buffer,num_bytes,bytes_written_return); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -static GnomeVFSResult captive_gnomevfs_seek(GnomeVFSMethod *method, - GnomeVFSMethodHandle *method_handle,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_file_object=(CaptiveFileObject *)method_handle; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - G_LOCK(libcaptive); - errvfsresult=captive_file_seek(captive_file_object,whence,offset); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - -static GnomeVFSResult captive_gnomevfs_tell(GnomeVFSMethod *method, - GnomeVFSMethodHandle *method_handle,GnomeVFSFileOffset *offset_return) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_file_object=(CaptiveFileObject *)method_handle; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(offset_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - G_LOCK(libcaptive); - errvfsresult=captive_file_tell(captive_file_object,offset_return); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -static gboolean captive_gnomevfs_is_local(GnomeVFSMethod *method,const GnomeVFSURI *uri) -{ - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(uri!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return gnome_vfs_uri_is_local(uri->parent); -} - - -static GnomeVFSResult captive_gnomevfs_get_file_info(GnomeVFSMethod *method, - GnomeVFSURI *uri,GnomeVFSFileInfo *file_info,GnomeVFSFileInfoOptions options,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - /* handle 'options & GNOME_VFS_FILE_INFO_GET_MIME_TYPE'? */ - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - captive_vfs_object, /* captive_vfs_object */ - uri->text, /* pathname */ - 0); /* mode; 0 means FILE_READ_ATTRIBUTES */ - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - - G_LOCK(libcaptive); - errvfsresult=captive_file_file_info_get(captive_file_object,file_info); - G_UNLOCK(libcaptive); - - G_LOCK(libcaptive); - g_object_unref(captive_file_object); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -GnomeVFSResult captive_gnomevfs_get_file_info_from_handle(GnomeVFSMethod *method, - GnomeVFSMethodHandle *method_handle,GnomeVFSFileInfo *file_info,GnomeVFSFileInfoOptions options,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_file_object=(CaptiveFileObject *)method_handle; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - /* handle 'options & GNOME_VFS_FILE_INFO_GET_MIME_TYPE'? */ - - G_LOCK(libcaptive); - errvfsresult=captive_file_file_info_get(captive_file_object,file_info); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -GnomeVFSResult captive_gnomevfs_truncate_handle(GnomeVFSMethod *method, - GnomeVFSMethodHandle *handle,GnomeVFSFileSize length,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - captive_file_object=(CaptiveFileObject *)handle; - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - G_LOCK(libcaptive); - errvfsresult=captive_file_truncate(captive_file_object,length); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - -GnomeVFSResult captive_gnomevfs_truncate(GnomeVFSMethod *method, - GnomeVFSURI *uri,GnomeVFSFileSize length,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - captive_vfs_object, /* captive_vfs_object */ - uri->text, /* pathname */ - (GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_WRITE | GNOME_VFS_OPEN_RANDOM)); /* mode; is it OK? */ - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - - G_LOCK(libcaptive); - errvfsresult=captive_file_truncate(captive_file_object,length); - G_UNLOCK(libcaptive); - - G_LOCK(libcaptive); - g_object_unref(captive_file_object); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -GnomeVFSResult captive_gnomevfs_move(GnomeVFSMethod *method, - GnomeVFSURI *old_uri,GnomeVFSURI *new_uri,gboolean force_replace,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_old_vfs_object; -CaptiveVfsObject *captive_new_vfs_object; -CaptiveFileObject *captive_old_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_old_vfs_object,old_uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_new_vfs_object,new_uri); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - if (captive_old_vfs_object!=captive_new_vfs_object) - return GNOME_VFS_ERROR_NOT_SAME_FILE_SYSTEM; - - G_LOCK(libcaptive); - errvfsresult=captive_file_new_open( - &captive_old_file_object, /* captive_file_object_return */ - captive_old_vfs_object, /* captive_vfs_object; ==captive_new_vfs_object */ - old_uri->text, /* pathname */ - (GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_WRITE)); /* mode; is it OK? */ - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - - G_LOCK(libcaptive); - errvfsresult=captive_file_move(captive_old_file_object,new_uri->text,force_replace); - G_UNLOCK(libcaptive); - - G_LOCK(libcaptive); - g_object_unref(captive_old_file_object); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -GnomeVFSResult captive_gnomevfs_check_same_fs(GnomeVFSMethod *method, - GnomeVFSURI *a,GnomeVFSURI *b,gboolean *same_fs_return,GnomeVFSContext *context) -{ -CaptiveVfsObject *captive_vfs_object_a; -CaptiveVfsObject *captive_vfs_object_b; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(same_fs_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object_a,a); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object_b,b); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - *same_fs_return=(captive_vfs_object_a==captive_vfs_object_b); - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_gnomevfs_set_file_info(GnomeVFSMethod *method, - GnomeVFSURI *a,const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask,GnomeVFSContext *context) -{ -GnomeVFSResult errvfsresult; -CaptiveVfsObject *captive_vfs_object; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(method==&GnomeVFSMethod_static,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_gnomevfs_uri_parent_init(&captive_vfs_object,a); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - G_LOCK(libcaptive); - errvfsresult=captive_file_new_open( - &captive_file_object, /* captive_file_object_return */ - captive_vfs_object, /* captive_vfs_object */ - a->text, /* pathname */ - (GNOME_VFS_OPEN_WRITE | GNOME_VFS_OPEN_RANDOM)); /* mode; is it OK? */ - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - - G_LOCK(libcaptive); - errvfsresult=captive_file_file_info_set(captive_file_object,info,mask); - G_UNLOCK(libcaptive); - - G_LOCK(libcaptive); - g_object_unref(captive_file_object); - G_UNLOCK(libcaptive); - - return errvfsresult; -} - - -/** - * captive_gnomevfs_init: - * - * Returns: Initialized structure of #GnomeVFSMethod with static methods of libcaptive-gnomevfs. - */ -GnomeVFSMethod *captive_gnomevfs_method_init(const gchar *method_name,const gchar *captive_args) -{ -struct method_name_info *method_name_info; - - g_return_val_if_fail(method_name!=NULL,NULL); - g_return_val_if_fail(captive_args!=NULL,NULL); - - method_name_hash_init(); - - G_LOCK(method_name_hash); - method_name_info=g_hash_table_lookup(method_name_hash,method_name); - if (method_name_info && strcmp(method_name_info->captive_args,captive_args)) - method_name_info=NULL; - G_UNLOCK(method_name_hash); - if (!method_name_info) { - captive_new(method_name_info); - method_name_info->captive_args=g_strdup(captive_args); - captive_options_init(&method_name_info->captive_options); - if (!captive_options_parse(&method_name_info->captive_options,captive_args)) { - g_assert_not_reached(); - g_free(method_name_info->captive_args); - g_free(method_name_info); - return NULL; - } - G_LOCK(method_name_hash); - g_hash_table_replace(method_name_hash,g_strdup(method_name),method_name_info); - G_UNLOCK(method_name_hash); - } - - G_LOCK(GnomeVFSMethod_static); - CAPTIVE_MEMZERO(&GnomeVFSMethod_static); - GnomeVFSMethod_static.method_table_size=sizeof(GnomeVFSMethod_static); - GnomeVFSMethod_static.open =captive_gnomevfs_open; /* mandatory */ - GnomeVFSMethod_static.create =captive_gnomevfs_create; /* mandatory */ - GnomeVFSMethod_static.close =captive_gnomevfs_close; - GnomeVFSMethod_static.read =captive_gnomevfs_read; - GnomeVFSMethod_static.write =captive_gnomevfs_write; - GnomeVFSMethod_static.seek =captive_gnomevfs_seek; - GnomeVFSMethod_static.tell =captive_gnomevfs_tell; - GnomeVFSMethod_static.truncate_handle =captive_gnomevfs_truncate_handle; - GnomeVFSMethod_static.open_directory =captive_gnomevfs_open_directory; - GnomeVFSMethod_static.close_directory =captive_gnomevfs_close_directory; - GnomeVFSMethod_static.read_directory =captive_gnomevfs_read_directory; - GnomeVFSMethod_static.get_file_info =captive_gnomevfs_get_file_info; /* mandatory */ - GnomeVFSMethod_static.get_file_info_from_handle=captive_gnomevfs_get_file_info_from_handle; - GnomeVFSMethod_static.is_local =captive_gnomevfs_is_local; /* mandatory */ - GnomeVFSMethod_static.make_directory =captive_gnomevfs_make_directory; - GnomeVFSMethod_static.remove_directory =captive_gnomevfs_remove_directory; - GnomeVFSMethod_static.move =captive_gnomevfs_move; - GnomeVFSMethod_static.unlink =captive_gnomevfs_unlink; - GnomeVFSMethod_static.check_same_fs =captive_gnomevfs_check_same_fs; - GnomeVFSMethod_static.set_file_info =captive_gnomevfs_set_file_info; - GnomeVFSMethod_static.truncate =captive_gnomevfs_truncate; - /* TODO: GnomeVFSMethodFindDirectoryFunc find_directory; */ - /* TODO: GnomeVFSMethodCreateSymbolicLinkFunc create_symbolic_link; */ - /* TODO: GnomeVFSMethodMonitorAddFunc monitor_add; */ - /* TODO: GnomeVFSMethodMonitorCancelFunc monitor_cancel; */ - /* TODO: GnomeVFSMethodFileControlFunc file_control; */ - G_UNLOCK(GnomeVFSMethod_static); - - return &GnomeVFSMethod_static; -} - - -/** - * captive_gnomevfs_method_shutdown: - * - * Shutdowns libcaptive-gnomevfs successfuly flushing all caches. - * - * This operation may not completely clean up the process space - * if libcaptive #sandbox is not in use. - * - * Sad note about gnome-vfs-2.1.5 is that it never calls this function. :-) - */ -void captive_gnomevfs_method_shutdown(void) -{ - uri_parent_string_hash_init(); - G_LOCK(uri_parent_string_hash); - g_hash_table_destroy(uri_parent_string_hash); - uri_parent_string_hash=NULL; - G_UNLOCK(uri_parent_string_hash); - - method_name_hash_init(); - G_LOCK(method_name_hash); - g_hash_table_destroy(method_name_hash); - method_name_hash=NULL; - G_UNLOCK(method_name_hash); -} diff --git a/src/client/gnomevfs/gnome-vfs-method.h b/src/client/gnomevfs/gnome-vfs-method.h deleted file mode 100644 index 4bc38ce..0000000 --- a/src/client/gnomevfs/gnome-vfs-method.h +++ /dev/null @@ -1,35 +0,0 @@ -/* $Id$ - * gnome-vfs init/shutdown implementation of interface to libcaptive - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_GNOMEVFS_GNOME_VFS_METHOD_H -#define _CAPTIVE_GNOMEVFS_GNOME_VFS_METHOD_H 1 - - -#include - - -G_BEGIN_DECLS - -GnomeVFSMethod *captive_gnomevfs_method_init(const gchar *method_name,const gchar *captive_args); -void captive_gnomevfs_method_shutdown(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_GNOMEVFS_GNOME_VFS_METHOD_H */ diff --git a/src/client/gnomevfs/gnome-vfs-module.c b/src/client/gnomevfs/gnome-vfs-module.c deleted file mode 100644 index 1b2dbba..0000000 --- a/src/client/gnomevfs/gnome-vfs-module.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id$ - * gnome-vfs init/shutdown implementation of interface to libcaptive - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "gnome-vfs-method.h" -#include -#include -#include /* for g_atexit() */ - -#include - - -/* filesystem-module-scope lock for _any_ libcaptive access */ -G_LOCK_DEFINE(libcaptive); - - -static void vfs_module_shutdown_atexit(void); - - -/** - * vfs_module_init: - * @method_name: FIXME - * @args: FIXME - * - * FIXME - * - * Returns: FIXME - */ -GnomeVFSMethod *vfs_module_init(const char *method_name,const char *args) -{ -GnomeVFSMethod *captive_gnomevfs_method_ptr; - - g_return_val_if_fail(method_name!=NULL,NULL); - g_return_val_if_fail(args!=NULL,NULL); /* 'args' may be null if not supplied */ - - captive_standalone_init(); - - captive_gnomevfs_method_ptr=captive_gnomevfs_method_init( - method_name, /* method_name */ - args); /* captive_args */ - - g_atexit(vfs_module_shutdown_atexit); - - return captive_gnomevfs_method_ptr; -} - - -/** - * vfs_module_shutdown: - */ -void vfs_module_shutdown(GnomeVFSMethod *method) -{ - /* 'method' may be NULL iff we are called from vfs_module_shutdown_atexit() */ - - captive_gnomevfs_method_shutdown(); -} - - -static void vfs_module_shutdown_atexit(void) -{ - vfs_module_shutdown(NULL); -} diff --git a/src/client/gnomevfs/gnome-vfs-module.h b/src/client/gnomevfs/gnome-vfs-module.h deleted file mode 100644 index 6da1a5b..0000000 --- a/src/client/gnomevfs/gnome-vfs-module.h +++ /dev/null @@ -1,31 +0,0 @@ -/* $Id$ - * gnome-vfs init/shutdown implementation of interface to libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_GNOMEVFS_GNOME_VFS_MODULE_H -#define _CAPTIVE_GNOMEVFS_GNOME_VFS_MODULE_H 1 - - -G_BEGIN_DECLS - -G_LOCK_EXTERN(libcaptive); - -G_END_DECLS - - -#endif /* _CAPTIVE_GNOMEVFS_GNOME_VFS_MODULE_H */ diff --git a/src/client/lufs/Makefile.am b/src/client/lufs/Makefile.am deleted file mode 100644 index dce58b8..0000000 --- a/src/client/lufs/Makefile.am +++ /dev/null @@ -1,91 +0,0 @@ -# $Id$ -# automake source for the liblufs-captive module for lufs Makefile -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -liblufs_captivefs_la_CFLAGS= $(GNOME_VFS_CFLAGS) $(LIBXML_CFLAGS) -liblufs_captivefs_la_LIBADD=$(captive_library) $(GNOME_VFS_LIBS) -liblufs_captivefs_la_LDFLAGS=-release $(VERSION) -liblufs_captivefs_la_SOURCES= \ - captivefs-attr.c \ - captivefs-attr.h \ - captivefs-directory.c \ - captivefs-file.c \ - captivefs-misc.c \ - captivefs-misc.h \ - captivefs-vfs.c \ - captivefs-vfs.h - -if ENABLE_LUFS -liblufs_captivefs_la_cond=liblufs-captivefs.la -endif -lib_LTLIBRARIES+=$(liblufs_captivefs_la_cond) - -if ENABLE_LUFS -if ENABLE_SBIN_MOUNT -sbin_mount_captive_cond=mount.captive - -install-exec-hook: - $(mkinstalldirs) $(DESTDIR)$(enable_sbin_mountdir) - IFS=:; \ - enable_sbin_mount_fs="$(enable_sbin_mount_fs)"; \ - for fs in $$enable_sbin_mount_fs; do \ - if test $$fs != no; then \ - $(RM) $(DESTDIR)$(enable_sbin_mountdir)/mount.captive-$$fs; \ - $(LN_S) mount.captive $(DESTDIR)$(enable_sbin_mountdir)/mount.captive-$$fs; \ - fi; \ - done - if test `id -u` -eq 0 -a -z "$(DESTDIR)";then \ - if test x$(libdir) != x/lib -a x$(libdir) != x/usr/lib && ! grep -q '^$(libdir)$$' /etc/ld.so.conf;then \ - echo -n "WARNING: Add '$(libdir)' to your '/etc/ld.so.conf' and run ldconfig(8)! Press ENTER...";read; \ - fi; \ - ldconfig || echo -n "WARNING: Failed to run ldconfig(8) - run manually! Press ENTER...";read; \ - fi - -else -install-exec-hook: - if test `id -u` -eq 0 -a -z "$(DESTDIR)";then \ - if test x$(libdir) != x/lib -a x$(libdir) != x/usr/lib && ! grep -q '^$(libdir)$$' /etc/ld.so.conf;then \ - echo -n "WARNING: Add '$(libdir)' to your '/etc/ld.so.conf' and run ldconfig(8)! Press ENTER...";read; \ - fi; \ - ldconfig || echo -n "WARNING: Failed to run ldconfig(8) - run manually! Press ENTER...";read; \ - fi - - -endif -else -install-exec-hook: - @true - -endif -enable_sbin_mountPROGRAMS=$(sbin_mount_captive_cond) - -EXTRA_DIST+=lufs-captivefs.pod.pl.in -CLEANFILES+=lufs-captivefs.pod lufs-captivefs.1 -EXTRA_DIST+=mount.captive.pod.pl.in -CLEANFILES+=mount.captive.pod mount.captive.1 -if ENABLE_MAN_PAGES -if ENABLE_LUFS -lufs_captivefs_man_cond=lufs-captivefs.7 -if ENABLE_SBIN_MOUNT -mount_captive_man_cond=mount.captive.8 -endif -endif -endif -man_MANS=$(lufs_captivefs_man_cond) $(mount_captive_man_cond) diff --git a/src/client/lufs/captivefs-attr.c b/src/client/lufs/captivefs-attr.c deleted file mode 100644 index a1142f1..0000000 --- a/src/client/lufs/captivefs-attr.c +++ /dev/null @@ -1,130 +0,0 @@ -/* $Id$ - * lufs interface module misc functions for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captivefs-attr.h" /* self */ -#include -#include -#include "captivefs-vfs.h" - - -gboolean captivefs_GnomeVFSFileInfo_to_lufs_fattr - (struct captivefs_vfs *captivefs_vfs,struct lufs_fattr *fattr,const GnomeVFSFileInfo *file_info) -{ - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),FALSE); - g_return_val_if_fail(fattr!=NULL,FALSE); - g_return_val_if_fail(file_info!=NULL,FALSE); - - fattr->f_mode=0; - - if (file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_TYPE) - switch (file_info->type) { - case GNOME_VFS_FILE_TYPE_REGULAR: - fattr->f_mode|=S_IFREG; - /* 'fmode' kernel LUFS option only |= to our reported 'f_mode': */ - if (!captivefs_vfs->private) - fattr->f_mode|=0444; - break; - case GNOME_VFS_FILE_TYPE_DIRECTORY: - fattr->f_mode|=S_IFDIR; - /* 'dmode' kernel LUFS option only |= to our reported 'f_mode': */ - if (!captivefs_vfs->private) - fattr->f_mode|=0555; - break; - default: - g_warning("Unknown GnomeVFSFileInfo.type=%d of: %s",(int)file_info->type,file_info->name); - return FALSE; - } - if (file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) - fattr->f_mode|=file_info->permissions & 0777; - else - fattr->f_mode|=0600; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT)) - fattr->f_nlink=1; - else - fattr->f_nlink=file_info->link_count; - - fattr->f_uid=1; /* we own the file */ - fattr->f_gid=1; /* we own the file */ - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_SIZE)) - fattr->f_size=0; - else - fattr->f_size=file_info->size; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_ATIME)) - fattr->f_atime=time(NULL); - else - fattr->f_atime=file_info->atime; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_MTIME)) - fattr->f_mtime=time(NULL); - else - fattr->f_mtime=file_info->mtime; - - if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_CTIME)) - fattr->f_ctime=time(NULL); - else - fattr->f_ctime=file_info->ctime; - - return TRUE; -} - - -gboolean captivefs_lufs_fattr_to_GnomeVFSFileInfo(GnomeVFSFileInfo *file_info,const struct lufs_fattr *fattr) -{ - g_return_val_if_fail(file_info!=NULL,FALSE); - g_return_val_if_fail(fattr!=NULL,FALSE); - - file_info->valid_fields=0; - - switch (fattr->f_mode&S_IFMT) { - case S_IFREG: file_info->type=GNOME_VFS_FILE_TYPE_REGULAR; break; - case S_IFDIR: file_info->type=GNOME_VFS_FILE_TYPE_DIRECTORY; break; - default: - g_warning("lufs_fattr_to_GnomeVFSFileInfo: f_mode&S_IFMT=0x%lX",(long)(fattr->f_mode&S_IFMT)); - return FALSE; - } - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_TYPE; - - file_info->permissions=fattr->f_mode & 0777; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS; - - file_info->link_count=fattr->f_nlink; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT; - - /* ignore: fattr->f_uid; we own the file */ - /* ignore: fattr->f_gid; we own the file */ - - file_info->size=fattr->f_size; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_SIZE; - - if ((file_info->atime=fattr->f_atime)) - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_ATIME; - - if ((file_info->mtime=fattr->f_mtime)) - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_MTIME; - - if ((file_info->ctime=fattr->f_ctime)) - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_CTIME; - - return TRUE; -} diff --git a/src/client/lufs/captivefs-attr.h b/src/client/lufs/captivefs-attr.h deleted file mode 100644 index c6f6e4e..0000000 --- a/src/client/lufs/captivefs-attr.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id$ - * Include file for lufs interface module attribute functions for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_LUFS_CAPTIVEFS_ATTR_H -#define _CAPTIVE_LUFS_CAPTIVEFS_ATTR_H 1 - - -#include -#include -#include "captivefs-vfs.h" - -#include - - -G_BEGIN_DECLS - -gboolean captivefs_GnomeVFSFileInfo_to_lufs_fattr - (struct captivefs_vfs *captivefs_vfs,struct lufs_fattr *fattr,const GnomeVFSFileInfo *file_info); -gboolean captivefs_lufs_fattr_to_GnomeVFSFileInfo(GnomeVFSFileInfo *file_info,const struct lufs_fattr *fattr); - -G_END_DECLS - - -#endif /* _CAPTIVE_LUFS_CAPTIVEFS_ATTR_H */ diff --git a/src/client/lufs/captivefs-directory.c b/src/client/lufs/captivefs-directory.c deleted file mode 100644 index c0d30a8..0000000 --- a/src/client/lufs/captivefs-directory.c +++ /dev/null @@ -1,189 +0,0 @@ -/* $Id$ - * lufs interface module directory objects implementation for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include "captivefs-misc.h" -#include "captivefs-attr.h" -#include "captivefs-vfs.h" - -#include -#include - -#include -#include - - -/* Read a directory's content - * For each directory entry, call - * lu_cache_add2dir(struct directory *dir, char *name, char *link, struct lufs_fattr *fattr) - * to add its information. - * The link is optional(NULL) and applicable only if the entry is a - * (sym)link and we have the target info at hand. - * - * Notes: - * dir_name is an absolute path. However, it is generally a good idea - * to either change to that directory here or at least keep track of what - * directory was being called on, for function calls that might not get - * absolute paths. - * If your filesystem doesn't natively support '.' or '..', don't forget - * to add them to the cache first-thing here. - */ -int captivefs_readdir(struct captivefs_vfs *captivefs_vfs,const char *dir_name,struct directory *ddir) -{ -struct lufs_fattr fattr; -GnomeVFSResult errvfsresult; -CaptiveDirectoryObject *captive_directory_object; -GnomeVFSFileInfo file_info; -const char *dots[]={".","..",NULL},**csp; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(dir_name!=NULL,-1); - g_return_val_if_fail(ddir!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_readdir: dir_name=%s",dir_name); - - dir_name=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(dir_name); - - G_LOCK(libcaptive); - errvfsresult=captive_directory_new_open(&captive_directory_object,captivefs_vfs->captive_vfs_object,dir_name); - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - goto fail; - - file_info.valid_fields=GNOME_VFS_FILE_INFO_FIELDS_TYPE; - file_info.type=GNOME_VFS_FILE_TYPE_DIRECTORY; - if (!captivefs_GnomeVFSFileInfo_to_lufs_fattr(captivefs_vfs,&fattr,&file_info)) - goto fail_unref; - for (csp=dots;*csp;csp++) - if (0>lu_cache_add2dir(ddir,(/* de-const */ char *)*csp,NULL,&fattr)) { - g_warning("Failed lu_cache_add2dir() for: %s",*csp); - goto fail_unref; - } - - for (;;) { -char *file_info_name_filename; -int errint; - - G_LOCK(libcaptive); - errvfsresult=captive_directory_read(captive_directory_object,&file_info); - G_UNLOCK(libcaptive); - if (errvfsresult==GNOME_VFS_ERROR_EOF) { - /* 'captive_directory_object' is now stuck at EOF - GnomeVFS behaves that way. */ - break; - } - if (errvfsresult!=GNOME_VFS_OK) - goto fail_unref; - - if (!captivefs_GnomeVFSFileInfo_to_lufs_fattr(captivefs_vfs,&fattr,&file_info)) - goto fail_unref; - - file_info_name_filename=captivefs_filename_from_utf8_malloc_errorchecking(file_info.name); - errint=lu_cache_add2dir(ddir, - (file_info_name_filename ? file_info_name_filename : file_info.name), - NULL,&fattr); - g_free(file_info_name_filename); /* may be NULL */ - if (0>errint) { - g_warning("Failed lu_cache_add2dir() for: %s",file_info.name); - goto fail_unref; - } - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_readdir: got: %s",file_info.name); - } - - G_LOCK(libcaptive); - g_object_unref(captive_directory_object); - G_UNLOCK(libcaptive); - - return 0; - -fail_unref: - G_LOCK(libcaptive); - g_object_unref(captive_directory_object); - G_UNLOCK(libcaptive); -fail: - return -1; -} - - -/* Create a directory - */ -int captivefs_mkdir(struct captivefs_vfs *captivefs_vfs,const char *dir,int mode) -{ -CaptiveDirectoryObject *captive_directory_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(dir!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_mkdir: dir=%s,mode=0x%X",dir,mode); - - dir=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(dir); - - G_LOCK(libcaptive); - errvfsresult=captive_directory_new_make(&captive_directory_object,captivefs_vfs->captive_vfs_object,dir,mode); - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - G_LOCK(libcaptive); - g_object_unref(captive_directory_object); - G_UNLOCK(libcaptive); - - return 0; -} - - -/* Delete a directory - */ -int captivefs_rmdir(struct captivefs_vfs *captivefs_vfs,const char *dir) -{ -CaptiveDirectoryObject *captive_directory_object; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(dir!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_rmdir: dir=%s",dir); - - dir=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(dir); - - G_LOCK(libcaptive); - errvfsresult=captive_directory_new_open(&captive_directory_object,captivefs_vfs->captive_vfs_object,dir); - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - G_LOCK(libcaptive); - errvfsresult=captive_directory_remove(captive_directory_object); - G_UNLOCK(libcaptive); - - G_LOCK(libcaptive); - g_object_unref(captive_directory_object); - G_UNLOCK(libcaptive); - - if (errvfsresult!=GNOME_VFS_OK) - return -1; - return 0; -} diff --git a/src/client/lufs/captivefs-file.c b/src/client/lufs/captivefs-file.c deleted file mode 100644 index 216c9bb..0000000 --- a/src/client/lufs/captivefs-file.c +++ /dev/null @@ -1,615 +0,0 @@ -/* $Id$ - * lufs interface module file objects implementation for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include "captivefs-misc.h" -#include "captivefs-attr.h" -#include "captivefs-vfs.h" -#include - -#include -#include -#include - -#include - - -/* Config: */ -#define CLIENT_LUFS_USE_COUNT "client-lufs-use_count" - - -/* map: (const gchar *utf8) -> (CaptiveFileObject *) */ -static GHashTable *FileHandle_hash; -G_LOCK_DEFINE_STATIC(FileHandle_hash); - -static void FileHandle_hash_init(void) -{ - G_LOCK(FileHandle_hash); - if (!FileHandle_hash) { - FileHandle_hash=g_hash_table_new_full(g_str_hash,g_str_equal, - (GDestroyNotify)g_free, /* key_destroy_func */ - (GDestroyNotify)NULL); /* value_destroy_func; handled by FileHandle_hash_captive_file_object_weak_notify() */ - } - G_UNLOCK(FileHandle_hash); -} - -/* Do not: GObject->ref_count - * as 'ref_count' may be increased for deleted files by ParentConnector - * until the volume gets unmounted. Therefore any deleted file would not - * be removed from our 'FileHandle_hash' and no object would be reinstantiable - * under the original deleted name. - */ -static gint FileHandle_get_use_count(CaptiveFileObject *captive_file_object) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),0); - - return GPOINTER_TO_INT(g_object_get_data(G_OBJECT(captive_file_object),CLIENT_LUFS_USE_COUNT)); -} - -static void FileHandle_set_use_count(CaptiveFileObject *captive_file_object,gint use_count) -{ - g_return_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - - g_object_set_data(G_OBJECT(captive_file_object),CLIENT_LUFS_USE_COUNT,GINT_TO_POINTER(use_count)); -} - -/* FileHandle_hash_init(); must be executed! */ -/* G_LOCK(FileHandle_hash); must be held! */ -static void FileHandle_enter - (struct captivefs_vfs *captivefs_vfs,CaptiveFileObject *captive_file_object,const gchar *name_normalized) -{ -gint use_count; - - g_return_if_fail(captivefs_vfs_validate(captivefs_vfs)); - g_return_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - g_return_if_fail(name_normalized); - - use_count=FileHandle_get_use_count(captive_file_object); - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"FileHandle_enter: name_normalized=%s, use_count++=%d", - name_normalized,(int)use_count); - g_assert(use_count>=0); - use_count++; - FileHandle_set_use_count(captive_file_object,use_count); - if (use_count>1) { - g_assert(captive_file_object==g_hash_table_lookup(FileHandle_hash,name_normalized)); - return; - } - g_assert(NULL==g_hash_table_lookup(FileHandle_hash,name_normalized)); - g_object_ref(captive_file_object); - g_hash_table_insert(FileHandle_hash,g_strdup(name_normalized),captive_file_object); -} - -/* FileHandle_hash_init(); must be executed! */ -/* G_LOCK(FileHandle_hash); must be held! */ -/* G_LOCK(libcaptive); must NOT be held! */ -static void FileHandle_leave_locked - (struct captivefs_vfs *captivefs_vfs,CaptiveFileObject *captive_file_object,const gchar *name) -{ -gboolean errbool; -gint use_count; -gchar *name_normalized; - - g_return_if_fail(captivefs_vfs_validate(captivefs_vfs)); - g_return_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - g_return_if_fail(name); - - name_normalized=captive_path_normalize(name); - use_count=FileHandle_get_use_count(captive_file_object); - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"FileHandle_leave_locked: name_normalized=%s, use_count--=%d", - name_normalized,(int)use_count); - g_assert(use_count>=1); - use_count--; - FileHandle_set_use_count(captive_file_object,use_count); - g_assert(captive_file_object==g_hash_table_lookup(FileHandle_hash,name_normalized)); - if (use_count>=1) { - g_free(name_normalized); - return; - } - errbool=g_hash_table_remove(FileHandle_hash,name_normalized); - g_assert(errbool==TRUE); - G_LOCK(libcaptive); - g_object_unref(captive_file_object); - G_UNLOCK(libcaptive); - g_assert(NULL==g_hash_table_lookup(FileHandle_hash,name_normalized)); - g_free(name_normalized); -} - -/* FileHandle_hash_init(); must be executed! */ -/* G_LOCK(FileHandle_hash); must NOT be held! */ -/* G_LOCK(libcaptive); must NOT be held! */ -static void FileHandle_leave(struct captivefs_vfs *captivefs_vfs,CaptiveFileObject *captive_file_object,const gchar *name) -{ - g_return_if_fail(captivefs_vfs_validate(captivefs_vfs)); - g_return_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - g_return_if_fail(name); - - G_LOCK(FileHandle_hash); - FileHandle_leave_locked(captivefs_vfs,captive_file_object,name); - G_UNLOCK(FileHandle_hash); -} - -/* 'name' is required to exist. */ -static CaptiveFileObject *FileHandle_lookup_enter(struct captivefs_vfs *captivefs_vfs,const char *name) -{ -CaptiveFileObject *captive_file_object; -gchar *name_normalized; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),NULL); - g_return_val_if_fail(name!=NULL,NULL); - - name_normalized=captive_path_normalize(name); - FileHandle_hash_init(); - G_LOCK(FileHandle_hash); - captive_file_object=g_hash_table_lookup(FileHandle_hash,name_normalized); - if (!captive_file_object) { - G_UNLOCK(FileHandle_hash); - g_warning("FileHandle_lookup_enter: FileHandle not found of: %s",name_normalized); - g_free(name_normalized); - return NULL; - } - g_assert(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - FileHandle_enter(captivefs_vfs,captive_file_object,name_normalized); - G_UNLOCK(FileHandle_hash); - g_free(name_normalized); - - return captive_file_object; -} - -/* 'name' will be opened if needed. */ -static CaptiveFileObject *FileHandle_lookup_open_enter(struct captivefs_vfs *captivefs_vfs,const char *name,gboolean create) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSResult errvfsresult; -gchar *name_normalized; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),NULL); - g_return_val_if_fail(name!=NULL,NULL); - - name_normalized=captive_path_normalize(name); - FileHandle_hash_init(); - G_LOCK(FileHandle_hash); - captive_file_object=g_hash_table_lookup(FileHandle_hash,name_normalized); - if (!create && captive_file_object) { - g_assert(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - FileHandle_enter(captivefs_vfs,captive_file_object,name_normalized); - G_UNLOCK(FileHandle_hash); - g_free(name_normalized); - return captive_file_object; - } - if ( create && captive_file_object) { - g_assert(CAPTIVE_FILE_IS_OBJECT(captive_file_object)); - FileHandle_enter(captivefs_vfs,captive_file_object,name_normalized); - G_UNLOCK(FileHandle_hash); - g_free(name_normalized); - return NULL; - } - - /* FIXME: Respect 'gnome_vfs_open_mode'. - * We would have to do some reopens of files already contained in 'FileHandle_hash'. - * As W32 filesystem will allow us to open file 'GNOME_VFS_OPEN_WRITE' - * even on read-only media we use the full open permissions always. - */ - if (!create) { - G_LOCK(libcaptive); - errvfsresult=captive_file_new_open(&captive_file_object,captivefs_vfs->captive_vfs_object,name_normalized, - GNOME_VFS_OPEN_READ|GNOME_VFS_OPEN_WRITE|GNOME_VFS_OPEN_RANDOM); - G_UNLOCK(libcaptive); - /* HIDDEN SYSTEM files (FIXME: or just HIDDEN or just SYSTEM?) - * refuse to be GNOME_VFS_OPEN_WRITE-opened. - */ - if (errvfsresult==GNOME_VFS_ERROR_ACCESS_DENIED) { - G_LOCK(libcaptive); - errvfsresult=captive_file_new_open(&captive_file_object,captivefs_vfs->captive_vfs_object,name_normalized, - GNOME_VFS_OPEN_READ|GNOME_VFS_OPEN_RANDOM); - G_UNLOCK(libcaptive); - } - } - else { - G_LOCK(libcaptive); - errvfsresult=captive_file_new_create(&captive_file_object,captivefs_vfs->captive_vfs_object,name_normalized, - GNOME_VFS_OPEN_READ|GNOME_VFS_OPEN_WRITE|GNOME_VFS_OPEN_RANDOM, /* mode */ - FALSE, /* exclusive */ - 0600); /* perm */ - G_UNLOCK(libcaptive); - } - if (errvfsresult!=GNOME_VFS_OK) { - G_UNLOCK(FileHandle_hash); - g_free(name_normalized); - return NULL; - } - FileHandle_enter(captivefs_vfs,captive_file_object,name_normalized); - G_UNLOCK(FileHandle_hash); - g_object_unref(captive_file_object); /* for captive_file_new_open() / captive_file_new_create() */ - g_free(name_normalized); - - return captive_file_object; -} - -/* Read a file/dir's attributes - * Fill all relevant data into the fattr structure. - * The uid/gid fields are just ownership hints hints: - * != 0 => we own the file - * == 0 => we don't own it - * The credentials structure (if applicable and saved from _init) - * can help determine ownership based on remote uids/gids. - * - * Notes: - * If your filesysem doesn't natively support '.' or '..', - * don't forget to special-case them here. - * It is best to assume that name is a relative path, not an - * absolute one. Thus, you need to either be keeping track of the - * last accessed directory in readdir, or, as this code does, changing - * to the current directory there. - */ -int captivefs_stat(struct captivefs_vfs *captivefs_vfs,const char *name,struct lufs_fattr *fattr) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; -GnomeVFSFileInfo file_info; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(name!=NULL,-1); - g_return_val_if_fail(fattr!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_stat: name=%s",name); - - name=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(name); - - captive_file_object=FileHandle_lookup_open_enter(captivefs_vfs,name,FALSE); - if (!captive_file_object) - return -1; - - G_LOCK(libcaptive); - errvfsresult=captive_file_file_info_get(captive_file_object,&file_info); - G_UNLOCK(libcaptive); - - FileHandle_leave(captivefs_vfs,captive_file_object,name); - - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - if (!captivefs_GnomeVFSFileInfo_to_lufs_fattr(captivefs_vfs,fattr,&file_info)) - return -1; - - return 0; -} - - -/* Create a file - */ -int captivefs_create(struct captivefs_vfs *captivefs_vfs,const char *file,int mode) -{ -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(file!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_create: file=%s,mode=0x%X",file,mode); - - file=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(file); - - captive_file_object=FileHandle_lookup_open_enter(captivefs_vfs,file,TRUE); - if (!captive_file_object) - return -1; - - FileHandle_leave(captivefs_vfs,captive_file_object,file); - - return 0; -} - - -/* Delete a file - */ -int captivefs_unlink(struct captivefs_vfs *captivefs_vfs,const char *file) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(file!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_unlink: file=%s",file); - - file=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(file); - - captive_file_object=FileHandle_lookup_open_enter(captivefs_vfs,file,FALSE); - if (!captive_file_object) - return -1; - - G_LOCK(libcaptive); - errvfsresult=captive_file_remove(captive_file_object); - G_UNLOCK(libcaptive); - - FileHandle_leave(captivefs_vfs,captive_file_object,file); - - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - return 0; -} - - -/* Rename a file/dir - */ -int captivefs_rename(struct captivefs_vfs *captivefs_vfs,const char *old_name,const char *new_name) -{ -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; -gint use_count; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(old_name!=NULL,-1); - g_return_val_if_fail(new_name!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_rename: old_name=%s,new_name=%s",old_name,new_name); - - old_name=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(old_name); - new_name=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(new_name); - - captive_file_object=FileHandle_lookup_open_enter(captivefs_vfs,old_name,FALSE); - if (!captive_file_object) - return -1; - - G_LOCK(FileHandle_hash); - use_count=FileHandle_get_use_count(captive_file_object); - g_assert(use_count>=1); - if (use_count!=1) { - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_rename: old_name=%s,new_name=%s: BUSY use_count=%d", - old_name,new_name,(int)use_count); - G_UNLOCK(FileHandle_hash); - FileHandle_leave(captivefs_vfs,captive_file_object,old_name); - return -1; - } - - G_LOCK(libcaptive); - errvfsresult=captive_file_move(captive_file_object,new_name, - FALSE); /* force_replace */ - G_UNLOCK(libcaptive); - - FileHandle_leave_locked(captivefs_vfs,captive_file_object,old_name); - G_UNLOCK(FileHandle_hash); - - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - return 0; -} - - -/* Open a file - * - * Notes: - * By default, LUFS has no concept of file handles. To implement file - * handles, take a look at the atbl class in sshfs - it is easy to cut&paste - * for use, and can be easily adapted for whatever purpose you need handles - * for. - * - * Unlike the POSIX open command which has both a "mode" variable and - * a "flags" variable, this only has a "mode" variable. To convert to the - * POSIX version, ->flags=mode^O_ACCMODE and ->mode=mode&O_ACCMODE. - */ -int captivefs_open(struct captivefs_vfs *captivefs_vfs,const char *file,unsigned mode) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSOpenMode gnome_vfs_open_mode; - - /* We may be called from the parent. */ - g_return_val_if_fail(captivefs_vfs!=NULL,FALSE); - g_return_val_if_fail(file!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_open: file=%s,mode=0x%X",file,mode); - - file=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(file); - - if (!captivefs_vfs_validate(captivefs_vfs)) - return -1; - - if (mode & ~(O_RDONLY|O_WRONLY|O_RDWR)) { - g_warning("captivefs_open: Unrecognized 'mode' 0x%X",mode); - return -1; - } - switch (mode & (O_RDONLY|O_WRONLY|O_RDWR)) { - case O_RDONLY: gnome_vfs_open_mode=GNOME_VFS_OPEN_READ; break; - case O_WRONLY: gnome_vfs_open_mode=GNOME_VFS_OPEN_WRITE; break; - case O_RDWR: gnome_vfs_open_mode=GNOME_VFS_OPEN_READ|GNOME_VFS_OPEN_WRITE; break; - default: - g_warning("captivefs_open: Unrecognized 'mode' 0x%X",mode); - return -1; - } - - captive_file_object=FileHandle_lookup_open_enter(captivefs_vfs,file,FALSE); - if (!captive_file_object) - return -1; - - /* Leave 'captive_file_object' entered. */ - return 0; -} - - -int captivefs_release(struct captivefs_vfs *captivefs_vfs,const char *file) -{ -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(file!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_release: file=%s",file); - - file=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(file); - - if (!(captive_file_object=FileHandle_lookup_enter(captivefs_vfs,file))) - return -1; - - FileHandle_leave(captivefs_vfs,captive_file_object,file); /* for FileHandle_lookup_enter() */ - FileHandle_leave(captivefs_vfs,captive_file_object,file); - - return 0; -} - - -/* Read from a file. Changed to use the (2) routines not for efficiency, - * but to make it work with 64-bit offsets :-(. - */ -int captivefs_read(struct captivefs_vfs *captivefs_vfs,const char *file,long long offset,unsigned long count,void *buf) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSFileSize bytes_read; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(file!=NULL,-1); - g_return_val_if_fail(buf!=NULL || count==0,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_read: file=%s,offset=%" G_GINT64_FORMAT ",count=0x%lX", - file,(gint64)offset,count); - - file=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(file); - - if (!(captive_file_object=FileHandle_lookup_enter(captivefs_vfs,file))) - return -1; - - /* Do not unlock 'libcaptive' between seek() and read()! */ - G_LOCK(libcaptive); - errvfsresult=captive_file_seek(captive_file_object,GNOME_VFS_SEEK_START,offset); - if (errvfsresult!=GNOME_VFS_OK) { - G_UNLOCK(libcaptive); - FileHandle_leave(captivefs_vfs,captive_file_object,file); - return -1; - } - - errvfsresult=captive_file_read(captive_file_object,buf,count,&bytes_read); - G_UNLOCK(libcaptive); - FileHandle_leave(captivefs_vfs,captive_file_object,file); - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - if (bytes_read>INT_MAX) { - g_warning("captivefs_read: Read %" G_GUINT64_FORMAT " bytes > INT_MAX=%d; dropped data", - (guint64)bytes_read,INT_MAX); - bytes_read=INT_MAX; - } - - return bytes_read; -} - - -/* Write to a file - */ -int captivefs_write(struct captivefs_vfs *captivefs_vfs,const char *file,long long offset,unsigned long count,const void *buf) -{ -CaptiveFileObject *captive_file_object; -GnomeVFSFileSize bytes_written; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(file!=NULL,-1); - g_return_val_if_fail(buf!=NULL || count==0,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_write: file=%s,offset=%" G_GINT64_FORMAT ",count=0x%lX", - file,(gint64)offset,count); - - file=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(file); - - if (!(captive_file_object=FileHandle_lookup_enter(captivefs_vfs,file))) - return -1; - - /* Do not unlock 'libcaptive' between seek() and write()! */ - G_LOCK(libcaptive); - errvfsresult=captive_file_seek(captive_file_object,GNOME_VFS_SEEK_START,offset); - if (errvfsresult!=GNOME_VFS_OK) { - G_UNLOCK(libcaptive); - FileHandle_leave(captivefs_vfs,captive_file_object,file); - return -1; - } - - errvfsresult=captive_file_write(captive_file_object,buf,count,&bytes_written); - G_UNLOCK(libcaptive); - FileHandle_leave(captivefs_vfs,captive_file_object,file); - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - if (bytes_written>INT_MAX) { - g_warning("captivefs_written: Written %" G_GUINT64_FORMAT " bytes > INT_MAX=%d; dropped data", - (guint64)bytes_written,INT_MAX); - bytes_written=INT_MAX; - } - - return bytes_written; -} - - -/* Change a file/dir's attributes - */ -int captivefs_setattr(struct captivefs_vfs *captivefs_vfs,const char *file,const struct lufs_fattr *fattr) -{ -GnomeVFSFileInfo file_info; -GnomeVFSResult errvfsresult; -CaptiveFileObject *captive_file_object; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(file!=NULL,-1); - g_return_val_if_fail(fattr!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_setattr: file=%s",file); - - file=CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(file); - - if (!captivefs_lufs_fattr_to_GnomeVFSFileInfo(&file_info,fattr)) - return -1; - - captive_file_object=FileHandle_lookup_open_enter(captivefs_vfs,file,FALSE); - if (!captive_file_object) - return -1; - - G_LOCK(libcaptive); - errvfsresult=captive_file_file_info_set(captive_file_object,&file_info, - 0 - | 0 /* 'GNOME_VFS_SET_FILE_INFO_NAME' is never set */ - | (!(file_info.valid_fields&GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) ? 0 : GNOME_VFS_SET_FILE_INFO_PERMISSIONS) - | 0 /* 'GNOME_VFS_SET_FILE_INFO_OWNER' is never set */ - | (!(file_info.valid_fields&(0 - | GNOME_VFS_FILE_INFO_FIELDS_ATIME - | GNOME_VFS_FILE_INFO_FIELDS_MTIME - | GNOME_VFS_FILE_INFO_FIELDS_CTIME)) - ? 0 : GNOME_VFS_SET_FILE_INFO_TIME)); - G_UNLOCK(libcaptive); - G_LOCK(libcaptive); - if (errvfsresult==GNOME_VFS_OK) - errvfsresult=captive_file_truncate(captive_file_object,fattr->f_size); - G_UNLOCK(libcaptive); - FileHandle_leave(captivefs_vfs,captive_file_object,file); - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - return 0; -} diff --git a/src/client/lufs/captivefs-misc.c b/src/client/lufs/captivefs-misc.c deleted file mode 100644 index a5b1c8f..0000000 --- a/src/client/lufs/captivefs-misc.c +++ /dev/null @@ -1,126 +0,0 @@ -/* $Id$ - * lufs interface module misc functions for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captivefs-misc.h" /* self */ -#include -#include "captivefs-vfs.h" - -#include - - -/* module-scope lock for _any_ libcaptive access */ -G_LOCK_DEFINE(libcaptive); - - -/* Resolve a link (if the info was not added to the dir cache when - * reading the parent dir) - */ -int captivefs_readlink(struct captivefs_vfs *captivefs_vfs,const char *link,char *buf,int buflen) -{ - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(link!=NULL,-1); - g_return_val_if_fail(buf!=NULL,-1); - g_return_val_if_fail(buflen>0,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_readlink: link=%s,buflen=%d",link,buflen); - - return -1; /* unsupported by W32 */ -} - - -/* Create a link - */ -int captivefs_link(struct captivefs_vfs *captivefs_vfs,const char *target,const char *lnk) -{ - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(target!=NULL,-1); - g_return_val_if_fail(lnk!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_link: target=%s,lnk=%s",target,lnk); - - return -1; /* unsupported by W32 */ -} - - -/* Create a symlink - */ -int captivefs_symlink(struct captivefs_vfs *captivefs_vfs,const char *target,const char *link) -{ - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(target!=NULL,-1); - g_return_val_if_fail(link!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_symlink: target=%s,link=%s",target,link); - - return -1; /* unsupported by W32 */ -} - - -char *captivefs_filename_to_utf8_malloc_errorchecking(const char *name) -{ -GError *error; -char *r; - - g_return_val_if_fail(name!=NULL,NULL); - - error=NULL; - r=g_filename_to_utf8( - name, /* opsysstring */ - -1, /* len; '\0'-terminated */ - NULL, /* bytes_read */ - NULL, /* bytes_written */ - &error); /* error */ - if (error) { - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_WARNING, - _("captivefs %s(): name=\"%s\": %s (see locale(7) and mount(8) environment variables)"), - "g_filename_to_utf8",name,error->message); - g_clear_error(&error); - } - return r; -} - - -char *captivefs_filename_from_utf8_malloc_errorchecking(const char *name) -{ -GError *error; -char *r; - - g_return_val_if_fail(name!=NULL,NULL); - - error=NULL; - r=g_filename_from_utf8( - name, /* utf8string */ - -1, /* len; '\0'-terminated */ - NULL, /* bytes_read */ - NULL, /* bytes_written */ - &error); /* error */ - if (error) { - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_WARNING,"captivefs %s(): name=\"%s\"; g_get_charset()=\"%s\", %s: %s", - "g_filename_from_utf8",name,charset, - _("see environment variables - locale(7), mount(8) and locale(1) commands \"locale\" and \"locale -a\""), - error->message); - g_clear_error(&error); - } - return r; -} diff --git a/src/client/lufs/captivefs-misc.h b/src/client/lufs/captivefs-misc.h deleted file mode 100644 index 76691d2..0000000 --- a/src/client/lufs/captivefs-misc.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $Id$ - * Include file for lufs interface module misc functions for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_LUFS_CAPTIVEFS_MISC_H -#define _CAPTIVE_LUFS_CAPTIVEFS_MISC_H 1 - - -#include -#include - - -G_BEGIN_DECLS - -G_LOCK_EXTERN(libcaptive); - - -char *captivefs_filename_to_utf8_malloc_errorchecking(const char *name); -char *captivefs_filename_from_utf8_malloc_errorchecking(const char *name); - -#define CAPTIVEFS_FILENAME_TO_UTF8_ALLOCA(name) ({ \ - const char *_captivefs_filename_to_utf8_alloca_name=(name); \ - char *_captivefs_filename_to_utf8_alloca_r_malloc; \ - const char *_captivefs_filename_to_utf8_alloca_r; \ - \ - _captivefs_filename_to_utf8_alloca_r_malloc=captivefs_filename_to_utf8_malloc_errorchecking( \ - _captivefs_filename_to_utf8_alloca_name); \ - if (!_captivefs_filename_to_utf8_alloca_r_malloc) \ - _captivefs_filename_to_utf8_alloca_r=_captivefs_filename_to_utf8_alloca_name; \ - else { \ - _captivefs_filename_to_utf8_alloca_r=captive_strdup_alloca(_captivefs_filename_to_utf8_alloca_r_malloc); \ - g_free(_captivefs_filename_to_utf8_alloca_r_malloc); \ - } \ - _captivefs_filename_to_utf8_alloca_r; \ - }) - -G_END_DECLS - - -#endif /* _CAPTIVE_LUFS_CAPTIVEFS_MISC_H */ diff --git a/src/client/lufs/captivefs-vfs.c b/src/client/lufs/captivefs-vfs.c deleted file mode 100644 index 3f04b75..0000000 --- a/src/client/lufs/captivefs-vfs.c +++ /dev/null @@ -1,272 +0,0 @@ -/* $Id$ - * lufs interface module vfs objects implementation for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captivefs-vfs.h" /* self */ -#include -#include "captivefs-misc.h" -#include -#include - -#include -#include -#include -#include - -#include -#include - - -gboolean captivefs_vfs_validate(struct captivefs_vfs *captivefs_vfs) -{ - g_return_val_if_fail(captivefs_vfs!=NULL,FALSE); - - G_LOCK(libcaptive); - g_assert(captivefs_vfs->inits>0); - g_assert(captivefs_vfs->mounts>=0); - g_assert(captivefs_vfs->mounts<=captivefs_vfs->inits); - if (!captivefs_vfs->captive_vfs_object) { -GnomeVFSResult errvfsresult; - - if (captivefs_vfs->parent_pid==getpid()) { - G_UNLOCK(libcaptive); - return FALSE; - } - - errvfsresult=captive_vfs_new(&captivefs_vfs->captive_vfs_object,&captivefs_vfs->options); - - if (errvfsresult!=GNOME_VFS_OK) { - G_UNLOCK(libcaptive); - g_return_val_if_reached(FALSE); - } - } - if (!CAPTIVE_VFS_IS_OBJECT(captivefs_vfs->captive_vfs_object)) { - G_UNLOCK(libcaptive); - g_return_val_if_reached(FALSE); - } - G_UNLOCK(libcaptive); - - return TRUE; -} - - -/* Initialization - * Here we allocate a structure to hold all the file system local info - * (localfs_local). This structure will then be passed as a parameter to - * the other functions. - * global_ctx holds info about another structure that can be shared between all - * instances of the filesystem. If the pointer is NULL, then this is the - * first instance and the structure should be allocated. - * ! You must implement locking/usage-count/deallocation logic when using - * a global context. (locking is omited here) - * ! Most filesystems don't need a global context so you can safely ignore the - * global_ctx parameter. - */ -struct captivefs_vfs *captivefs_init - (struct list_head *cfg,struct dir_cache *cache,const struct credentials *cred,struct captivefs_vfs **global_ctx) -{ -struct captivefs_vfs *captivefs_vfs; -const gchar *cgs; -gchar *gs,*captive_options_string; - - g_return_val_if_fail(global_ctx!=NULL,NULL); - - /* Do not: g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_init"); - * as we do not yet have 'VFS_DEBUG_MESSAGES(captive_vfs_object)' set. - * Generally we make all g_log() conditional here as we do not want to mess - * with overriden GLog handlers of libcaptive itself. - */ - - G_LOCK(libcaptive); - if ((captivefs_vfs=*global_ctx)) { - g_assert(captivefs_vfs->inits>0); - /* We do not support multiple LUFS threads if they could not be cross-locked. */ - g_return_val_if_fail(g_thread_supported(),NULL); - captivefs_vfs->inits++; - G_UNLOCK(libcaptive); - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_init"); - return captivefs_vfs; - } - G_UNLOCK(libcaptive); - - captive_standalone_init(); - - if (!g_thread_supported()) - g_thread_init(NULL); /* g_thread_init() fails on second initialization */ - - captive_new(captivefs_vfs); - captivefs_vfs->captive_vfs_object=NULL; - captivefs_vfs->private=FALSE; - captivefs_vfs->parent_pid=getpid(); - captivefs_vfs->global_ctx=global_ctx; - *global_ctx=captivefs_vfs; - captivefs_vfs->inits=1; - captivefs_vfs->mounts=0; - - captive_options_init(&captivefs_vfs->options); - - if ((cgs=lu_opt_getchar(cfg,"MOUNT","captive_options"))) { - captive_options_string=(/* de-const */gchar *)captive_strdup_alloca(cgs); - /* Convert ';' to ' ' to prevent its parsing by LUFS to keep its ordering - * to let the options be overridable by user (such as 'ro'). - */ - for (gs=captive_options_string;(gs=strchr(gs,';'));gs++) - *gs=' '; - if (!captive_options_parse( - &captivefs_vfs->options, /* options */ - captive_options_string)) /* captive_args */ - goto fail_free_options; - } - if (lu_opt_getchar(cfg,"MOUNT","private")) - captivefs_vfs->private=TRUE; - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_init"); - - /* image_iochannel */ - if ((cgs=lu_opt_getchar(cfg,"MOUNT","image"))) { - g_assert(captivefs_vfs->options.image_iochannel==NULL); - if (!(captivefs_vfs->options.image_iochannel=g_io_channel_new_file( - cgs, /* filename */ - (captivefs_vfs->options.rwmode==CAPTIVE_OPTION_RWMODE_RW ? "r+" : "r"), /* mode */ - NULL))) { /* error */ - g_warning(_("%s: image_iochannel open failed"),"captivefs_init"); - goto fail_free_options; - } - } - - return captivefs_vfs; - -fail_free_options: - captive_options_free(&captivefs_vfs->options); -/* fail: */ - return NULL; -} - - -/* Cleanup - * Check the global context count and free it if necessary. - * Deallocate memory and free all resources. - */ -void captivefs_free(struct captivefs_vfs *captivefs_vfs) -{ - g_return_if_fail(captivefs_vfs_validate(captivefs_vfs)); - g_return_if_fail(captivefs_vfs->inits>0); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_free"); - - if (--captivefs_vfs->inits>0) { - g_assert(captivefs_vfs_validate(captivefs_vfs)); - return; - } - g_assert(captivefs_vfs->mounts==0); - G_LOCK(libcaptive); - *captivefs_vfs->global_ctx=NULL; - G_UNLOCK(libcaptive); - - g_assert(G_OBJECT(captivefs_vfs->captive_vfs_object)->ref_count==1); - - G_LOCK(libcaptive); - g_object_unref(captivefs_vfs->captive_vfs_object); - G_UNLOCK(libcaptive); - - /* Do not: g_io_channel_unref(captivefs_vfs->options.image_iochannel); - * as it will be unreferenced by captive_options_free(). - */ - captive_options_free(&captivefs_vfs->options); - g_free(captivefs_vfs); -} - - -/* Mount the file system. - * Called when a mount operation is performed. - * Initialize specific connections, login, etc. - * - * Notes: - * By default, LUFS may attempt multiple connections at once. If your - * filesystem doesn't support this, you need to specificy -c 1 on the - * lufsmount command line or connections=1 in the mount options. - * See ftpfs for an example of how to read configuration options - * from a configuration file if you want to, for example, be able to set - * default values. - */ -int captivefs_mount(struct captivefs_vfs *captivefs_vfs) -{ - /* We may be called from the parent. */ - g_return_val_if_fail(captivefs_vfs!=NULL,FALSE); - captivefs_vfs_validate(captivefs_vfs); /* It may return FALSE. */ - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_mount"); - - captivefs_vfs->mounts++; - - captivefs_vfs_validate(captivefs_vfs); /* It may return FALSE. */ - - return 1; /* NEVER return 0 */ -} - - -/* Unmount the file system - * Called when the file system is unmounted. - */ -void captivefs_umount(struct captivefs_vfs *captivefs_vfs) -{ - g_return_if_fail(captivefs_vfs_validate(captivefs_vfs)); - g_return_if_fail(captivefs_vfs->mounts>0); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_umount"); - - captivefs_vfs->mounts--; - - g_assert(captivefs_vfs_validate(captivefs_vfs)); -} - - -#ifdef HAVE_STRUCT_LUFS_SBATTR -int captivefs_statfs(struct captivefs_vfs *captivefs_vfs,struct lufs_sbattr *sbattr) -{ -CaptiveVfsVolumeInfo captive_volume_info; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(captivefs_vfs_validate(captivefs_vfs),-1); - g_return_val_if_fail(sbattr!=NULL,-1); - - if (captivefs_vfs->options.debug_messages) - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_statfs"); - - G_LOCK(libcaptive); - errvfsresult=captive_vfs_volume_info_get(captivefs_vfs->captive_vfs_object,&captive_volume_info); - G_UNLOCK(libcaptive); - if (errvfsresult!=GNOME_VFS_OK) - return -1; - - sbattr->sb_bytes=captive_volume_info.bytes; - sbattr->sb_bytes_free=captive_volume_info.bytes_free; - sbattr->sb_bytes_available=captive_volume_info.bytes_available; - /* 'sbattr->sb_files' not known - left unchanged. */ - /* 'sbattr->sb_ffree' not known - left unchanged. */ - - return 0; -} -#endif /* HAVE_STRUCT_LUFS_SBATTR */ diff --git a/src/client/lufs/captivefs-vfs.h b/src/client/lufs/captivefs-vfs.h deleted file mode 100644 index b59194f..0000000 --- a/src/client/lufs/captivefs-vfs.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * Include file for lufs interface module vfs objects implementation for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_LUFS_CAPTIVEFS_VFS_H -#define _CAPTIVE_LUFS_CAPTIVEFS_VFS_H 1 - - -#include -#include -#include -#include - - -G_BEGIN_DECLS - -struct captivefs_vfs { - CaptiveVfsObject *captive_vfs_object; - struct captive_options options; - gboolean private; - pid_t parent_pid; - struct captivefs_vfs **global_ctx; - gint inits,mounts; - }; - -gboolean captivefs_vfs_validate(struct captivefs_vfs *captivefs_vfs); - -G_END_DECLS - - -#endif /* _CAPTIVE_LUFS_CAPTIVEFS_VFS_H */ diff --git a/src/client/lufs/lufs-captivefs.pod.pl.in b/src/client/lufs/lufs-captivefs.pod.pl.in deleted file mode 100644 index de68351..0000000 --- a/src/client/lufs/lufs-captivefs.pod.pl.in +++ /dev/null @@ -1,58 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for lufs-captivefs(7) man page -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -print <<'POD_EOF'; -=head1 NAME - -lufs-@PACKAGE@fs - Linux Userland File System module for NTFS as filesystem - - -=head1 DESCRIPTION - -B(7) module for Linux Userland File System (LUFS) enables -B system to access NTFS drives by Microsoft Windows drivers in -the most common way of kernel-level filesystem implementation. - -{B} option of B(1) is respected -although the final filesystem operations are always processed in single-channel -mode. Do not set B to B<1> as it would invoke errors by LUFS kernel -driver. - - -POD_EOF -require "../../libcaptive/client/options.pod.pl"; -print <<'POD_EOF'; -=head1 SEE ALSO - -B(8), B(1), B<@PACKAGE@>(7) - - -=head1 AUTHOR - -Jan Kratochvil >, - I -POD_EOF -1; diff --git a/src/client/lufs/mount.captive.in b/src/client/lufs/mount.captive.in deleted file mode 100755 index 3e0a47f..0000000 --- a/src/client/lufs/mount.captive.in +++ /dev/null @@ -1,136 +0,0 @@ -#! /usr/bin/perl -w -# -# $Id$ -# External mount command for mount(8) to interface lufsd(1) -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use strict; -use Carp qw(cluck confess); -use Getopt::Long; -# Do not use any non-core Perl modules here. -# Be perl-5.0 compatible (is it needed if we require Linux kernel >= 2.4 ?) - - -my $vardir='@localstatedir@/lib/captive'; -$vardir=~s#\$\Q{prefix}\E#'@prefix@';#ge; -$vardir="/var/lib/captive" if $vardir=~/^@/; -my $lufsd_bin='@PATH_LUFSD@'; -$lufsd_bin="/usr/bin/lufsd" if $lufsd_bin=~/^@/; -my $captive_sandbox_server_bin='@libexecdir@/captive-sandbox-server'; -$captive_sandbox_server_bin=~s#\$\Q{exec_prefix}\E#'@exec_prefix@';#ge; -$captive_sandbox_server_bin=~s#\$\Q{prefix}\E#'@prefix@';#ge; -$captive_sandbox_server_bin="/usr/libexec/captive-sandbox-server" if $captive_sandbox_server_bin=~/^@/; - - -my $ME=($0=~m#([^/]*)$#)[0] or die "Cannot detetect my basename from: $0"; -my $fsname=$ME; -$fsname=~s/^mount[.]captive-// or die "Cannot detect captive filesystem module from my name: $fsname"; -my $image=shift @ARGV or die "Missing argv[1]: device or image pathname"; --r $image or die "Image pathname not readable: $image"; -warn "warning: '-o loop' is not neccessary for Captive filesystem mounts" - if $image=~m#^/dev/loop#; -my $dir=shift @ARGV or die "Missing argv[2]: mount point directory"; --d $dir or die "Mount point directory not a valid directory: $dir"; -shift @ARGV if my $nomtab =$ARGV[0] && $ARGV[0] eq "-n"; -shift @ARGV if my $verbose=$ARGV[0] && $ARGV[0] eq "-v"; -my $oo=""; -do { shift @ARGV; $oo=shift @ARGV; } if $ARGV[0] && $ARGV[0] eq "-o"; -die "Excessive arguments: @ARGV" if @ARGV; - -sub die_install -{ - die -"You should run captive-install-acquire(1) of 'captive-install' package, -otherwise you can also acquire this file from URL: -http://www.microsoft.com/WindowsXP/pro/downloads/servicepacks/sp1/checkedbuild.asp -"; -} - -my $filesystem=$vardir."/".$fsname.".sys"; -if (!-r $filesystem) { - warn "W32 filesystem .sys module not found: $filesystem"; - die_install(); - } -my $ntoskrnl=$vardir."/ntoskrnl.exe"; -if (!-r $ntoskrnl) { - warn "W32 ntoskrnl.exe not found: $ntoskrnl"; - die_install(); - } - -# Keep @opt_captive ordering -# to let the options be overridable by user (such as 'ro'). -my @opt_captive=(); -my @opt_lufs=(); -my $opt_force; -my $opt_rwmode="--blind"; -for (split /,/,$oo) { - $_="--$_" if $_ eq "ro" || $_ eq "rw"; - $opt_rwmode=$_ if /^--(?:ro|rw|blind)$/; - $opt_force=1 if $_ eq "force"; - push @opt_captive,$_ if /^--/; - push @opt_lufs,$_ if !/^--/; - } - -# Shameless advertisement: -if ($fsname eq "ntfs") { - for my $fh (*STDERR,*STDOUT) { - if (-t $fh) { - print $fh 'Captive NTFS v@VERSION@. Check a new version at: http://www.jankratochvil.net/'."\n"; - last; - } - } - } - -if (!$opt_force) { - local *MTAB; - if (!open MTAB,"/etc/mtab") { - warn "Cannot open /etc/mtab: $!"; - } - else { - local $/=undef(); - my $mtab=; - close MTAB; - die "" - ."$ME: $image already mounted\n" - ."$ME: according to mtab, $image is mounted on $1\n" - ."$ME: Use '-o force' to mount the image notwithstanding.\n" - if $mtab=~/^\Q$image\E\s+(\S+)/m; - } - } - -$oo="" - ."fs=captivefs," - ."mntent.mnt_fsname=$image,mntent.mnt_type=captive-$fsname," # Double-dashes forbidden. - ."dir_cache_entries=0," - ."image=$image," - .join(",",@opt_lufs)."," - ."captive_options=" - .($fsname eq "cdfs" ? "--cdrom;--ro;" : "--disk;--rw;") - ."--load-module=$ntoskrnl;--filesystem=$filesystem;" - ."--sandbox-server=$captive_sandbox_server_bin;" - ."--bug-pathname=$vardir/bug-%FT%T.captivebug.xml.gz;" - ."--syslog;" - .join(";",@opt_captive); - -warn "$0: '-n' not supported - ignored" if $nomtab; - -# Use "'$oo'" to permit another expansion by bash(1) during lufsmnt(8) execution. -my @argv=($lufsd_bin,"none",$dir,"-o",$oo); - -print STDERR "$0: @argv\n" if $verbose; -exec $lufsd_bin @argv; -die "Failed to execute: @argv"; diff --git a/src/client/lufs/mount.captive.pod.pl.in b/src/client/lufs/mount.captive.pod.pl.in deleted file mode 100644 index aca3fd4..0000000 --- a/src/client/lufs/mount.captive.pod.pl.in +++ /dev/null @@ -1,149 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for captive(7) man page -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -print <<'POD_EOF'; -=head1 NAME - -mount.@PACKAGE@ - B(8) interface for NTFS disk access - - -=head1 SYNOPSIS - -B {B|B} B -[B<-n>] [B<-v>] [B<-o> B] - -B B<-t> B<@PACKAGE@-ntfs> -[B<-n>] [B<-v>] [B<-o> B] -{B|B} B - - -=head1 DESCRIPTION - -B(8) provides B(8) interface to B(7) -by calling B(1) with appropriate arguments. You should never call -this command directly - use B(8) instead. - -B(8) (B<@PACKAGE@> filesystem type) is never used - this command -is provided just as a base mount(8) interface to B<@PACKAGE@>(7). You must always -use @PACKAGE@-B filesystem type such as B<@PACKAGE@-ntfs>. Other supported -filesystem types are: -POD_EOF -print join ", ",map("B<$_>",(split /:/,'@enable_sbin_mount_fs@')); -print <<'POD_EOF'; - - -=head1 OPTIONS - -=over - -=item {B|B} - -Pathname such as B or B. You should refer to the -partition name, not the whole device (B is forbidden). -B may correspond to B -on your system. - - -=item B - -Existing empty target directory where {B|B} will be -mounted. - - -=item B<-n> - -Do not modify B. This option is currently not supported (ignored), -B is modified notwithstanding. - - -=item B<-v> - -Enable verbose mode. Command B(1) being called is shown. - - -=item B<-o> B - -Custom options passed to B<@PACKAGE@>(7) separated by comma (B<,>). -See the B<@PACKAGE@>(7) manpage for details on options prefixed by -double-dashes (B<-->) will be used for B(7) / -B(8). Options without double-dashes (B<-->) will be used for -B(1). You may be interested in these unprefixed options: - -=over - -=item B - -Force the mount of {B|B} despite it appears to be already -mounted according to B(5). You should never mount a device multiple -times in read-write mode. It is safe to mount it multiple times in read-only -mode. It is safe to mount it once in read-write mode and multiple times -in read-only mode although you may encounter filesystem errors by the read-only -filesystems in such case. - -This is the only option is interpreted by B itself; it is not -B(7) nor B(1) option. - -=item B - -B(8) defaults to filesystem files B<644> - read-write for system -root (or the regular user owner) and read-only for others. You can force the -mode B<600> by this option (read-write for the owner, inaccessible for others). -Mode B<755> or <700> applies to directories. Options B/B will -be OR-ed to the private/public permissions set by this option. - -=item B=B<666> - -Octal mask to be OR-ed on file permissions (minimum file permissions). - -=item B=B<777> - -Octal mask to be OR-ed on directory permissions (minimum directory -permissions). - -=item B=B<500> - -Supply the B to be the user identification number owning all the files. - -=item B=B<500> - -Supply the B to be the group identification number owning all the files. - -=back - -=back - - -=head1 SEE ALSO - -B(7), B(1) - - -=head1 AUTHOR - -Jan Kratochvil >, - I -POD_EOF -1; diff --git a/src/client/sandbox-server/.gdbinit b/src/client/sandbox-server/.gdbinit deleted file mode 100644 index 1cd4172..0000000 --- a/src/client/sandbox-server/.gdbinit +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ -# gdb init script for convenient captive-sandbox-server debugging -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# for $(top_srcdir)/src/libcaptive/ps/signal.c -handle SIGSEGV nostop noprint pass -set env LD_PRELOAD=/usr/lib/libefence.so -# FIXME: _append_ to the previous LD_LIBRARY_PATH value -set env LD_LIBRARY_PATH ../../libcaptive/.libs/ -file ./.libs/captive-sandbox-server -b main -run --setuid - --setgid - --chroot - -c diff --git a/src/client/sandbox-server/Makefile.am b/src/client/sandbox-server/Makefile.am deleted file mode 100644 index f38f296..0000000 --- a/src/client/sandbox-server/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -# $Id$ -# automake source for sandbox filesystem sandbox server -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -captive_sandbox_server_SOURCES= \ - main.c -captive_sandbox_server_CFLAGS=$(ORBIT_CFLAGS) $(LINC_CFLAGS) -captive_sandbox_server_LDADD =$(ORBIT_LIBS) $(LINC_LIBS) $(captive_library) $(INTLLIBS) -libexec_PROGRAMS=captive-sandbox-server -libexecPROGRAMS_INSTALL=${INSTALL} -o root -g root -m 4755 -EXTRA_DIST+=.gdbinit - -install-data-hook: - $(mkinstalldirs) $(DESTDIR)$(CAPTIVE_SANDBOX_CHROOT) - $(mkinstalldirs) $(DESTDIR)$(CAPTIVE_SANDBOX_CHROOT)/tmp - chmod 1777 $(DESTDIR)$(CAPTIVE_SANDBOX_CHROOT)/tmp - -install-exec-hook: - if test `id -u` -eq 0 -a -z "$(DESTDIR)";then \ - if grep -q '^$(CAPTIVE_SANDBOX_SETGID):' /etc/group;then true;else \ - echo "ERROR: Add '$(CAPTIVE_SANDBOX_SETGID)' to your '/etc/group'; see README and groupadd(8)"; \ - exit 1; \ - fi; \ - if grep -q '^$(CAPTIVE_SANDBOX_SETUID):' /etc/passwd;then true;else \ - echo "ERROR: Add '$(CAPTIVE_SANDBOX_SETUID)' to your '/etc/passwd'; see README and useradd(8)"; \ - exit 1; \ - fi; \ - fi - -EXTRA_DIST+=captive-sandbox-server.pod.pl.in -CLEANFILES+=captive-sandbox-server.pod captive-sandbox-server.1 -if ENABLE_MAN_PAGES -captive_sandbox_server_man_cond=captive-sandbox-server.1 -endif -man_MANS=$(captive_sandbox_server_man_cond) diff --git a/src/client/sandbox-server/captive-sandbox-server.pod.pl.in b/src/client/sandbox-server/captive-sandbox-server.pod.pl.in deleted file mode 100644 index d0d8012..0000000 --- a/src/client/sandbox-server/captive-sandbox-server.pod.pl.in +++ /dev/null @@ -1,65 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for captive-cmdline(1) man page -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -print <<'POD_EOF'; -=head1 NAME - -@PACKAGE@-sandbox-server - Security+safety wrapper for NTFS disk access - - -=head1 SYNOPSIS - -B<@PACKAGE@-sandbox-server> - - -=head1 DESCRIPTION - -Program implementing separation of emulated I kernel -environment from the rest of I system. Your system gets protected by -B(2), B(2), B(2) and B(2) UNIX security -features against malicious Microsoft Windows drivers. - -Use this program as argument of B<--sandbox-server> option of B<@PACKAGE@>(7). -Do not use this option/program during B<@PACKAGE@>(7) debugging. - - -=head1 OPTIONS - -No options are permitted for this command - it will display its I -connection properties on its standard output. - - -=head1 SEE ALSO - -B<@PACKAGE@>(7), B<@PACKAGE@-cmdline>(1), B(7) - - -=head1 AUTHOR - -Jan Kratochvil >, - I -POD_EOF -1; diff --git a/src/client/sandbox-server/main.c b/src/client/sandbox-server/main.c deleted file mode 100644 index ce88748..0000000 --- a/src/client/sandbox-server/main.c +++ /dev/null @@ -1,659 +0,0 @@ -/* $Id$ - * filesystem sandbox server stub for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include "captive/options.h" -#include -#include "captive/macros.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "captive/client.h" - -#ifdef HAVE_ORBIT_LINK -char *link_get_tmpdir(void); -void link_set_tmpdir(const char *dir); -#else -#include /* for linc_set_tmpdir() */ -#endif - - -/* Do not: #include "../../libcaptive/sandbox/split.h" * for captive_sandbox_fd_closeup(); FIXME * - * as it has libcaptive-dependent includes conditioned by ORBIT2. - * FIXME: Unify this declaration: - */ -void captive_sandbox_fd_closeup(int fd_first_to_delete); -void captive_corba_sandbox_child(const gchar *chrooted_orbit_dir); - - -/* CONFIG: */ - -/* FIXME: We hit linc-1.0.1/src/linc-protocols.c/linc_protocol_get_sockaddr_unix() - * limit of socket pathname 64 characters. - * With CHROOT_PATH_HASHKEY_LENGTH 12 "linc-%x-%x-%x%x" still does not fit completely. - */ -#define CHROOT_PATH_HASHKEY_LENGTH (12) - - -GQuark sandbox_server_main_error_quark(void) -{ -GQuark r=0; - - if (!r) - r=g_quark_from_static_string("sandbox-server"); - - return r; -} - - -static gchar *optarg_setuid=CAPTIVE_SANDBOX_SETUID; -static gchar *optarg_setgid=CAPTIVE_SANDBOX_SETGID; -static gchar *optarg_chroot=CAPTIVE_SANDBOX_CHROOT; -static gint optarg_no_rlimit=0; - -static const struct poptOption popt_table[]={ -#define SANDBOX_SERVER_POPT(longname,argInfoP,argP,descripP,argDescripP) \ - { \ - longName: (longname), \ - shortName: 0, \ - argInfo: (argInfoP), \ - arg: (void *)argP, \ - val: 0, \ - descrip: (descripP), \ - argDescrip: (argDescripP), \ - } - - SANDBOX_SERVER_POPT("setuid" ,POPT_ARG_STRING,&optarg_setuid, - N_("Username or UID to become; \"-\" for disable"),N_("UID")), - SANDBOX_SERVER_POPT("setgid" ,POPT_ARG_STRING,&optarg_setgid, - N_("Groupname or GID to become; \"-\" for disable"),N_("GID")), - SANDBOX_SERVER_POPT("chroot" ,POPT_ARG_STRING,&optarg_chroot, - N_("Pathname to directory for chroot(2); \"-\" for disable"),N_("directory")), - SANDBOX_SERVER_POPT("no-rlimit",POPT_ARG_NONE ,&optarg_no_rlimit, - N_("Disable setrlimit(2) restrictions"),NULL), - -#undef SANDBOX_SERVER_POPT - POPT_AUTOHELP - POPT_TABLEEND - }; - - -static gchar *fatal_argv0; - -static void fatal(const char *fmt,...) -{ -va_list ap; - - fprintf(stderr,"%s: ",fatal_argv0); - va_start(ap,fmt); - vfprintf(stderr,fmt,ap); - va_end(ap); - fprintf(stderr,"!\nAborting!\n"); - exit(EXIT_FAILURE); - /* NOTREACHED */ - for (;;); -} - -static void check_dir_safety(const gchar *dir) -{ -gchar *local_dir; -const gchar *cs; -static gint depth=0; - - if (++depth>=1000) - fatal("Loop count >=%d during check_dir_safety(\"%s\")",depth,dir); - - if (*dir!='/') - fatal("chroot path \"%s\" not absolute",dir); - dir=captive_printf_alloca("%s/",dir); - local_dir=(gchar *)captive_strdup_alloca(dir); - for (cs=dir;cs;cs=strchr(cs+1,'/')) { -struct stat statbuf; - - g_assert(*cs=='/'); - /* Include the trailing '/' to resolve the root directory as "/". */ - memcpy(local_dir,dir,cs+1-dir); - local_dir[cs+1-dir]=0; - if (lstat(local_dir,&statbuf)) - fatal("lstat(\"%s\") of chroot path component: %m",local_dir); - if (S_ISLNK(statbuf.st_mode)) { -char linkbuf[PATH_MAX]; -int linkbuflen; - - if (0>(linkbuflen=readlink(local_dir,linkbuf,sizeof(linkbuf)-1))) - fatal("readlink(\"%s\") of chroot path component: %m",local_dir); - linkbuf[linkbuflen]=0; - check_dir_safety(linkbuf); - if (stat(local_dir,&statbuf)) /* NOT lstat(2) */ - fatal("stat(\"%s\") of chroot path component: %m",local_dir); - } - if (!S_ISDIR(statbuf.st_mode)) - fatal("lstat/stat(\"%s\") of chroot path component is !S_ISDIR",local_dir); - if (statbuf.st_uid!=0) - fatal("lstat/stat(\"%s\") of chroot path component has UID %d !=0",local_dir,(int)statbuf.st_uid); - if (statbuf.st_gid!=0) - fatal("lstat/stat(\"%s\") of chroot path component has GID %d !=0",local_dir,(int)statbuf.st_gid); - if ((statbuf.st_mode&(S_IFDIR|S_ISVTX|0111)) != (S_IFDIR|0111)) - fatal("lstat/stat(\"%s\") of chroot path component has mode 0%o !=04[01]111",local_dir,(int)statbuf.st_mode); - } - - depth--; -} - -static void chrooted_unlink_recursive(const gchar *pathname) -{ -DIR *dir; -struct dirent *dirent; -static gint depth=0; -struct stat statbuf; - - if (++depth>=1000) - fatal("Loop count >=%d during chrooted_unlink_recursive(\"%s\")",depth,pathname); - - /* Security: Do not allow anyone to escape the sandbox directory by symlinks. */ - if (lstat(pathname,&statbuf)) - fatal("Cannot lstat(\"%s\") to delete leftover sandbox files: %m",pathname); - if (!S_ISDIR(statbuf.st_mode)) { - if (unlink(pathname)) - fatal("Cannot unlink(\"%s\") to delete leftover sandbox files: %m",pathname); - goto done; - } - if (!(dir=opendir(pathname))) - fatal("Cannot opendir(\"%s\") to delete leftover sandbox files: %m",pathname); - while (errno=0,(dirent=readdir(dir))) { -gchar *dirent_path; - - if (!strcmp(dirent->d_name,".") || !strcmp(dirent->d_name,"..")) - continue; - dirent_path=g_strdup_printf("%s/%s",pathname,dirent->d_name); - chrooted_unlink_recursive(dirent_path); - g_free(dirent_path); - } - if (errno) - fatal("Cannot readdir(\"%s\") during delete of leftover sandbox files: %m",pathname); - if (closedir(dir)) - fatal("Cannot closedir(\"%s\") during delete of leftover sandbox files: %m",pathname); - if (rmdir(pathname)) - fatal("Cannot rmdir(\"%s\") during delete of leftover sandbox files: %m",pathname); - -done: - depth--; -} - -static void chrooted_cleanuplockeddirs(const gchar *pathname,const gchar *prefix) -{ -DIR *dir; -struct dirent *dirent; - - if (!(dir=opendir(pathname))) { - if (errno!=ENOTDIR) - fatal("Cannot opendir(\"%s\") to delete leftover sandbox files: %m",pathname); - /* errno==ENOTDIR, a regular file */ - if (unlink(pathname)) - fatal("Cannot unlink(\"%s\") to delete leftover sandbox files: %m",pathname); - return; - } - while (errno=0,(dirent=readdir(dir))) { -gchar *dirent_path; -int direntfd; - - if (!strcmp(dirent->d_name,".") || !strcmp(dirent->d_name,"..")) - continue; - if (strncmp(dirent->d_name,prefix,strlen(prefix))) - continue; - dirent_path=g_strdup_printf("%s/%s",pathname,dirent->d_name); - if (-1==(direntfd=open(dirent_path,O_RDONLY))) { - if (errno==ENOENT) /* It could disappear in the meantime. */ - goto next_dirent_free_dirent_path; - fatal("Cannot open(\"%s\") as the child directory during delete of leftover sandbox files: %m",dirent_path); - } - if (flock(direntfd,LOCK_EX|LOCK_NB)) { - if (errno==EWOULDBLOCK) /* Valid directory in use. */ - goto next_dirent_close_direntfd; - fatal("Cannot flock(\"%s\",LOCK_EX|LOCK_NB) child directory during delete of leftover sandbox files: %m",dirent_path); - } - chrooted_unlink_recursive(dirent_path); -next_dirent_close_direntfd: - if (close(direntfd)) - fatal("Cannot close(\"%s\") child directory during delete of leftover sandbox files: %m",dirent_path); -next_dirent_free_dirent_path: - g_free(dirent_path); - } - if (errno) - fatal("Cannot readdir(\"%s\") during delete of leftover sandbox files: %m",pathname); - if (closedir(dir)) - fatal("Cannot closedir(\"%s\") during delete of leftover sandbox files: %m",pathname); -} - -static void chrooted_createdir(const gchar *dir,uid_t uid,gid_t gid,gboolean lock) -{ -gint retries; - - for (retries=0;retries<10;retries++) { -struct stat statbuf; -int dirfd; - - if (mkdir(dir,0711)) { - if (errno!=EEXIST) - fatal("Failed to create chroot directory \"%s\": %m",dir); - chrooted_unlink_recursive(dir); - if (mkdir(dir,0711)) - fatal("Failed to create chroot directory \"%s\" after attempted unlink: %m",dir); - } - if (!lock) - break; - dirfd=open(dir,O_RDONLY); - if (dirfd==-1) { - if (errno!=ENOENT) - fatal("Failed to open created chroot directory \"%s\" to lock it: %m",dir); - continue; - } - /* Do not use 'LOCK_NB' here as the garbage collector should release it soon. */ - if (flock(dirfd,LOCK_EX)) - fatal("Failed to lock created chroot directory \"%s\": %m",dir); - if (lstat(dir,&statbuf)) { - if (errno!=ENOENT) - fatal("Failed to lstat(2) created chroot directory \"%s\": %m",dir); - if (close(dirfd)) - fatal("Failed to close created and locked chroot directory \"%s\": %m",dir); - continue; - } - /* Leave 'dirfd' open to leave it LOCK_EX-ed. */ - break; - } - if (chown(dir,uid,gid)) - fatal("Failed to chown(\"%s\",%d,%d): %m",dir,uid,gid); - if (chmod(dir,0711)) /* Just to be safe after chown(2); should be already done by mkdir(2). */ - fatal("Failed to chmod(\"%s\",0%o): %m",dir,0711); -} - -static void sandbox_server_rlimit(int resource,const gchar *resource_string,rlim_t rlim_max) -{ -struct rlimit rlim; - - rlim.rlim_cur=rlim.rlim_max=rlim_max; - if (setrlimit(resource,&rlim)) - fatal("setrlimit(%s,%d): %m",resource_string,(int)rlim_max); - if (getrlimit(resource,&rlim)) - fatal("getrlimit(%s,%d): %m",resource_string,(int)rlim_max); - if (rlim.rlim_cur!=rlim_max || rlim.rlim_max!=rlim_max) - fatal("Unsuccessful setrlimit(%s)",resource_string); -} - -static void sandbox_server_mkdir_p(const gchar *dirpathname) -{ -gchar *pathname=(/* de-const */ gchar *)captive_strdup_alloca(dirpathname); -gchar *gs,*gs2; - - /* Missing mkdir(2) of the last component path is intentional: */ - for (gs=pathname;(gs2=strchr(gs,'/'));gs=gs2) { - *gs2='\0'; - if (*pathname && mkdir(pathname,S_ISVTX|0777)) { - if (errno!=EEXIST) - fatal("Failed to mkdir(\"%s\"): %m",pathname); - } - *gs2++='/'; - } -} - -static const gchar *chrooted_orbit_dir; - -static void chroot_setup(gboolean fragile) -{ -uid_t want_uid=0; -const gchar *want_uid_name=NULL; -gid_t want_gid=0; -char *endptr; -const gchar *chroot_pid_hashkey_dir=NULL; - - if (fragile) { - captive_sandbox_fd_closeup(2 /* STDERR */ +1); - clearenv(); - } - -#define CLEANEMPTY(var) G_STMT_START { \ - if ((var) && (!*(var) || *(var)=='-')) \ - (var)=NULL; \ - } G_STMT_END - CLEANEMPTY(optarg_setgid); - CLEANEMPTY(optarg_setuid); - CLEANEMPTY(optarg_chroot); -#undef CLEANEMPTY - - if (optarg_setgid) { -long want_gidl; - - want_gidl=strtol(optarg_setgid,&endptr,10); - if (!endptr || !*endptr) { - want_gid=want_gidl; - if (want_gidl<=0 || want_gid!=(gid_t)want_gidl) - fatal("Numeric setgid not parsable: %s",optarg_setgid); - } - else { -struct group *want_gid_group=NULL; - if (!(want_gid_group=getgrnam(optarg_setgid))) - fatal("Unable to query setgid group name \"%s\"",optarg_setgid); - want_gid=want_gid_group->gr_gid; - } - } - - if (optarg_setuid) { -long want_uidl; -struct passwd *want_uid_passwd; - want_uidl=strtol(optarg_setuid,&endptr,10); - if (!endptr || !*endptr) { - want_uid=want_uidl; - if (want_uidl<=0 || want_uid!=(gid_t)want_uidl) - fatal("Numeric setuid not parsable: %s",optarg_setuid); - } - else { - if (!(want_uid_passwd=getpwnam(optarg_setuid))) - fatal("Unable to query setuid user name \"%s\"",optarg_setuid); - want_uid=want_uid_passwd->pw_uid; - } - if (!want_uid) - fatal("Unable to detect setuid UID"); - if (!(want_uid_passwd=getpwuid(want_uid))) - fatal("Unable to query name of UID %d",(int)want_uid); - want_uid_name=captive_strdup_alloca(want_uid_passwd->pw_name); - } - - /* Prevent: GLib-WARNING **: getpwuid_r(): failed due to unknown user id (42) - * Try to invoke GLib g_get_any_init() before possible chroot(2) below. - */ - g_get_user_name(); - g_get_real_name(); - g_get_home_dir(); - g_get_tmp_dir(); - - /* Pre-resolve "link_get_tmpdir" symbol to prevent its later failed - * resolving in chroot(2) mode in Debian dynamic build. - */ -#ifdef HAVE_ORBIT_LINK - g_free(link_get_tmpdir()); /* returns g_strdup()ed string */ -#else - g_free(linc_get_tmpdir()); /* returns g_strdup()ed string */ -#endif - - if (fragile && !optarg_chroot) - fatal("Fragile setuid/root environment but no --chroot set"); - if (optarg_chroot) { -const gchar *chroot_pid_dir; -GRand *grand; -gchar chroot_hashkey[CHROOT_PATH_HASHKEY_LENGTH+1],*s; -gint gi; - - check_dir_safety(optarg_chroot); - if (!(grand=g_rand_new())) /* I hope g_rand_new() is security-safe. It looks so. */ - fatal("Cannot initialize random number generator g_rand_new()"); - for (s=chroot_hashkey;s=0 && gi<10) - *s='0'+gi-(0); - else if (gi>=10+0 && gi<10+26) - *s='a'+gi-(10); - else if (gi>=10+26+0 && gi<10+26+26) - *s='A'+gi-(10+26); - else g_assert_not_reached(); - } - g_rand_free(grand); - *s=0; - if (geteuid()==0) { /* Not 'fragile' as we can be native 'root'. */ - chrooted_cleanuplockeddirs(optarg_chroot,"s-"); - chrooted_cleanuplockeddirs(captive_printf_alloca("%s/tmp",optarg_chroot),"captive-orbit-"); - } - chroot_pid_dir=captive_printf_alloca("%s/s-%d",optarg_chroot,(int)getpid()); - chrooted_createdir(chroot_pid_dir,(!optarg_setuid ? (uid_t)-1 : want_uid),(!optarg_setgid ? (gid_t)-1 : want_gid), - TRUE); /* lock */ - chroot_pid_hashkey_dir=captive_printf_alloca("%s/%s",chroot_pid_dir,chroot_hashkey); - chrooted_createdir(chroot_pid_hashkey_dir,(!optarg_setuid ? (uid_t)-1 : want_uid),(!optarg_setgid ? (gid_t)-1 : want_gid), - FALSE); /* lock */ - if (chroot(chroot_pid_hashkey_dir)) - fatal("Failed to chroot(\"%s\"): %m",chroot_pid_hashkey_dir); - if (chdir("/")) - fatal("Failed to chdir(\"%s\"): %m","/"); - /* Now it is safe to set umask(0000) as we are protected by 'chroot_hashkey'. - * We need it to permit our spawning parent to hardlink its sockets to us. - */ - umask(0000); - if (umask(0000)!=0000) - fatal("Failed to set umask(0%o): %m",0000); - printf("chroot_pid_hashkey_dir=%s\n",chroot_pid_hashkey_dir); - } - - if (fragile && !optarg_setgid) - fatal("Fragile setuid/root environment but no --setgid set"); - if (optarg_setgid) { - if (!want_gid || setgid(want_gid)) - fatal("Failed to setgid(%d)",(!want_gid ? -1 : (int)want_gid)); - if (setgroups(1 /* size */,&want_gid)) - fatal("Failed to setgroups(1,[%d])",(!want_gid ? -1 : (int)want_gid)); - } - if (fragile && !optarg_setuid) - fatal("Fragile setuid/root environment but no --setuid set"); - if (optarg_setuid) { - if (!want_uid || setuid(want_uid)) - fatal("Failed to setuid(%d)",(!want_uid ? -1 : (int)want_uid)); - } - - /* Prepare /t for /t/o-$PID directories for ORBit2 - * and also for parent's hardlink to its /t/o-$pid directory. */ - if (optarg_chroot) { -gchar *chrooted_orbit_dir_old; - - if (mkdir("/t",S_ISVTX|0777)) { - if (errno!=EEXIST) - fatal("Failed to mkdir(\"%s\"): %m","/t"); - } - if (mkdir("/etc",0700)) - fatal("Failed to mkdir(\"%s\"): %m","/etc"); - if (want_uid_name && want_uid && want_gid) { -FILE *f; - if (!(f=fopen("/etc/passwd","w"))) - fatal("Failed to fopen(\"%s\",\"w\"): %m","/etc/passwd"); - if (0>fprintf(f,"%s:*:%d:%d:%s:%s:/bin/false\n",want_uid_name,(int)want_uid,(int)want_gid,want_uid_name,optarg_chroot)) - fatal("Failed to fprintf(\"%s\"): %m","/etc/passwd"); - if (fclose(f)) - fatal("Failed to fclose(\"%s\"): %m","/etc/passwd"); - } - g_assert(chroot_pid_hashkey_dir!=NULL); - chrooted_orbit_dir=g_strdup_printf("%s/t/o-%d",chroot_pid_hashkey_dir,getpid()); - /* Last pathname component is not created: */ - sandbox_server_mkdir_p(chrooted_orbit_dir); - /* Prepare '/tmp' for the initial CORBA_ORB_init() default path. - * Workaround sandbox_server_mkdir_p() does not create last component. - * Do not use '/tmp' directly as some distributions may set custom - * tmpdir pathname by $ENV{"TMPDIR"} etc. - */ - sandbox_server_mkdir_p(captive_printf_alloca("%s/",g_get_tmp_dir())); - /* Set '0700' to prevent: Wrong permissions for ... - * by linc-1.0.1-1/src/linc-protocols.c/make_local_tmpdir() - */ - if (mkdir(chrooted_orbit_dir,0700)) { - /* Do not: g_assert(errno==EEXIST); - * as if 'optarg_chroot' the whole chroot(2)ed directory should be ours. - */ - fatal("Cannot created chrooted_orbit_dir \"%s\": %m",chrooted_orbit_dir); - } - /* Init 'orb' to pass through its linc_set_tmpdir() to not to be overriden below. */ - { -CORBA_ORB orb; -CORBA_Environment ev; -int orb_argc=1; -gchar *orb_argv[]={ - (gchar *)captive_strdup_alloca("captive-sandbox-server"), - NULL}; - - CORBA_exception_init(&ev); - /* libcaptive is single-threaded only, caller must lock it. - * If thread A spawned the sandbox while currently doing its own work - * and thread B calls the sandbox thread B waits on ORB_run() - * while the sandbox waits for the response of thread A ORB. Deadlock. - * "orbit-local-non-threaded-orb" requests thread unaware ORB. - */ - orb=CORBA_ORB_init(&orb_argc,orb_argv,"orbit-local-non-threaded-orb",&ev); - if (orb==CORBA_OBJECT_NIL) - fatal("Cannot initialize CORBA ORB (CORBA_OBJECT_NIL): %m"); - if (ev._major!=CORBA_NO_EXCEPTION) - fatal("Cannot initialize CORBA ORB (exception): %m"); - } -#ifdef HAVE_ORBIT_LINK - chrooted_orbit_dir_old=link_get_tmpdir(); /* returns g_strdup()ed string */ -#else - chrooted_orbit_dir_old=linc_get_tmpdir(); /* returns g_strdup()ed string */ -#endif - g_assert(chrooted_orbit_dir_old!=NULL); -#ifdef HAVE_ORBIT_LINK - link_set_tmpdir(chrooted_orbit_dir); -#else - linc_set_tmpdir(chrooted_orbit_dir); -#endif - if (!*chrooted_orbit_dir_old) - fatal("Cannot detect chrooted_orbit_dir: --with-orbit-line incompatible with ORBit2 version"); - if (rmdir(chrooted_orbit_dir_old)) - fatal("Cannot remove old chrooted_orbit_dir \"%s\": %m",chrooted_orbit_dir_old); - g_free(chrooted_orbit_dir_old); - /* chmod(2) it to prevent mode limitation by - * active ulimit(2) of being executed by mount(8). - */ - /* Set '0777' as our parent does not have 'captive' user permissions. */ - if (chmod(chrooted_orbit_dir,S_ISVTX|0777)) - fatal("Cannot chmod 0%o chrooted_orbit_dir \"%s\": %m",S_ISVTX|0777,chrooted_orbit_dir); - printf("chrooted_orbit_dir=%s\n",chrooted_orbit_dir); - } - - if (fragile || !optarg_no_rlimit) { -#define SANDBOX_SERVER_RLIMIT(what,how) sandbox_server_rlimit((what),G_STRINGIFY(what),(how)) - SANDBOX_SERVER_RLIMIT(RLIMIT_NPROC,0); - SANDBOX_SERVER_RLIMIT(RLIMIT_MEMLOCK,0); - SANDBOX_SERVER_RLIMIT(RLIMIT_CORE,0); - SANDBOX_SERVER_RLIMIT(RLIMIT_FSIZE,0); - SANDBOX_SERVER_RLIMIT(RLIMIT_NOFILE,16); /* >=6; newer ORBit2/link require >6 */ - /* FIXME: Why flock(dirfd,...) in chrooted_createdir() succeeds?: */ - SANDBOX_SERVER_RLIMIT(RLIMIT_LOCKS,0); -#undef SANDBOX_SERVER_RLIMIT - } - - if (fragile) { -gid_t gid_list[2]; -int gid_list_size,i; - - if (getuid()!=want_uid) - fatal("getuid()=%d != want_uid=%d",(int)getuid(),(int)want_uid); - if (geteuid()!=want_uid) - fatal("geteuid()=%d != want_uid=%d",(int)geteuid(),(int)want_uid); - if (getgid()!=want_gid) - fatal("getgid()=%d != want_gid=%d",(int)getgid(),(int)want_gid); - if (getegid()!=want_gid) - fatal("getegid()=%d != want_gid=%d",(int)getegid(),(int)want_gid); - gid_list_size=getgroups(G_N_ELEMENTS(gid_list),gid_list); - for (i=0;i -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -SUBDIRS=libcaptive-install fstab acquire diff --git a/src/install/acquire/Makefile.am b/src/install/acquire/Makefile.am deleted file mode 100644 index c48f502..0000000 --- a/src/install/acquire/Makefile.am +++ /dev/null @@ -1,127 +0,0 @@ -# $Id$ -# automake source for drivers acquiring installation utility Makefile -# Copyright (C) 2003-2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -GLADE_IN= \ - ui-gnome.glade \ - ui-gnome.gladep - -GLADE_OUT= \ - ui-gnome-interface.c \ - ui-gnome-interface.h \ - ui-gnome-callbacks.h \ - ui-gnome-support.c \ - ui-gnome-support.h - -captive_install_acquire_SOURCES= \ - cabextract/cabextract.c \ - cabextract/cabextract.h \ - cabinet.c \ - cabinet.h \ - cabinet-memory.c \ - cabinet-memory.h \ - captivemodid.c \ - captivemodid.h \ - diskscan.c \ - diskscan.h \ - final.c \ - final.h \ - main.c \ - main.h \ - microsoftcom.c \ - microsoftcom.h \ - moduriload.c \ - moduriload.h \ - ui-line.c \ - ui-line.h \ - ui-gnome.c \ - ui-gnome.h \ - $(GLADE_OUT) - -EXTRA_captive_install_acquire_SOURCES= \ - gnome_vfs_read_entire_file.c -captive_install_acquire_LDADD= \ - $(addprefix captive_install_acquire-,$(GNOME_VFS_READ_ENTIRE_FILE_O)) - -gnome_vfs_read_entire_file.c: $(top_srcdir)/gnome_vfs_read_entire_file.c - @$(RM) $@ - $(LN_S) $< $@ - -CLEANFILES+=gnome_vfs_read_entire_file.c - -EXTRA_DIST+= \ - $(GLADE_IN) \ - cabextract/.vimrc \ - captivemodid-list.pl \ - captivemodid-print.pl \ - compatibility-test.sh - -captive_install_acquire-ui-gnome-interface.$(OBJEXT): ui-gnome-callbacks.h - -if HAVE_GLADE_WRITESOURCE -# touch(1) as 'ui-gnome-callbacks.h' are not overwritten if not changed: -$(GLADE_OUT): $(GLADE_IN) - sh $(top_srcdir)/macros/glade-w.sh $< - @touch ui-gnome-callbacks.h - -endif - -CLEANFILES+= \ - ui-gnome-callbacks.c \ - ui-gnome.glade.bak \ - ui-gnome.gladep.bak - -captive_install_acquire_CFLAGS=$(GNOME_VFS_CFLAGS) $(LIBXML_CFLAGS) $(OPENSSL_CFLAGS) -captive_install_acquire_LDADD+=$(GNOME_VFS_LIBS) $(LIBXML_LIBS) $(OPENSSL_LIBS) -captive_install_acquire_LDADD+= $(READLINE_LIBS) $(LIBNTFS_LIBS) $(POPT_LIBS) $(INTLLIBS) $(captive_library) -captive_install_acquire_LDFLAGS=$(READLINE_LDFLAGS) - -# FIXME: /usr/include/gtk-2.0/gtk/gtkitemfactory.h:51: warning: function declaration isn't a prototype -# /* We use () here to mean unspecified arguments. This is deprecated -# * as of C99, but we can't change it without breaking compatibility. -# * (Note that if we are included from a C++ program () will mean -# * (void) so an explicit cast will be needed.) -# */ -# typedef void (*GtkItemFactoryCallback) (); -# We cannot put '-Wno-strict-prototypes' as we get always overriden by $(CFLAGS) ! -captive_install_acquire_CFLAGS+=$(GNOMEUI_CFLAGS) -captive_install_acquire_LDADD +=$(GNOMEUI_LIBS) - -captive_install_acquire_CFLAGS+=-DSYSCONFDIR="$(sysconfdir)" -captive_install_acquire_CFLAGS+=-DVARLIBCAPTIVEDIR="$(localstatedir)/lib/$(PACKAGE)" -captive_install_acquire_LDADD+=../libcaptive-install/libcaptive-install.a - -sysconf_DATA= \ - w32-mod-id.captivemodid.xml -EXTRA_DIST+=$(sysconf_DATA) - -if ENABLE_INSTALL_PKG -captive_install_acquire_cond=captive-install-acquire -endif -sbin_PROGRAMS+=$(captive_install_acquire_cond) - -EXTRA_DIST+=captive-install-acquire.pod.pl.in -CLEANFILES+=captive-install-acquire.pod captive-install-acquire.1 -if ENABLE_MAN_PAGES -if ENABLE_INSTALL_PKG -captive_install_acquire_man_cond=captive-install-acquire.1 -endif -endif -man_MANS=$(captive_install_acquire_man_cond) diff --git a/src/install/acquire/cabextract/AUTHORS b/src/install/acquire/cabextract/AUTHORS deleted file mode 100644 index c8e908c..0000000 --- a/src/install/acquire/cabextract/AUTHORS +++ /dev/null @@ -1,13 +0,0 @@ -Principal author: Stuart Caie - -Based on specification documents from Microsoft Corporation -Quantum decompression researched and implemented by Matthew Russoto -Huffman code adapted from unlzx by Dave Tritscher. -InfoZip team's INFLATE implementation adapted to MSZIP by Dirk Stoecker. -Major LZX fixes by Jae Jung. -Japanese manual page by Katsumi Saito. -Manual page and Debian packaging by Eric Sharkey. -FreeBSD packaging by Maxim Sovolev. -NetBSD packaging by Ben Collver et al. -SuSE packaging by Stefan Dirsch -RPM spec file by Soos Peter. diff --git a/src/install/acquire/cabextract/COPYING b/src/install/acquire/cabextract/COPYING deleted file mode 100644 index d60c31a..0000000 --- a/src/install/acquire/cabextract/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 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. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, 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 or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -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 give any other recipients of the Program a copy of this License -along with the Program. - -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 Program or any portion -of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -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 Program, 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 Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) 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; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, 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 executable. However, as a -special exception, the source code 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. - -If distribution of executable or 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 counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program 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. - - 5. 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 Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program 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 to -this License. - - 7. 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 Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program 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 Program. - -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. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program 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. - - 9. The Free Software Foundation may publish revised and/or new versions -of the 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 Program -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 Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, 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 - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), 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 Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. 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 program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/src/install/acquire/cabextract/ChangeLog b/src/install/acquire/cabextract/ChangeLog deleted file mode 100644 index 02c316c..0000000 --- a/src/install/acquire/cabextract/ChangeLog +++ /dev/null @@ -1,261 +0,0 @@ -2002-08-12 Stuart Caie - - * cabextract.c: now prints all errors and warnings to stderr - rather that stdout. I finally noticed that perror() prints to - stderr, and I want to follow suit. - -2002-08-11 Stuart Caie - - * extract_file(): now prints out the correct cabinet name in error - messages, in the case of files which are split over multiple - cabinet files and the 2nd or later split cabinet contains the - error. - - * QTMdecompress(): fixed the QTM decoding error - basically, Matthew - used the bitstream reading macros from my LZX decompressor. Sadly, - these macros can only guarantee at maximum 17 bits available in the - bit buffer, and Quantum uses up to 19 bits. I rewrote the Quantum - bit buffer macros to be multi-pass (and therefore slower) so they - can get the requisite number of bits. - - * QTMinit(): after fixing the decoding bug, I noticed that files - always failed extraction when going to a second folder. It turns out - - * configure.in: added limits.h to the list of checked includes - - * cabextract.c: ULONG_BITS now defined in terms of CHAR_BIT from - rather than fixed to 8 bits per char. Oddly, my system - seems to include rather than . So, for - people like me, I also define CHAR_BIT to be 8 if it's not already - defined. - -2002-07-29 Stuart Caie - - * cabextract.c: The Ministry of Sensible Naming dictates that - load_cab() be renamed find_cabs_in_file(), and lose the 'search' - argument. Calls to load_cab() where the search argument = 0 (i.e., - when loading spanning cabinets) be changed to load_cab_offset(x,0). - -2002-07-25 Stuart Caie - - * load_cab(): Bah! off_t is defined as a signed long int, and - not an unsigned long int as I had previously thought. This means the - 'valid cabinet' comparisions may fail. I have fixed this by making - these comparisons unsigned. - - * cabinfo.c: added the new search mechanism to cabinfo. - -2002-07-25 Stuart Caie - - * process_cabinet(): rewrote the loading mechanism. Uses the new - load_cab() to get a list of cabinets in the base file. Also does - bi-directional loading of spanning cabinets. - - * load_cab(): now takes a 'search' parameter. if search=0, the old - loading behaviour is performed, but if search=1, it now does the - exhaustive search for all matching cabinets and tries to load - them. If a load succeeds, it skips that section of the - file. Therefore, all embedded cabinets are found, yet most of the - file does not need to be searched. - - * cabinet_find_header(): removed, see above. Also, in shifting the - search, I altered the search mechanism. It now uses a state - machine to get around border cases, rather than the flaky 'save - the last 20 bytes and put them at the start the next time around'. - - * cabinet_read_entries(): now checks the MSCF signature, as there - is no longer a cabinet_find_header() to do this. - -2002-07-23 Stuart Caie - - * LZXdecompress(), QTMdecompress(): On systems where the LZ window - pointer is in "low memory", runsrc (window pointer - match offset) - could be below address 0, which wraps around to the end of memory, - so it appears runsrc is ahead of the LZ window, and so it does not - need 'fixing' before the match copy. Therefore the match data is - read from the incorrect, high address. Thanks to the NetBSD team - for discovering this and providing the patch. - -2002-07-22 Stuart Caie - - * file_close(): now honours your umask settings when extracting - files. Thanks to the NetBSD team for the patch. - - * cabinet_seek(), cabinet_skip(): these now print errors if - fseek() returns an error. - - * QTMdecompress(): finally! Added an implementation of the Quantum - method which was researched and written by Matthew Russoto. Many - thanks to him for all the hard work he did to produce this. I - tidied up the code to be more my style (and to be quite a bit - faster by inlining the bit buffer, H, L and C), but it's still all - his code running. - - * find_next_cabinet_file(): this is a new function which finds the - "next cabinet" by opening the directory it would be in and reading - each filename case-insensitively. It also handles any such "next - cabinets" with directory elements (delimited with MS-DOS - backslashes). - - * process_cabinet(): now uses find_next_cabinet_file() to get the - next cabinet file. This function also replaces the hack that gets - any directory path which might be embedded in the base cabinet - filename (as mentioned on the command line). - -2002-07-21 Stuart Caie - - * file_close(): fixed off-by-one error in setting the extracted - file date. Thanks to Claus Rasmussen. - -2002-07-20 Stuart Caie - - * file_open(): now removes any leading slashes from the name of - the file to be extracted. Thanks to the James Henstridge and - David Leonard for patches. - - * ensure_filepath(): now does not try to examine the directory "" - (i.e. no directory at all) if given an absolute path (one that - start with a slash). Thanks to the James Henstridge for the patch. - -2002-04-30 Stuart Caie - - * cabextract.spec.in: changed the fixed version number to @VERSION@ - -2002-04-06 Stuart Caie - - * Makefile.am, configure.in: used the guide no_getopt_long.txt - included with the gengetopt package to add getopt_long - configuration to cabextract. Hopefully it all works now. Thanks to - the many people who pointed out this problem and to the many - people who offered solutions. - -2001-09-06 Stuart Caie - - * Makefile.am, configure.in: made cabextract.spec one of the auto- - generated files. Now I can do 'make distcheck' here to build a - distribution which can be installed using 'rpm -tb - cabextract-0.6.tar.gz'. Thanks to Daniel Resare for the know-how. - -2001-08-20 Stuart Caie - - * Makefile.am: added an LDADD line for cabextract's LIBOBJS - generated by configure. This means the AC_REPLACE_FUNCS line - should actually have an effect. - - * configure.in: Removed getopt_long and mktime from the - AC_CHECK_FUNCS, as this is done anyway. - -2001-08-19 Stuart Caie - - * Makefile.am, configure.in, cabextract.c: moved the GNU getopt - sources to become an automatically added dependency if - getopt_long() can't be found in the standard library, just like - mktime() is handled. The getopt_long(), struct option and optarg - and optind definitions are taken from getopt.h if possible. If - they're not there, but getopt_long() was found with standard - includes files, it's assumed they're defined in the standard - include files. Otherwise, we define them ourselves. - - * cabextract.c: now gets VERSION defined from configure via - config.h. - - * decompress(): if the 'fix' option was used, the output buffer - would always be cleared before block decompression. A nice idea, - but the MSZIP method likes to keep the output buffer between - blocks. Thanks to Fernando Trias for spotting this. Stopped - clearing the output buffer. - - * main(): the 'fix' variable wasn't initialised to zero, so on - some architectures, where the stack-space allocated to the - variable isn't cleared to zero, you always got the 'fix' option - selected. See above for why this was bad. - - * process_cabinet(): now prints "Finished processing cabinet" when - finished extracting, instead of just a blank line. Still prints - blank lines for listing files. - -2001-08-05 Stuart Caie - - * Makefile.am: the manpage wasn't included in the distribution. - Fixed and re-issued the 0.3 release. - -2001-08-02 Stuart Caie - - * decompress(): now takes a 'fix' flag, which causes MSZIP errors - to be ignored. - - * cabinet_get_entries(): now keeps the printable information about - previous and next cabinet parts - - * process_cabinet(): now prints the printable information about - the next cabinet part in a multi-part cabinet - - * file_open(): now prepends a given directory if wanted, and can - make the filename lowercase if wanted. - - * main(): changed to using getopt_long to parse arguments. Added - -L (lowercase), -d (output to directory), -f (fix corrupt cabs), - -h (help), -q (quiet) and -v was recycled to become --version, - when used on its own. - - * LZXdecompress(): major bug fixed; the updated R0, R1 and R2 in - uncompressed blocks were being stored in the uncomp_state block, - not local variables. At the end of the function, the local values - are always written back to the uncomp_state block. So the values - placed there by the uncompressed block header were always - overwritten. Thanks to Pavel Turbin for providing an example of - this. - - * rindex(): this is the BSD precursor of the ANSI standard - function strrchr(). Oops! Now uses strrchr(), or rindex() if - strrchr() isn't available. - - * cabinet_find_header(): now prints an error message if it can't - find a header. - -2001-04-30 Stuart Caie - - * fixed includes to include both and if - they both exist, and made some signedness conversions explicit. - This should let cabextract compile with SGI's native - compiler. Thanks to Markus Nullmeier for the patch. - -2001-03-04 Stuart Caie - - * main(): now prints the version of cabextract in the copyright - line. - - * cabinet_find_header(): now searches any kind of file, not just - files beginning with 'MZ' header. Also, always searches entire - file. This slows the search down, but increases the usefulness of - the search overall, IMHO. Thanks to Eric Sharkey for pointing this - out. - - * LZXdecompress(): fixed problem in intel decoding: E8 must not - appear in the last 10 bytes, not the last 6 bytes... Thanks to Jae - Jung who pointed this out to me. I didn't believe him at first, - but he was quite right. Also thanks to Antoine Amanieux for - providing example files affected by this. - - * process_cabinet(): now extends multipart cabinet filenames to be - in the same directory as the base cabinet. - - * cabinet_open(): now only lowercases the filename part of a - cabinet name, not the path part. - -2001-03-03 Stuart Caie - - * LZXdecompress(): fixed LZX bit buffer exhaustion in where - READ_HUFFSYM() requests more bits than the buffer actually - contains: top-of-loop overflow check now allows for the input - pointer to be 16 bits past the end of the buffer, but checks to - ensure none of those 16 bits are actually used. Also increased - decomp_state.inbuf by two bytes and clear the two bytes after - loaded block in decompress(). Thanks to Jae Jung for pointing out - this bug, and for providing example files which exposed the bug. - -2001-02-26 Stuart Caie - - * added configure script / makefile using automake. - - * file_close(): now sets the timestamp on extracted files. diff --git a/src/install/acquire/cabextract/INSTALL b/src/install/acquire/cabextract/INSTALL deleted file mode 100644 index b42a17a..0000000 --- a/src/install/acquire/cabextract/INSTALL +++ /dev/null @@ -1,182 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. diff --git a/src/install/acquire/cabextract/Makefile.am b/src/install/acquire/cabextract/Makefile.am deleted file mode 100644 index a7fbd1c..0000000 --- a/src/install/acquire/cabextract/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AUTOMAKE_OPTIONS = no-dependencies -EXTRA_DIST = cabinfo.c mktime.c getopt.h \ - cabextract.1 debian ja cabextract.spec \ - cabextract.spec.in magic.cabinet - -bin_PROGRAMS = cabextract -man_MANS = cabextract.1 -cabextract_SOURCES = cabextract.c -cabextract_LDADD = @LIBOBJS@ - diff --git a/src/install/acquire/cabextract/Makefile.in b/src/install/acquire/cabextract/Makefile.in deleted file mode 100644 index 3d96c6f..0000000 --- a/src/install/acquire/cabextract/Makefile.in +++ /dev/null @@ -1,403 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -EXEEXT = @EXEEXT@ -MAKEINFO = @MAKEINFO@ -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -AUTOMAKE_OPTIONS = no-dependencies -EXTRA_DIST = cabinfo.c mktime.c getopt.h cabextract.1 debian ja cabextract.spec cabextract.spec.in magic.cabinet - - -bin_PROGRAMS = cabextract -man_MANS = cabextract.1 -cabextract_SOURCES = cabextract.c -cabextract_LDADD = @LIBOBJS@ -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = cabextract.spec -bin_PROGRAMS = cabextract$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -cabextract_OBJECTS = cabextract.o -cabextract_DEPENDENCIES = @LIBOBJS@ -cabextract_LDFLAGS = -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -man1dir = $(mandir)/man1 -MANS = $(man_MANS) - -NROFF = nroff -DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ -Makefile.am Makefile.in NEWS TODO aclocal.m4 cabextract.spec.in \ -config.h.in configure configure.in getopt.c getopt1.c install-sh \ -missing mkinstalldirs mktime.c - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -SOURCES = $(cabextract_SOURCES) -OBJECTS = $(cabextract_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): configure.in - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -config.h: stamp-h - @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ - else :; fi -stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=config.h \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.h.in: $(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: - -distclean-hdr: - -rm -f config.h - -maintainer-clean-hdr: -cabextract.spec: $(top_builddir)/config.status cabextract.spec.in - cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -mostlyclean-binPROGRAMS: - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -distclean-binPROGRAMS: - -maintainer-clean-binPROGRAMS: - -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - list='$(bin_PROGRAMS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ - done - -.c.o: - $(COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -cabextract$(EXEEXT): $(cabextract_OBJECTS) $(cabextract_DEPENDENCIES) - @rm -f cabextract$(EXEEXT) - $(LINK) $(cabextract_LDFLAGS) $(cabextract_OBJECTS) $(cabextract_LDADD) $(LIBS) - -install-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ - done - -uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ - done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -all-recursive-am: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: install-binPROGRAMS -install-exec: install-exec-am - -install-data-am: install-man -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-binPROGRAMS uninstall-man -uninstall: uninstall-am -all-am: Makefile $(PROGRAMS) $(MANS) config.h -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ - mostlyclean-compile mostlyclean-tags \ - mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ - distclean-tags distclean-generic clean-am - -distclean: distclean-am - -rm -f config.status - -maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ - maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -rm -f config.status - -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ -maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile install-man1 uninstall-man1 install-man \ -uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ -maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck all-recursive-am install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/install/acquire/cabextract/NEWS b/src/install/acquire/cabextract/NEWS deleted file mode 100644 index 1681fa7..0000000 --- a/src/install/acquire/cabextract/NEWS +++ /dev/null @@ -1,69 +0,0 @@ -New in 0.6: -* Quantum method is now supported! Many thanks to Matthew Russoto for this. -* Fixed more build problems on non-glibc systems. I have now followed the - 'FSF approved' method for including getopt_long, so hopefully Solaris - and all the other OSes won't have a problem building cabextract any - more. -* Japanese manual page included -- you will have to install the file - ja/cabextract.1 by yourself, it's not part of the install process. -* Now searches for spanning cabinet files in a case-insensitive way. It - also searches in both directions for spanned cabinets (each spanned - cabinet can include a 'previous' and 'next' cabinet filename), so you - can also specify a cabinet in the middle of a set and get the full set, - rather than have to work out what the first cabinet is. -* An off-by-one month error in file dates was fixed. -* Cabinets with files beginning with "/" (or rather, "\") no longer - extract to your root directory. -* A better embeded cabinet search algorithm was introduced for finding - those elusive cabinets in files and executables :) -* Now you can find more than one cabinet in a file (if there is - more than one to find), and it will be extracted or listed as normal. -* Files and directories created now honour your umask settings. -* Errors and warnings are now printed to stderr. - -New in 0.5: -* Fixed build problems on non-glibc systems. - -New in 0.4: -* Fixed a new bug I added by myself to 0.3... :) It corrupts all MS-ZIP - compressed cabinets after the first 32k, and it should be very obvious - that corruption has taken place. -* cabextract should be happier building on Cygwin and other such - architectures -- you should be able to "./configure; make; make install" - again. This was broken in 0.3 due to the getopt.c / getopt1.c weirdness - I copied from GNU hello. -* Now prints 'Finished processing cabinet.' after completing the extraction - a cabinet. - -New in 0.3: -* Fixed very rare, but invisible decrunching bug... if you have any - important things you extracted with cabextract, extract them again - to be sure they're not corrupt. -* cabextract now tells you if a file isn't a cabinet file. -* cabextract now goes on to the next file, if extracting one fails. -* cabextract now goes on to the next cabinet, if extracting one fails. -* cabextract lets you try to 'fix' some cabinets by skipping over bad - blocks rather than failing on them. If you have a corrupt cabinet, try - the '-f' option, and see how it goes. -* Use the new '-d dir' option to extract cabinets to a given directory. -* Use the new '-L' option to turn the extracted filenames to lowercase. -* Use the new '-q' option to be quiet while extracting archives. -* cabextract now prints more information while it's probing multi-part - cabinets - -New in 0.2: -* new even-easier installation: ./configure; make; make install -* Extracted files now have their timestamps set -* Fixed bug which occured when extracting tiny files -* Fixed completely invisible intel E8 decoding bug... if you have any - important things you extracted with cabextract, extract them again - to be sure they're not corrupt. -* cabinet search extended to look through *any* file for cabinets, not - just MS-DOS/Windows executables. -* Now looks for multipart cabinets in the same directory as the base cabinet. - This means you can do stuff like 'cd /tmp && cabextract /cdrom/part01.cab' - -New in 0.1: -* supports MSZIP and LZX compression methods -* supports split cabs and cabs embedded in executables -* initial release diff --git a/src/install/acquire/cabextract/README b/src/install/acquire/cabextract/README deleted file mode 100644 index 636df47..0000000 --- a/src/install/acquire/cabextract/README +++ /dev/null @@ -1,32 +0,0 @@ -cabextract 0.6 - a program to extract Microsoft Cabinet files. -(C) 2000-2002 Stuart Caie -This is free software with ABSOLUTELY NO WARRANTY. - -Cabinet (.CAB) files are a form of archive, which Microsoft use to -distribute their software, and things like Windows Font Packs. The -cabextract program simply unpacks such files. - -For more information, see http://www.kyz.uklinux.net/cabextract.php3 -or run the command 'cabextract --help'. - -Example usage: - -Extracting files from a cabinet file: -$ cabextract wibble.cab - -Extracting files from an executable which contains a cabinet file: -$ cabextract wibble.exe -[cabextract will automatically search executables for embedded cabinets] - -Extracting files from a set of cabinet files; wib01.cab, wib02.cab, ...: -$ cabextract wib01.cab -[cabextract will automatically get the names of the other files] - -Extracting files to a directory of your choice (in this case, 'boogie'): -$ cabextract -d boogie wibble.cab -[cabextract will create the directory if it does not already exist] - -Listing files from a cabinet file: -$ cabextract -l wibble.cab - -Stuart Caie , 12 August 2002. diff --git a/src/install/acquire/cabextract/TODO b/src/install/acquire/cabextract/TODO deleted file mode 100644 index 8b7e024..0000000 --- a/src/install/acquire/cabextract/TODO +++ /dev/null @@ -1 +0,0 @@ -Nothing planned. diff --git a/src/install/acquire/cabextract/aclocal.m4 b/src/install/acquire/cabextract/aclocal.m4 deleted file mode 100644 index 5560342..0000000 --- a/src/install/acquire/cabextract/aclocal.m4 +++ /dev/null @@ -1,127 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "[$]2" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - diff --git a/src/install/acquire/cabextract/cabextract.1 b/src/install/acquire/cabextract/cabextract.1 deleted file mode 100644 index 8811128..0000000 --- a/src/install/acquire/cabextract/cabextract.1 +++ /dev/null @@ -1,60 +0,0 @@ -.TH CABEXTRACT 1 "August 2, 2001" -.SH NAME -cabextract \- program to extract files from Microsoft cabinet (.cab) archives -.SH SYNOPSIS -.B cabextract -.RB [ -v ] -.RB [ -h ] -.RB [ -l ] -.RB [ -q ] -.RB [ -L ] -.RB [ -f ] -.RB [ -d \fIdir\fP ] -.I " cabinet files" ... -.SH DESCRIPTION -.B cabextract -is a program that un-archives files in the -Microsoft cabinet file format (.cab) or any binary file which contains -an embedded cabinet file (frequently found in .exe files). -.PP -.B cabextract -will extract all files from all cabinet files specified on the command line -.PP -To extract a multi\-part cabinet consisting of several -files, only give the -.I first -file as an argument to -.B cabextract -as it will automatically look for the remaining files. -.SH OPTIONS -A summary of options is included below. -.TP -.B \-v -If given alone on the command line, prints the version of -.B cabextract -and exits. Given with a list of cabinet files, it will list the contents -of the cabinet files. -.TP -.B \-h -Prints a page of help and exits. -.TP -.B \-l -Lists the contents of the given cabinet files, rather than extracting them. -.TP -.B \-q -When extracting cabinet files, supresses all messages except errors and -warnings. -.TP -.B \-L -When extracting cabinet files, makes each extracted file's name lowercase. -.TP -.B \-f -When extracting cabinet files, will ignore corrupted MSZIP blocks. A warning -will be printed if a corrupted MSZIP block is encountered. -.TP -.B \-d \fIdir\fP -Extracts all files into the directory \fIdir\fP . -.SH AUTHOR -This manual page was written by Stuart Caie , based on -the one written by Eric Sharkey , for the Debian -GNU/Linux system. diff --git a/src/install/acquire/cabextract/cabextract.c b/src/install/acquire/cabextract/cabextract.c deleted file mode 100644 index ade7d8c..0000000 --- a/src/install/acquire/cabextract/cabextract.c +++ /dev/null @@ -1,3033 +0,0 @@ -/* cabextract 0.6 - a program to extract Microsoft Cabinet files - * (C) 2000-2002 Stuart Caie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* This is NOT a general purpose cabinet library with a front end tacked - * on. If you want a comprehensive library to read and write cabinet - * files, please get "libcabinet". If you want to create CAB files on UNIX - * systems, get "Cablinux". - * - * Get the official Microsoft CAB SDK from here: - * http://msdn.microsoft.com/workshop/management/cab/cab-sdk.exe - * You can use cabextract on this file to extract the contents. - * - * Many thanks to Dirk Stoecker, Matthew Russoto and Dave Tritscher and, - * of course, Microsoft for the documentation they _did_ provide wholly - * and accurately. MSZIP is a one-byte adaption of the deflate and inflate - * methods created by Phil Katz. Quantum is based on the Quantum archiver, - * created by David Stafford. LZX is an adaption of the LZX method created - * by Jonathan Forbes and Tomi Poutanen. - * - * Furthermore, thanks to Jae Jung, for single-handedly fixing all the - * bugs with LZX decompression in cabextract 0.1, and Eric Sharkey for the - * original manual page. - */ - -/* CAB files are 'cabinets'. 'Folders' store compressed data, and may span - * several cabinets. 'Files' live as data inside a folder when - * uncompressed. EOR checksums are used instead of CRCs. Four compression - * formats are known - NONE, MSZIP, QUANTUM and LZX. NONE is obviously - * uncompressed data. MSZIP is simply PKZIP's deflate/inflate algorithims - * with 'CK' as a signature instead of 'PK'. QUANTUM is an LZ77 + - * arithmetic coding method. LZX is a much loved LZH based archiver in the - * Amiga world, the algorithm taken (bought?) by Microsoft and tweaked for - * Intel code. - */ - -#ifdef HAVE_CONFIG_H -#include - -#include /* everyone has this! */ - -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#ifdef HAVE_CTYPE_H -# include -#endif - -#ifdef HAVE_LIMITS_H -# include -#endif - -#ifdef HAVE_STDLIB_H -# include -#endif - -#ifdef HAVE_STRING_H -# include -#endif - -#ifdef HAVE_STRINGS_H -# include -#endif - -#ifdef HAVE_SYS_STAT_H -# include -#endif - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#ifdef HAVE_UTIME_H -# include -#endif - -#if HAVE_DIRENT_H -# include -#else -# define dirent direct -# if HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -#endif - -#if !STDC_HEADERS -# if !HAVE_STRCHR -# define strchr index -# define strrchr rindex -# endif -# if !HAVE_STRCASECMP -# define strcasecmp strcmpi -# endif -# if !HAVE_MEMCPY -# define memcpy(d,,n) bcopy((s),(d),(n) -# endif -#endif - -#ifndef HAVE_MKTIME -extern time_t mktime(struct tm *tp); -#endif - -#include "getopt.h" - -#else /* !HAVE_CONFIG_H */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "getopt.h" -#define VERSION "x.x" - -#endif - -#ifdef DEBUG -# define D(x) printf x ; -#else -# define D(x) -#endif - - -typedef unsigned char UBYTE; /* 8 bits exactly */ -typedef unsigned short UWORD; /* 16 bits (or more) */ -typedef unsigned int ULONG; /* 32 bits (or more) */ -typedef signed int LONG; /* 32 bits (or more) */ - -/* number of bits in a ULONG */ -#ifndef CHAR_BIT -# define CHAR_BIT (8) -#endif -#define ULONG_BITS (sizeof(ULONG) * CHAR_BIT) - -/* endian-neutral reading of little-endian data */ -#define EndGetI32(a) ((((a)[3])<<24)|(((a)[2])<<16)|(((a)[1])<<8)|((a)[0])) -#define EndGetI16(a) ((((a)[1])<<8)|((a)[0])) - -/* maximum number of cabinets any one folder can be split across */ -#define CAB_SPLITMAX (10) - -struct cabinet { - struct cabinet *next; /* for making a list of cabinets */ - char *filename; /* input name of cabinet */ - FILE *fh; /* open file handle or NULL */ - off_t filelen; /* length of cabinet file */ - off_t blocks_off; /* offset to data blocks in file */ - struct cabinet *prevcab, *nextcab; /* multipart cabinet chains */ - char *prevname, *nextname; /* and their filenames */ - char *previnfo, *nextinfo; /* and their visible names */ - struct folder *folders; /* first folder in this cabinet */ - struct file *files; /* first file in this cabinet */ - UBYTE block_resv; /* reserved space in datablocks */ - UBYTE flags; /* header flags */ -}; - -struct folder { - struct folder *next; - struct cabinet *cab[CAB_SPLITMAX]; /* cabinet(s) this folder spans */ - off_t offset[CAB_SPLITMAX]; /* offset to data blocks */ - UWORD comp_type; /* compression format/window size */ - ULONG comp_size; /* compressed size of folder */ - UBYTE num_splits; /* number of split blocks + 1 */ - UWORD num_blocks; /* total number of blocks */ - struct file *contfile; /* the first split file */ -}; - -struct file { - struct file *next; /* next file in sequence */ - struct folder *folder; /* folder that contains this file */ - char *filename; /* output name of file */ - FILE *fh; /* open file handle or NULL */ - ULONG length; /* uncompressed length of file */ - ULONG offset; /* uncompressed offset in folder */ - UWORD index; /* magic index number of folder */ - UWORD time, date, attribs; /* MS-DOS time/date/attributes */ -}; - - -/* structure offsets */ -#define cfhead_Signature (0x00) -#define cfhead_CabinetSize (0x08) -#define cfhead_FileOffset (0x10) -#define cfhead_MinorVersion (0x18) -#define cfhead_MajorVersion (0x19) -#define cfhead_NumFolders (0x1A) -#define cfhead_NumFiles (0x1C) -#define cfhead_Flags (0x1E) -#define cfhead_SetID (0x20) -#define cfhead_CabinetIndex (0x22) -#define cfhead_SIZEOF (0x24) -#define cfheadext_HeaderReserved (0x00) -#define cfheadext_FolderReserved (0x02) -#define cfheadext_DataReserved (0x03) -#define cfheadext_SIZEOF (0x04) -#define cffold_DataOffset (0x00) -#define cffold_NumBlocks (0x04) -#define cffold_CompType (0x06) -#define cffold_SIZEOF (0x08) -#define cffile_UncompressedSize (0x00) -#define cffile_FolderOffset (0x04) -#define cffile_FolderIndex (0x08) -#define cffile_Date (0x0A) -#define cffile_Time (0x0C) -#define cffile_Attribs (0x0E) -#define cffile_SIZEOF (0x10) -#define cfdata_CheckSum (0x00) -#define cfdata_CompressedSize (0x04) -#define cfdata_UncompressedSize (0x06) -#define cfdata_SIZEOF (0x08) - -/* flags */ -#define cffoldCOMPTYPE_MASK (0x000f) -#define cffoldCOMPTYPE_NONE (0x0000) -#define cffoldCOMPTYPE_MSZIP (0x0001) -#define cffoldCOMPTYPE_QUANTUM (0x0002) -#define cffoldCOMPTYPE_LZX (0x0003) -#define cfheadPREV_CABINET (0x0001) -#define cfheadNEXT_CABINET (0x0002) -#define cfheadRESERVE_PRESENT (0x0004) -#define cffileCONTINUED_FROM_PREV (0xFFFD) -#define cffileCONTINUED_TO_NEXT (0xFFFE) -#define cffileCONTINUED_PREV_AND_NEXT (0xFFFF) -#define cffile_A_RDONLY (0x01) -#define cffile_A_HIDDEN (0x02) -#define cffile_A_SYSTEM (0x04) -#define cffile_A_ARCH (0x20) -#define cffile_A_EXEC (0x40) -#define cffile_A_NAME_IS_UTF (0x80) - - -/*--------------------------------------------------------------------------*/ -/* our archiver information / state */ - -/* MSZIP stuff */ -#define ZIPWSIZE 0x8000 /* window size */ -#define ZIPLBITS 9 /* bits in base literal/length lookup table */ -#define ZIPDBITS 6 /* bits in base distance lookup table */ -#define ZIPBMAX 16 /* maximum bit length of any code */ -#define ZIPN_MAX 288 /* maximum number of codes in any set */ - -struct Ziphuft { - UBYTE e; /* number of extra bits or operation */ - UBYTE b; /* number of bits in this code or subcode */ - union { - UWORD n; /* literal, length base, or distance base */ - struct Ziphuft *t; /* pointer to next level of table */ - } v; -}; - -struct ZIPstate { - ULONG window_posn; /* current offset within the window */ - ULONG bb; /* bit buffer */ - ULONG bk; /* bits in bit buffer */ - ULONG ll[288+32]; /* literal/length and distance code lengths */ - ULONG c[ZIPBMAX+1]; /* bit length count table */ - LONG lx[ZIPBMAX+1]; /* memory for l[-1..ZIPBMAX-1] */ - struct Ziphuft *u[ZIPBMAX]; /* table stack */ - ULONG v[ZIPN_MAX]; /* values in order of bit length */ - ULONG x[ZIPBMAX+1]; /* bit offsets, then code stack */ - UBYTE *inpos; -}; - -/* Quantum stuff */ - -struct QTMmodelsym { - UWORD sym, cumfreq; -}; - -struct QTMmodel { - int shiftsleft, entries; - struct QTMmodelsym *syms; - UWORD tabloc[256]; -}; - -struct QTMstate { - UBYTE *window; /* the actual decoding window */ - ULONG window_size; /* window size (1Kb through 2Mb) */ - ULONG actual_size; /* window size when it was first allocated */ - ULONG window_posn; /* current offset within the window */ - - struct QTMmodel model7; - struct QTMmodelsym m7sym[7+1]; - - struct QTMmodel model4, model5, model6pos, model6len; - struct QTMmodelsym m4sym[0x18 + 1]; - struct QTMmodelsym m5sym[0x24 + 1]; - struct QTMmodelsym m6psym[0x2a + 1], m6lsym[0x1b + 1]; - - struct QTMmodel model00, model40, model80, modelC0; - struct QTMmodelsym m00sym[0x40 + 1], m40sym[0x40 + 1]; - struct QTMmodelsym m80sym[0x40 + 1], mC0sym[0x40 + 1]; -}; - -/* LZX stuff */ - -/* some constants defined by the LZX specification */ -#define LZX_MIN_MATCH (2) -#define LZX_MAX_MATCH (257) -#define LZX_NUM_CHARS (256) -#define LZX_BLOCKTYPE_INVALID (0) /* also blocktypes 4-7 invalid */ -#define LZX_BLOCKTYPE_VERBATIM (1) -#define LZX_BLOCKTYPE_ALIGNED (2) -#define LZX_BLOCKTYPE_UNCOMPRESSED (3) -#define LZX_PRETREE_NUM_ELEMENTS (20) -#define LZX_ALIGNED_NUM_ELEMENTS (8) /* aligned offset tree #elements */ -#define LZX_NUM_PRIMARY_LENGTHS (7) /* this one missing from spec! */ -#define LZX_NUM_SECONDARY_LENGTHS (249) /* length tree #elements */ - -/* LZX huffman defines: tweak tablebits as desired */ -#define LZX_PRETREE_MAXSYMBOLS (LZX_PRETREE_NUM_ELEMENTS) -#define LZX_PRETREE_TABLEBITS (6) -#define LZX_MAINTREE_MAXSYMBOLS (LZX_NUM_CHARS + 50*8) -#define LZX_MAINTREE_TABLEBITS (12) -#define LZX_LENGTH_MAXSYMBOLS (LZX_NUM_SECONDARY_LENGTHS+1) -#define LZX_LENGTH_TABLEBITS (12) -#define LZX_ALIGNED_MAXSYMBOLS (LZX_ALIGNED_NUM_ELEMENTS) -#define LZX_ALIGNED_TABLEBITS (7) - -#define LZX_LENTABLE_SAFETY (64) /* we allow length table decoding overruns */ - -#define LZX_DECLARE_TABLE(tbl) \ - UWORD tbl##_table[(1<>=(n);k-=(n);} - -void Ziphuft_free(struct Ziphuft *t) -{ - register struct Ziphuft *p, *q; - - /* Go through linked list, freeing from the allocated (t[-1]) address. */ - p = t; - while (p != (struct Ziphuft *)NULL) - { - q = (--p)->v.t; - free(p); - p = q; - } -} - -LONG Ziphuft_build(ULONG *b, ULONG n, ULONG s, UWORD *d, UWORD *e, -struct Ziphuft **t, LONG *m) -{ - ULONG a; /* counter for codes of length k */ - ULONG el; /* length of EOB code (value 256) */ - ULONG f; /* i repeats in table every f entries */ - LONG g; /* maximum code length */ - LONG h; /* table level */ - register ULONG i; /* counter, current code */ - register ULONG j; /* counter */ - register LONG k; /* number of bits in current code */ - LONG *l; /* stack of bits per table */ - register ULONG *p; /* pointer into ZIP(c)[],ZIP(b)[],ZIP(v)[] */ - register struct Ziphuft *q; /* points to current table */ - struct Ziphuft r; /* table entry for structure assignment */ - register LONG w; /* bits before this table == (l * h) */ - ULONG *xp; /* pointer into x */ - LONG y; /* number of dummy codes added */ - ULONG z; /* number of entries in current table */ - - l = ZIP(lx)+1; - - /* Generate counts for each bit length */ - el = n > 256 ? b[256] : ZIPBMAX; /* set length of EOB code, if any */ - - for(i = 0; i < ZIPBMAX+1; ++i) - ZIP(c)[i] = 0; - p = b; i = n; - do - { - ZIP(c)[*p]++; p++; /* assume all entries <= ZIPBMAX */ - } while (--i); - if (ZIP(c)[0] == n) /* null input--all zero length codes */ - { - *t = (struct Ziphuft *)NULL; - *m = 0; - return 0; - } - - /* Find minimum and maximum length, bound *m by those */ - for (j = 1; j <= ZIPBMAX; j++) - if (ZIP(c)[j]) - break; - k = j; /* minimum code length */ - if ((ULONG)*m < j) - *m = j; - for (i = ZIPBMAX; i; i--) - if (ZIP(c)[i]) - break; - g = i; /* maximum code length */ - if ((ULONG)*m > i) - *m = i; - - /* Adjust last length count to fill out codes, if needed */ - for (y = 1 << j; j < i; j++, y <<= 1) - if ((y -= ZIP(c)[j]) < 0) - return 2; /* bad input: more codes than bits */ - if ((y -= ZIP(c)[i]) < 0) - return 2; - ZIP(c)[i] += y; - - /* Generate starting offsets LONGo the value table for each length */ - ZIP(x)[1] = j = 0; - p = ZIP(c) + 1; xp = ZIP(x) + 2; - while (--i) - { /* note that i == g from above */ - *xp++ = (j += *p++); - } - - /* Make a table of values in order of bit lengths */ - p = b; i = 0; - do{ - if ((j = *p++) != 0) - ZIP(v)[ZIP(x)[j]++] = i; - } while (++i < n); - - - /* Generate the Huffman codes and for each, make the table entries */ - ZIP(x)[0] = i = 0; /* first Huffman code is zero */ - p = ZIP(v); /* grab values in bit order */ - h = -1; /* no tables yet--level -1 */ - w = l[-1] = 0; /* no bits decoded yet */ - ZIP(u)[0] = (struct Ziphuft *)NULL; /* just to keep compilers happy */ - q = (struct Ziphuft *)NULL; /* ditto */ - z = 0; /* ditto */ - - /* go through the bit lengths (k already is bits in shortest code) */ - for (; k <= g; k++) - { - a = ZIP(c)[k]; - while (a--) - { - /* here i is the Huffman code of length k bits for value *p */ - /* make tables up to required level */ - while (k > w + l[h]) - { - w += l[h++]; /* add bits already decoded */ - - /* compute minimum size table less than or equal to *m bits */ - z = (z = g - w) > (ULONG)*m ? *m : z; /* upper limit */ - if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ - { /* too few codes for k-w bit table */ - f -= a + 1; /* deduct codes from patterns left */ - xp = ZIP(c) + k; - while (++j < z) /* try smaller tables up to z bits */ - { - if ((f <<= 1) <= *++xp) - break; /* enough codes to use up j bits */ - f -= *xp; /* else deduct codes from patterns */ - } - } - if ((ULONG)w + j > el && (ULONG)w < el) - j = el - w; /* make EOB code end at table */ - z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ - - /* allocate and link in new table */ - if (!(q = (struct Ziphuft *) malloc((z + 1)*sizeof(struct Ziphuft)))) - { - if(h) - Ziphuft_free(ZIP(u)[0]); - return 3; /* not enough memory */ - } - *t = q + 1; /* link to list for Ziphuft_free() */ - *(t = &(q->v.t)) = (struct Ziphuft *)NULL; - ZIP(u)[h] = ++q; /* table starts after link */ - - /* connect to last table, if there is one */ - if (h) - { - ZIP(x)[h] = i; /* save pattern for backing up */ - r.b = (UBYTE)l[h-1]; /* bits to dump before this table */ - r.e = (UBYTE)(16 + j); /* bits in this table */ - r.v.t = q; /* pointer to this table */ - j = (i & ((1 << w) - 1)) >> (w - l[h-1]); - ZIP(u)[h-1][j] = r; /* connect to last table */ - } - } - - /* set up table entry in r */ - r.b = (UBYTE)(k - w); - if (p >= ZIP(v) + n) - r.e = 99; /* out of values--invalid code */ - else if (*p < s) - { - r.e = (UBYTE)(*p < 256 ? 16 : 15); /* 256 is end-of-block code */ - r.v.n = *p++; /* simple code is just the value */ - } - else - { - r.e = (UBYTE)e[*p - s]; /* non-simple--look up in lists */ - r.v.n = d[*p++ - s]; - } - - /* fill code-like entries with r */ - f = 1 << (k - w); - for (j = i >> w; j < z; j += f) - q[j] = r; - - /* backwards increment the k-bit code i */ - for (j = 1 << (k - 1); i & j; j >>= 1) - i ^= j; - i ^= j; - - /* backup over finished tables */ - while ((i & ((1 << w) - 1)) != ZIP(x)[h]) - w -= l[--h]; /* don't need to update q */ - } - } - - /* return actual size of base table */ - *m = l[0]; - - /* Return true (1) if we were given an incomplete table */ - return y != 0 && g != 1; -} - -LONG Zipinflate_codes(struct Ziphuft *tl, struct Ziphuft *td, -LONG bl, LONG bd) -{ - register ULONG e; /* table entry flag/number of extra bits */ - ULONG n, d; /* length and index for copy */ - ULONG w; /* current window position */ - struct Ziphuft *t; /* pointer to table entry */ - ULONG ml, md; /* masks for bl and bd bits */ - register ULONG b; /* bit buffer */ - register ULONG k; /* number of bits in bit buffer */ - - /* make local copies of globals */ - b = ZIP(bb); /* initialize bit buffer */ - k = ZIP(bk); - w = ZIP(window_posn); /* initialize window position */ - - /* inflate the coded data */ - ml = Zipmask[bl]; /* precompute masks for speed */ - md = Zipmask[bd]; - - for(;;) - { - ZIPNEEDBITS((ULONG)bl) - if((e = (t = tl + ((ULONG)b & ml))->e) > 16) - do - { - if (e == 99) - return 1; - ZIPDUMPBITS(t->b) - e -= 16; - ZIPNEEDBITS(e) - } while ((e = (t = t->v.t + ((ULONG)b & Zipmask[e]))->e) > 16); - ZIPDUMPBITS(t->b) - if (e == 16) /* then it's a literal */ - CAB(outbuf)[w++] = (UBYTE)t->v.n; - else /* it's an EOB or a length */ - { - /* exit if end of block */ - if(e == 15) - break; - - /* get length of block to copy */ - ZIPNEEDBITS(e) - n = t->v.n + ((ULONG)b & Zipmask[e]); - ZIPDUMPBITS(e); - - /* decode distance of block to copy */ - ZIPNEEDBITS((ULONG)bd) - if ((e = (t = td + ((ULONG)b & md))->e) > 16) - do { - if (e == 99) - return 1; - ZIPDUMPBITS(t->b) - e -= 16; - ZIPNEEDBITS(e) - } while ((e = (t = t->v.t + ((ULONG)b & Zipmask[e]))->e) > 16); - ZIPDUMPBITS(t->b) - ZIPNEEDBITS(e) - d = w - t->v.n - ((ULONG)b & Zipmask[e]); - ZIPDUMPBITS(e) - do - { - n -= (e = (e = ZIPWSIZE - ((d &= ZIPWSIZE-1) > w ? d : w)) > n ?n:e); - do - { - CAB(outbuf)[w++] = CAB(outbuf)[d++]; - } while (--e); - } while (n); - } - } - - /* restore the globals from the locals */ - ZIP(window_posn) = w; /* restore global window pointer */ - ZIP(bb) = b; /* restore global bit buffer */ - ZIP(bk) = k; - - /* done */ - return 0; -} - -LONG Zipinflate_stored(void) -/* "decompress" an inflated type 0 (stored) block. */ -{ - ULONG n; /* number of bytes in block */ - ULONG w; /* current window position */ - register ULONG b; /* bit buffer */ - register ULONG k; /* number of bits in bit buffer */ - - /* make local copies of globals */ - b = ZIP(bb); /* initialize bit buffer */ - k = ZIP(bk); - w = ZIP(window_posn); /* initialize window position */ - - /* go to byte boundary */ - n = k & 7; - ZIPDUMPBITS(n); - - /* get the length and its complement */ - ZIPNEEDBITS(16) - n = ((ULONG)b & 0xffff); - ZIPDUMPBITS(16) - ZIPNEEDBITS(16) - if (n != (ULONG)((~b) & 0xffff)) - return 1; /* error in compressed data */ - ZIPDUMPBITS(16) - - /* read and output the compressed data */ - while(n--) - { - ZIPNEEDBITS(8) - CAB(outbuf)[w++] = (UBYTE)b; - ZIPDUMPBITS(8) - } - - /* restore the globals from the locals */ - ZIP(window_posn) = w; /* restore global window pointer */ - ZIP(bb) = b; /* restore global bit buffer */ - ZIP(bk) = k; - return 0; -} - -LONG Zipinflate_fixed(void) -{ - struct Ziphuft *fixed_tl; - struct Ziphuft *fixed_td; - LONG fixed_bl, fixed_bd; - LONG i; /* temporary variable */ - ULONG *l; - - l = ZIP(ll); - - /* literal table */ - for(i = 0; i < 144; i++) - l[i] = 8; - for(; i < 256; i++) - l[i] = 9; - for(; i < 280; i++) - l[i] = 7; - for(; i < 288; i++) /* make a complete, but wrong code set */ - l[i] = 8; - fixed_bl = 7; - if((i = Ziphuft_build(l, 288, 257, (UWORD *) Zipcplens, - (UWORD *) Zipcplext, &fixed_tl, &fixed_bl))) - return i; - - /* distance table */ - for(i = 0; i < 30; i++) /* make an incomplete code set */ - l[i] = 5; - fixed_bd = 5; - if((i = Ziphuft_build(l, 30, 0, (UWORD *) Zipcpdist, (UWORD *) Zipcpdext, - &fixed_td, &fixed_bd)) > 1) - { - Ziphuft_free(fixed_tl); - return i; - } - - /* decompress until an end-of-block code */ - i = Zipinflate_codes(fixed_tl, fixed_td, fixed_bl, fixed_bd); - - Ziphuft_free(fixed_td); - Ziphuft_free(fixed_tl); - return i; -} - -LONG Zipinflate_dynamic(void) - /* decompress an inflated type 2 (dynamic Huffman codes) block. */ -{ - LONG i; /* temporary variables */ - ULONG j; - ULONG *ll; - ULONG l; /* last length */ - ULONG m; /* mask for bit lengths table */ - ULONG n; /* number of lengths to get */ - struct Ziphuft *tl; /* literal/length code table */ - struct Ziphuft *td; /* distance code table */ - LONG bl; /* lookup bits for tl */ - LONG bd; /* lookup bits for td */ - ULONG nb; /* number of bit length codes */ - ULONG nl; /* number of literal/length codes */ - ULONG nd; /* number of distance codes */ - register ULONG b; /* bit buffer */ - register ULONG k; /* number of bits in bit buffer */ - - /* make local bit buffer */ - b = ZIP(bb); - k = ZIP(bk); - ll = ZIP(ll); - - /* read in table lengths */ - ZIPNEEDBITS(5) - nl = 257 + ((ULONG)b & 0x1f); /* number of literal/length codes */ - ZIPDUMPBITS(5) - ZIPNEEDBITS(5) - nd = 1 + ((ULONG)b & 0x1f); /* number of distance codes */ - ZIPDUMPBITS(5) - ZIPNEEDBITS(4) - nb = 4 + ((ULONG)b & 0xf); /* number of bit length codes */ - ZIPDUMPBITS(4) - if(nl > 288 || nd > 32) - return 1; /* bad lengths */ - - /* read in bit-length-code lengths */ - for(j = 0; j < nb; j++) - { - ZIPNEEDBITS(3) - ll[Zipborder[j]] = (ULONG)b & 7; - ZIPDUMPBITS(3) - } - for(; j < 19; j++) - ll[Zipborder[j]] = 0; - - /* build decoding table for trees--single level, 7 bit lookup */ - bl = 7; - if((i = Ziphuft_build(ll, 19, 19, NULL, NULL, &tl, &bl)) != 0) - { - if(i == 1) - Ziphuft_free(tl); - return i; /* incomplete code set */ - } - - /* read in literal and distance code lengths */ - n = nl + nd; - m = Zipmask[bl]; - i = l = 0; - while((ULONG)i < n) - { - ZIPNEEDBITS((ULONG)bl) - j = (td = tl + ((ULONG)b & m))->b; - ZIPDUMPBITS(j) - j = td->v.n; - if (j < 16) /* length of code in bits (0..15) */ - ll[i++] = l = j; /* save last length in l */ - else if (j == 16) /* repeat last length 3 to 6 times */ - { - ZIPNEEDBITS(2) - j = 3 + ((ULONG)b & 3); - ZIPDUMPBITS(2) - if((ULONG)i + j > n) - return 1; - while (j--) - ll[i++] = l; - } - else if (j == 17) /* 3 to 10 zero length codes */ - { - ZIPNEEDBITS(3) - j = 3 + ((ULONG)b & 7); - ZIPDUMPBITS(3) - if ((ULONG)i + j > n) - return 1; - while (j--) - ll[i++] = 0; - l = 0; - } - else /* j == 18: 11 to 138 zero length codes */ - { - ZIPNEEDBITS(7) - j = 11 + ((ULONG)b & 0x7f); - ZIPDUMPBITS(7) - if ((ULONG)i + j > n) - return 1; - while (j--) - ll[i++] = 0; - l = 0; - } - } - - /* free decoding table for trees */ - Ziphuft_free(tl); - - /* restore the global bit buffer */ - ZIP(bb) = b; - ZIP(bk) = k; - - /* build the decoding tables for literal/length and distance codes */ - bl = ZIPLBITS; - if((i = Ziphuft_build(ll, nl, 257, (UWORD *) Zipcplens, (UWORD *) Zipcplext, &tl, &bl)) != 0) - { - if(i == 1) - Ziphuft_free(tl); - return i; /* incomplete code set */ - } - bd = ZIPDBITS; - Ziphuft_build(ll + nl, nd, 0, (UWORD *) Zipcpdist, (UWORD *) Zipcpdext, &td, &bd); - - /* decompress until an end-of-block code */ - if(Zipinflate_codes(tl, td, bl, bd)) - return 1; - - /* free the decoding tables, return */ - Ziphuft_free(tl); - Ziphuft_free(td); - return 0; -} - -LONG Zipinflate_block(LONG *e) /* e == last block flag */ -{ /* decompress an inflated block */ - ULONG t; /* block type */ - register ULONG b; /* bit buffer */ - register ULONG k; /* number of bits in bit buffer */ - - /* make local bit buffer */ - b = ZIP(bb); - k = ZIP(bk); - - /* read in last block bit */ - ZIPNEEDBITS(1) - *e = (LONG)b & 1; - ZIPDUMPBITS(1) - - /* read in block type */ - ZIPNEEDBITS(2) - t = (ULONG)b & 3; - ZIPDUMPBITS(2) - - /* restore the global bit buffer */ - ZIP(bb) = b; - ZIP(bk) = k; - - /* inflate that block type */ - if(t == 2) - return Zipinflate_dynamic(); - if(t == 0) - return Zipinflate_stored(); - if(t == 1) - return Zipinflate_fixed(); - /* bad block type */ - return 2; -} - -int ZIPdecompress(int inlen, int outlen) -{ - LONG e; /* last block flag */ - - ZIP(inpos) = CAB(inbuf); - ZIP(bb) = ZIP(bk) = ZIP(window_posn) = 0; - if(outlen > ZIPWSIZE) - return DECR_DATAFORMAT; - - /* CK = Chris Kirmse, official Microsoft purloiner */ - if(ZIP(inpos)[0] != 0x43 || ZIP(inpos)[1] != 0x4B) - return DECR_ILLEGALDATA; - ZIP(inpos) += 2; - - do - { - if(Zipinflate_block(&e)) - return DECR_ILLEGALDATA; - } while(!e); - - /* return success */ - return DECR_OK; -} - -/* Quantum decruncher */ - -/* This decruncher was researched and implemented by Matthew Russoto. */ -/* It has since been tidied up by Stuart Caie */ - -static UBYTE q_length_base[27], q_length_extra[27], q_extra_bits[42]; -static ULONG q_position_base[42]; - -/* Initialise a model which decodes symbols from [s] to [s]+[n]-1 */ -void QTMinitmodel(struct QTMmodel *m, struct QTMmodelsym *sym, int n, int s) { - int i; - m->shiftsleft = 4; - m->entries = n; - m->syms = sym; - memset(m->tabloc, 0xFF, sizeof(m->tabloc)); /* clear out look-up table */ - for (i = 0; i < n; i++) { - m->tabloc[i+s] = i; /* set up a look-up entry for symbol */ - m->syms[i].sym = i+s; /* actual symbol */ - m->syms[i].cumfreq = n-i; /* current frequency of that symbol */ - } - m->syms[n].cumfreq = 0; -} - -int QTMinit(int window, int level) { - int wndsize = 1 << window, msz = window * 2, i; - ULONG j; - - /* QTM supports window sizes of 2^10 (1Kb) through 2^21 (2Mb) */ - /* if a previously allocated window is big enough, keep it */ - if (window < 10 || window > 21) return DECR_DATAFORMAT; - if (QTM(actual_size) < wndsize) { - if (QTM(window)) free(QTM(window)); - QTM(window) = NULL; - } - if (!QTM(window)) { - if (!(QTM(window) = malloc(wndsize))) return DECR_NOMEMORY; - QTM(actual_size) = wndsize; - } - QTM(window_size) = wndsize; - QTM(window_posn) = 0; - - /* initialise static slot/extrabits tables */ - for (i = 0, j = 0; i < 27; i++) { - q_length_extra[i] = (i == 26) ? 0 : (i < 2 ? 0 : i - 2) >> 2; - q_length_base[i] = j; j += 1 << ((i == 26) ? 5 : q_length_extra[i]); - } - for (i = 0, j = 0; i < 42; i++) { - q_extra_bits[i] = (i < 2 ? 0 : i-2) >> 1; - q_position_base[i] = j; j += 1 << q_extra_bits[i]; - } - - /* initialise arithmetic coding models */ - - QTMinitmodel(&QTM(model7), &QTM(m7sym)[0], 7, 0); - - QTMinitmodel(&QTM(model00), &QTM(m00sym)[0], 0x40, 0x00); - QTMinitmodel(&QTM(model40), &QTM(m40sym)[0], 0x40, 0x40); - QTMinitmodel(&QTM(model80), &QTM(m80sym)[0], 0x40, 0x80); - QTMinitmodel(&QTM(modelC0), &QTM(mC0sym)[0], 0x40, 0xC0); - - /* model 4 depends on table size, ranges from 20 to 24 */ - QTMinitmodel(&QTM(model4), &QTM(m4sym)[0], (msz < 24) ? msz : 24, 0); - /* model 5 depends on table size, ranges from 20 to 36 */ - QTMinitmodel(&QTM(model5), &QTM(m5sym)[0], (msz < 36) ? msz : 36, 0); - /* model 6pos depends on table size, ranges from 20 to 42 */ - QTMinitmodel(&QTM(model6pos), &QTM(m6psym)[0], msz, 0); - QTMinitmodel(&QTM(model6len), &QTM(m6lsym)[0], 27, 0); - - return DECR_OK; -} - - -void QTMupdatemodel(struct QTMmodel *model, int sym) { - struct QTMmodelsym temp; - int i, j; - - for (i = 0; i < sym; i++) model->syms[i].cumfreq += 8; - - if (model->syms[0].cumfreq > 3800) { - if (--model->shiftsleft) { - for (i = model->entries - 1; i >= 0; i--) { - /* -1, not -2; the 0 entry saves this */ - model->syms[i].cumfreq >>= 1; - if (model->syms[i].cumfreq <= model->syms[i+1].cumfreq) { - model->syms[i].cumfreq = model->syms[i+1].cumfreq + 1; - } - } - } - else { - model->shiftsleft = 50; - for (i = 0; i < model->entries ; i++) { - /* no -1, want to include the 0 entry */ - /* this converts cumfreqs into frequencies, then shifts right */ - model->syms[i].cumfreq -= model->syms[i+1].cumfreq; - model->syms[i].cumfreq++; /* avoid losing things entirely */ - model->syms[i].cumfreq >>= 1; - } - - /* now sort by frequencies, decreasing order -- this must be an - * inplace selection sort, or a sort with the same (in)stability - * characteristics - */ - for (i = 0; i < model->entries - 1; i++) { - for (j = i + 1; j < model->entries; j++) { - if (model->syms[i].cumfreq < model->syms[j].cumfreq) { - temp = model->syms[i]; - model->syms[i] = model->syms[j]; - model->syms[j] = temp; - } - } - } - - /* then convert frequencies back to cumfreq */ - for (i = model->entries - 1; i >= 0; i--) { - model->syms[i].cumfreq += model->syms[i+1].cumfreq; - } - /* then update the other part of the table */ - for (i = 0; i < model->entries; i++) { - model->tabloc[model->syms[i].sym] = i; - } - } - } -} - -/* Bitstream reading macros (Quantum / normal byte order) - * - * Q_INIT_BITSTREAM should be used first to set up the system - * Q_READ_BITS(var,n) takes N bits from the buffer and puts them in var. - * unlike LZX, this can loop several times to get the - * requisite number of bits. - * Q_FILL_BUFFER adds more data to the bit buffer, if there is room - * for another 16 bits. - * Q_PEEK_BITS(n) extracts (without removing) N bits from the bit - * buffer - * Q_REMOVE_BITS(n) removes N bits from the bit buffer - * - * These bit access routines work by using the area beyond the MSB and the - * LSB as a free source of zeroes. This avoids having to mask any bits. - * So we have to know the bit width of the bitbuffer variable. This is - * defined as ULONG_BITS. - * - * ULONG_BITS should be at least 16 bits. Unlike LZX's Huffman decoding, - * Quantum's arithmetic decoding only needs 1 bit at a time, it doesn't - * need an assured number. Retrieving larger bitstrings can be done with - * multiple reads and fills of the bitbuffer. The code should work fine - * for machines where ULONG >= 32 bits. - * - * Also note that Quantum reads bytes in normal order; LZX is in - * little-endian order. - */ - -#define Q_INIT_BITSTREAM do { bitsleft = 0; bitbuf = 0; } while (0) - -#define Q_FILL_BUFFER do { \ - if (bitsleft <= (ULONG_BITS - 16)) { \ - bitbuf |= ((inpos[0]<<8)|inpos[1]) << (ULONG_BITS-16 - bitsleft); \ - bitsleft += 16; inpos += 2; \ - } \ -} while (0) - -#define Q_PEEK_BITS(n) (bitbuf >> (ULONG_BITS - (n))) -#define Q_REMOVE_BITS(n) ((bitbuf <<= (n)), (bitsleft -= (n))) - -#define Q_READ_BITS(v,n) do { \ - (v) = 0; \ - for (bitsneed = (n); bitsneed; bitsneed -= bitrun) { \ - Q_FILL_BUFFER; \ - bitrun = (bitsneed > bitsleft) ? bitsleft : bitsneed; \ - (v) = ((v) << bitrun) | Q_PEEK_BITS(bitrun); \ - Q_REMOVE_BITS(bitrun); \ - } \ -} while (0) - -#define Q_MENTRIES(model) (QTM(model).entries) -#define Q_MSYM(model,symidx) (QTM(model).syms[(symidx)].sym) -#define Q_MSYMFREQ(model,symidx) (QTM(model).syms[(symidx)].cumfreq) - -/* GET_SYMBOL(model, var) fetches the next symbol from the stated model - * and puts it in var. it may need to read the bitstream to do this. - */ -#define GET_SYMBOL(m, var) do { \ - range = ((H - L) & 0xFFFF) + 1; \ - symf = ((((C - L + 1) * Q_MSYMFREQ(m,0)) - 1) / range) & 0xFFFF; \ - \ - for (i=1; i < Q_MENTRIES(m); i++) { \ - if (Q_MSYMFREQ(m,i) <= symf) break; \ - } \ - (var) = Q_MSYM(m,i-1); \ - \ - range = (H - L) + 1; \ - H = L + ((Q_MSYMFREQ(m,i-1) * range) / Q_MSYMFREQ(m,0)) - 1; \ - L = L + ((Q_MSYMFREQ(m,i) * range) / Q_MSYMFREQ(m,0)); \ - while (1) { \ - if ((L & 0x8000) != (H & 0x8000)) { \ - if ((L & 0x4000) && !(H & 0x4000)) { \ - /* underflow case */ \ - C ^= 0x4000; L &= 0x3FFF; H |= 0x4000; \ - } \ - else break; \ - } \ - L <<= 1; H = (H << 1) | 1; \ - Q_FILL_BUFFER; \ - C = (C << 1) | Q_PEEK_BITS(1); \ - Q_REMOVE_BITS(1); \ - } \ - \ - QTMupdatemodel(&(QTM(m)), i); \ -} while (0) - - -int QTMdecompress(int inlen, int outlen) { - UBYTE *inpos = CAB(inbuf); - UBYTE *window = QTM(window); - UBYTE *runsrc, *rundest; - - ULONG window_posn = QTM(window_posn); - ULONG window_size = QTM(window_size); - - /* used by bitstream macros */ - register int bitsleft, bitrun, bitsneed; - register ULONG bitbuf; - - /* used by GET_SYMBOL */ - ULONG range; - UWORD symf; - int i; - - int extra, togo = outlen, match_length, copy_length; - UBYTE selector, sym; - ULONG match_offset; - - UWORD H = 0xFFFF, L = 0, C; - - /* read initial value of C */ - Q_INIT_BITSTREAM; - Q_READ_BITS(C, 16); - - /* apply 2^x-1 mask */ - window_posn &= window_size - 1; - /* runs can't straddle the window wraparound */ - if ((window_posn + togo) > window_size) { - D(("straddled run\n")) - return DECR_DATAFORMAT; - } - - while (togo > 0) { - GET_SYMBOL(model7, selector); - switch (selector) { - case 0: - GET_SYMBOL(model00, sym); window[window_posn++] = sym; togo--; - break; - case 1: - GET_SYMBOL(model40, sym); window[window_posn++] = sym; togo--; - break; - case 2: - GET_SYMBOL(model80, sym); window[window_posn++] = sym; togo--; - break; - case 3: - GET_SYMBOL(modelC0, sym); window[window_posn++] = sym; togo--; - break; - - case 4: - /* selector 4 = fixed length of 3 */ - GET_SYMBOL(model4, sym); - Q_READ_BITS(extra, q_extra_bits[sym]); - match_offset = q_position_base[sym] + extra + 1; - match_length = 3; - break; - - case 5: - /* selector 5 = fixed length of 4 */ - GET_SYMBOL(model5, sym); - Q_READ_BITS(extra, q_extra_bits[sym]); - match_offset = q_position_base[sym] + extra + 1; - match_length = 4; - break; - - case 6: - /* selector 6 = variable length */ - GET_SYMBOL(model6len, sym); - Q_READ_BITS(extra, q_length_extra[sym]); - match_length = q_length_base[sym] + extra + 5; - GET_SYMBOL(model6pos, sym); - Q_READ_BITS(extra, q_extra_bits[sym]); - match_offset = q_position_base[sym] + extra + 1; - break; - - default: - D(("Selector is bogus\n")) - return DECR_ILLEGALDATA; - } - - /* if this is a match */ - if (selector >= 4) { - rundest = window + window_posn; - togo -= match_length; - - /* copy any wrapped around source data */ - if (window_posn >= match_offset) { - /* no wrap */ - runsrc = rundest - match_offset; - } else { - runsrc = rundest + (window_size - match_offset); - copy_length = match_offset - window_posn; - if (copy_length < match_length) { - match_length -= copy_length; - window_posn += copy_length; - while (copy_length-- > 0) *rundest++ = *runsrc++; - runsrc = window; - } - } - window_posn += match_length; - - /* copy match data - no worries about destination wraps */ - while (match_length-- > 0) *rundest++ = *runsrc++; - } - } /* while (togo > 0) */ - - if (togo != 0) { - D(("Frame overflow, this_run = %d\n", togo)) - return DECR_ILLEGALDATA; - } - - memcpy(CAB(outbuf), window + ((!window_posn) ? window_size : window_posn) - - outlen, outlen); - - QTM(window_posn) = window_posn; - return DECR_OK; -} - - - -/* LZX decruncher */ - -/* Microsoft's LZX document and their implementation of the - * com.ms.util.cab Java package do not concur. - * - * In the LZX document, there is a table showing the correlation between - * window size and the number of position slots. It states that the 1MB - * window = 40 slots and the 2MB window = 42 slots. In the implementation, - * 1MB = 42 slots, 2MB = 50 slots. The actual calculation is 'find the - * first slot whose position base is equal to or more than the required - * window size'. This would explain why other tables in the document refer - * to 50 slots rather than 42. - * - * The constant NUM_PRIMARY_LENGTHS used in the decompression pseudocode - * is not defined in the specification. - * - * The LZX document does not state the uncompressed block has an - * uncompressed length field. Where does this length field come from, so - * we can know how large the block is? The implementation has it as the 24 - * bits following after the 3 blocktype bits, before the alignment - * padding. - * - * The LZX document states that aligned offset blocks have their aligned - * offset huffman tree AFTER the main and length trees. The implementation - * suggests that the aligned offset tree is BEFORE the main and length - * trees. - * - * The LZX document decoding algorithm states that, in an aligned offset - * block, if an extra_bits value is 1, 2 or 3, then that number of bits - * should be read and the result added to the match offset. This is - * correct for 1 and 2, but not 3, where just a huffman symbol (using the - * aligned tree) should be read. - * - * Regarding the E8 preprocessing, the LZX document states 'No translation - * may be performed on the last 6 bytes of the input block'. This is - * correct. However, the pseudocode provided checks for the *E8 leader* - * up to the last 6 bytes. If the leader appears between -10 and -7 bytes - * from the end, this would cause the next four bytes to be modified, at - * least one of which would be in the last 6 bytes, which is not allowed - * according to the spec. - * - * The specification states that the huffman trees must always contain at - * least one element. However, many CAB files contain blocks where the - * length tree is completely empty (because there are no matches), and - * this is expected to succeed. - */ - - -/* LZX uses what it calls 'position slots' to represent match offsets. - * What this means is that a small 'position slot' number and a small - * offset from that slot are encoded instead of one large offset for - * every match. - * - lzx_position_base is an index to the position slot bases - * - lzx_extra_bits states how many bits of offset-from-base data is needed. - */ -static ULONG lzx_position_base[51]; -static UBYTE extra_bits[51]; - -int LZXinit(int window) { - ULONG wndsize = 1 << window; - int i, j, posn_slots; - - /* LZX supports window sizes of 2^15 (32Kb) through 2^21 (2Mb) */ - /* if a previously allocated window is big enough, keep it */ - if (window < 15 || window > 21) return DECR_DATAFORMAT; - if (LZX(actual_size) < wndsize) { - if (LZX(window)) free(LZX(window)); - LZX(window) = NULL; - } - if (!LZX(window)) { - if (!(LZX(window) = malloc(wndsize))) return DECR_NOMEMORY; - LZX(actual_size) = wndsize; - } - LZX(window_size) = wndsize; - - /* initialise static tables */ - for (i=0, j=0; i <= 50; i += 2) { - extra_bits[i] = extra_bits[i+1] = j; /* 0,0,0,0,1,1,2,2,3,3... */ - if ((i != 0) && (j < 17)) j++; /* 0,0,1,2,3,4...15,16,17,17,17,17... */ - } - for (i=0, j=0; i <= 50; i++) { - lzx_position_base[i] = j; /* 0,1,2,3,4,6,8,12,16,24,32,... */ - j += 1 << extra_bits[i]; /* 1,1,1,1,2,2,4,4,8,8,16,16,32,32,... */ - } - - /* calculate required position slots */ - if (window == 20) posn_slots = 42; - else if (window == 21) posn_slots = 50; - else posn_slots = window << 1; - - /*posn_slots=i=0; while (i < wndsize) i += 1 << extra_bits[posn_slots++]; */ - - - LZX(R0) = LZX(R1) = LZX(R2) = 1; - LZX(main_elements) = LZX_NUM_CHARS + (posn_slots << 3); - LZX(header_read) = 0; - LZX(frames_read) = 0; - LZX(block_remaining) = 0; - LZX(block_type) = LZX_BLOCKTYPE_INVALID; - LZX(intel_curpos) = 0; - LZX(intel_started) = 0; - LZX(window_posn) = 0; - - /* initialise tables to 0 (because deltas will be applied to them) */ - for (i = 0; i < LZX_MAINTREE_MAXSYMBOLS; i++) LZX(MAINTREE_len)[i] = 0; - for (i = 0; i < LZX_LENGTH_MAXSYMBOLS; i++) LZX(LENGTH_len)[i] = 0; - - return DECR_OK; -} - -/* Bitstream reading macros (LZX / intel little-endian byte order) - * - * INIT_BITSTREAM should be used first to set up the system - * READ_BITS(var,n) takes N bits from the buffer and puts them in var - * - * ENSURE_BITS(n) ensures there are at least N bits in the bit buffer. - * it can guarantee up to 17 bits (i.e. it can read in - * 16 new bits when there is down to 1 bit in the buffer, - * and it can read 32 bits when there are 0 bits in the - * buffer). - * PEEK_BITS(n) extracts (without removing) N bits from the bit buffer - * REMOVE_BITS(n) removes N bits from the bit buffer - * - * These bit access routines work by using the area beyond the MSB and the - * LSB as a free source of zeroes. This avoids having to mask any bits. - * So we have to know the bit width of the bitbuffer variable. - */ - -#define INIT_BITSTREAM do { bitsleft = 0; bitbuf = 0; } while (0) - -/* Quantum reads bytes in normal order; LZX is little-endian order */ -#define ENSURE_BITS(n) \ - while (bitsleft < (n)) { \ - bitbuf |= ((inpos[1]<<8)|inpos[0]) << (ULONG_BITS-16 - bitsleft); \ - bitsleft += 16; inpos+=2; \ - } - -#define PEEK_BITS(n) (bitbuf >> (ULONG_BITS - (n))) -#define REMOVE_BITS(n) ((bitbuf <<= (n)), (bitsleft -= (n))) - -#define READ_BITS(v,n) do { \ - if (n) { \ - ENSURE_BITS(n); \ - (v) = PEEK_BITS(n); \ - REMOVE_BITS(n); \ - } \ - else { \ - (v) = 0; \ - } \ -} while (0) - -/* Huffman macros */ - -#define TABLEBITS(tbl) (LZX_##tbl##_TABLEBITS) -#define MAXSYMBOLS(tbl) (LZX_##tbl##_MAXSYMBOLS) -#define SYMTABLE(tbl) (LZX(tbl##_table)) -#define LENTABLE(tbl) (LZX(tbl##_len)) - -/* BUILD_TABLE(tablename) builds a huffman lookup table from code lengths. - * In reality, it just calls make_decode_table() with the appropriate - * values - they're all fixed by some #defines anyway, so there's no point - * writing each call out in full by hand. - */ -#define BUILD_TABLE(tbl) \ - if (make_decode_table( \ - MAXSYMBOLS(tbl), TABLEBITS(tbl), LENTABLE(tbl), SYMTABLE(tbl) \ - )) { return DECR_ILLEGALDATA; } - - -/* READ_HUFFSYM(tablename, var) decodes one huffman symbol from the - * bitstream using the stated table and puts it in var. - */ -#define READ_HUFFSYM(tbl,var) do { \ - ENSURE_BITS(16); \ - hufftbl = SYMTABLE(tbl); \ - if ((i = hufftbl[PEEK_BITS(TABLEBITS(tbl))]) >= MAXSYMBOLS(tbl)) { \ - j = 1 << (ULONG_BITS - TABLEBITS(tbl)); \ - do { \ - j >>= 1; i <<= 1; i |= (bitbuf & j) ? 1 : 0; \ - if (!j) { return DECR_ILLEGALDATA; } \ - } while ((i = hufftbl[i]) >= MAXSYMBOLS(tbl)); \ - } \ - j = LENTABLE(tbl)[(var) = i]; \ - REMOVE_BITS(j); \ -} while (0) - - -/* READ_LENGTHS(tablename, first, last) reads in code lengths for symbols - * first to last in the given table. The code lengths are stored in their - * own special LZX way. - */ -#define READ_LENGTHS(tbl,first,last) do { \ - lb.bb = bitbuf; lb.bl = bitsleft; lb.ip = inpos; \ - if (lzx_read_lens(LENTABLE(tbl),(first),(last),&lb)) { \ - return DECR_ILLEGALDATA; \ - } \ - bitbuf = lb.bb; bitsleft = lb.bl; inpos = lb.ip; \ -} while (0) - - -/* make_decode_table(nsyms, nbits, length[], table[]) - * - * This function was coded by David Tritscher. It builds a fast huffman - * decoding table out of just a canonical huffman code lengths table. - * - * nsyms = total number of symbols in this huffman tree. - * nbits = any symbols with a code length of nbits or less can be decoded - * in one lookup of the table. - * length = A table to get code lengths from [0 to syms-1] - * table = The table to fill up with decoded symbols and pointers. - * - * Returns 0 for OK or 1 for error - */ - -int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) { - register UWORD sym; - register ULONG leaf; - register UBYTE bit_num = 1; - ULONG fill; - ULONG pos = 0; /* the current position in the decode table */ - ULONG table_mask = 1 << nbits; - ULONG bit_mask = table_mask >> 1; /* don't do 0 length codes */ - ULONG next_symbol = bit_mask; /* base of allocation for long codes */ - - /* fill entries for codes short enough for a direct mapping */ - while (bit_num <= nbits) { - for (sym = 0; sym < nsyms; sym++) { - if (length[sym] == bit_num) { - leaf = pos; - - if((pos += bit_mask) > table_mask) return 1; /* table overrun */ - - /* fill all possible lookups of this symbol with the symbol itself */ - fill = bit_mask; - while (fill-- > 0) table[leaf++] = sym; - } - } - bit_mask >>= 1; - bit_num++; - } - - /* if there are any codes longer than nbits */ - if (pos != table_mask) { - /* clear the remainder of the table */ - for (sym = pos; sym < table_mask; sym++) table[sym] = 0; - - /* give ourselves room for codes to grow by up to 16 more bits */ - pos <<= 16; - table_mask <<= 16; - bit_mask = 1 << 15; - - while (bit_num <= 16) { - for (sym = 0; sym < nsyms; sym++) { - if (length[sym] == bit_num) { - leaf = pos >> 16; - for (fill = 0; fill < bit_num - nbits; fill++) { - /* if this path hasn't been taken yet, 'allocate' two entries */ - if (table[leaf] == 0) { - table[(next_symbol << 1)] = 0; - table[(next_symbol << 1) + 1] = 0; - table[leaf] = next_symbol++; - } - /* follow the path and select either left or right for next bit */ - leaf = table[leaf] << 1; - if ((pos >> (15-fill)) & 1) leaf++; - } - table[leaf] = sym; - - if ((pos += bit_mask) > table_mask) return 1; /* table overflow */ - } - } - bit_mask >>= 1; - bit_num++; - } - } - - /* full table? */ - if (pos == table_mask) return 0; - - /* either erroneous table, or all elements are 0 - let's find out. */ - for (sym = 0; sym < nsyms; sym++) if (length[sym]) return 1; - return 0; -} - -struct lzx_bits { - ULONG bb; - int bl; - UBYTE *ip; -}; - -int lzx_read_lens(UBYTE *lens, ULONG first, ULONG last, struct lzx_bits *lb) { - ULONG i,j, x,y; - int z; - - register ULONG bitbuf = lb->bb; - register int bitsleft = lb->bl; - UBYTE *inpos = lb->ip; - UWORD *hufftbl; - - for (x = 0; x < 20; x++) { - READ_BITS(y, 4); - LENTABLE(PRETREE)[x] = y; - } - BUILD_TABLE(PRETREE); - - for (x = first; x < last; ) { - READ_HUFFSYM(PRETREE, z); - if (z == 17) { - READ_BITS(y, 4); y += 4; - while (y--) lens[x++] = 0; - } - else if (z == 18) { - READ_BITS(y, 5); y += 20; - while (y--) lens[x++] = 0; - } - else if (z == 19) { - READ_BITS(y, 1); y += 4; - READ_HUFFSYM(PRETREE, z); - z = lens[x] - z; if (z < 0) z += 17; - while (y--) lens[x++] = z; - } - else { - z = lens[x] - z; if (z < 0) z += 17; - lens[x++] = z; - } - } - - lb->bb = bitbuf; - lb->bl = bitsleft; - lb->ip = inpos; - return 0; -} - -int LZXdecompress(int inlen, int outlen) { - UBYTE *inpos = CAB(inbuf); - UBYTE *endinp = inpos + inlen; - UBYTE *window = LZX(window); - UBYTE *runsrc, *rundest; - UWORD *hufftbl; /* used in READ_HUFFSYM macro as chosen decoding table */ - - ULONG window_posn = LZX(window_posn); - ULONG window_size = LZX(window_size); - ULONG R0 = LZX(R0); - ULONG R1 = LZX(R1); - ULONG R2 = LZX(R2); - - register ULONG bitbuf; - register int bitsleft; - ULONG match_offset, i,j,k; /* ijk used in READ_HUFFSYM macro */ - struct lzx_bits lb; /* used in READ_LENGTHS macro */ - - int togo = outlen, this_run, main_element, aligned_bits; - int match_length, copy_length, length_footer, extra, verbatim_bits; - - INIT_BITSTREAM; - - /* read header if necessary */ - if (!LZX(header_read)) { - i = j = 0; - READ_BITS(k, 1); if (k) { READ_BITS(i,16); READ_BITS(j,16); } - LZX(intel_filesize) = (i << 16) | j; /* or 0 if not encoded */ - LZX(header_read) = 1; - } - - /* main decoding loop */ - while (togo > 0) { - /* last block finished, new block expected */ - if (LZX(block_remaining) == 0) { - if (LZX(block_type) == LZX_BLOCKTYPE_UNCOMPRESSED) { - if (LZX(block_length) & 1) inpos++; /* realign bitstream to word */ - INIT_BITSTREAM; - } - - READ_BITS(LZX(block_type), 3); - READ_BITS(i, 16); - READ_BITS(j, 8); - LZX(block_remaining) = LZX(block_length) = (i << 8) | j; - - switch (LZX(block_type)) { - case LZX_BLOCKTYPE_ALIGNED: - for (i = 0; i < 8; i++) { READ_BITS(j, 3); LENTABLE(ALIGNED)[i] = j; } - BUILD_TABLE(ALIGNED); - /* rest of aligned header is same as verbatim */ - - case LZX_BLOCKTYPE_VERBATIM: - READ_LENGTHS(MAINTREE, 0, 256); - READ_LENGTHS(MAINTREE, 256, LZX(main_elements)); - BUILD_TABLE(MAINTREE); - if (LENTABLE(MAINTREE)[0xE8] != 0) LZX(intel_started) = 1; - - READ_LENGTHS(LENGTH, 0, LZX_NUM_SECONDARY_LENGTHS); - BUILD_TABLE(LENGTH); - break; - - case LZX_BLOCKTYPE_UNCOMPRESSED: - LZX(intel_started) = 1; /* because we can't assume otherwise */ - ENSURE_BITS(16); /* get up to 16 pad bits into the buffer */ - if (bitsleft > 16) inpos -= 2; /* and align the bitstream! */ - R0 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4; - R1 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4; - R2 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4; - break; - - default: - return DECR_ILLEGALDATA; - } - } - - /* buffer exhaustion check */ - if (inpos > endinp) { - /* it's possible to have a file where the next run is less than - * 16 bits in size. In this case, the READ_HUFFSYM() macro used - * in building the tables will exhaust the buffer, so we should - * allow for this, but not allow those accidentally read bits to - * be used (so we check that there are at least 16 bits - * remaining - in this boundary case they aren't really part of - * the compressed data) - */ - if (inpos > (endinp+2) || bitsleft < 16) return DECR_ILLEGALDATA; - } - - while ((this_run = LZX(block_remaining)) > 0 && togo > 0) { - if (this_run > togo) this_run = togo; - togo -= this_run; - LZX(block_remaining) -= this_run; - - /* apply 2^x-1 mask */ - window_posn &= window_size - 1; - /* runs can't straddle the window wraparound */ - if ((window_posn + this_run) > window_size) - return DECR_DATAFORMAT; - - switch (LZX(block_type)) { - - case LZX_BLOCKTYPE_VERBATIM: - while (this_run > 0) { - READ_HUFFSYM(MAINTREE, main_element); - - if (main_element < LZX_NUM_CHARS) { - /* literal: 0 to LZX_NUM_CHARS-1 */ - window[window_posn++] = main_element; - this_run--; - } - else { - /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */ - main_element -= LZX_NUM_CHARS; - - match_length = main_element & LZX_NUM_PRIMARY_LENGTHS; - if (match_length == LZX_NUM_PRIMARY_LENGTHS) { - READ_HUFFSYM(LENGTH, length_footer); - match_length += length_footer; - } - match_length += LZX_MIN_MATCH; - - match_offset = main_element >> 3; - - if (match_offset > 2) { - /* not repeated offset */ - if (match_offset != 3) { - extra = extra_bits[match_offset]; - READ_BITS(verbatim_bits, extra); - match_offset = lzx_position_base[match_offset] - - 2 + verbatim_bits; - } - else { - match_offset = 1; - } - - /* update repeated offset LRU queue */ - R2 = R1; R1 = R0; R0 = match_offset; - } - else if (match_offset == 0) { - match_offset = R0; - } - else if (match_offset == 1) { - match_offset = R1; - R1 = R0; R0 = match_offset; - } - else /* match_offset == 2 */ { - match_offset = R2; - R2 = R0; R0 = match_offset; - } - - rundest = window + window_posn; - this_run -= match_length; - - /* copy any wrapped around source data */ - if (window_posn >= match_offset) { - /* no wrap */ - runsrc = rundest - match_offset; - } else { - runsrc = rundest + (window_size - match_offset); - copy_length = match_offset - window_posn; - if (copy_length < match_length) { - match_length -= copy_length; - window_posn += copy_length; - while (copy_length-- > 0) *rundest++ = *runsrc++; - runsrc = window; - } - } - window_posn += match_length; - - /* copy match data - no worries about destination wraps */ - while (match_length-- > 0) *rundest++ = *runsrc++; - } - } - break; - - case LZX_BLOCKTYPE_ALIGNED: - while (this_run > 0) { - READ_HUFFSYM(MAINTREE, main_element); - - if (main_element < LZX_NUM_CHARS) { - /* literal: 0 to LZX_NUM_CHARS-1 */ - window[window_posn++] = main_element; - this_run--; - } - else { - /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */ - main_element -= LZX_NUM_CHARS; - - match_length = main_element & LZX_NUM_PRIMARY_LENGTHS; - if (match_length == LZX_NUM_PRIMARY_LENGTHS) { - READ_HUFFSYM(LENGTH, length_footer); - match_length += length_footer; - } - match_length += LZX_MIN_MATCH; - - match_offset = main_element >> 3; - - if (match_offset > 2) { - /* not repeated offset */ - extra = extra_bits[match_offset]; - match_offset = lzx_position_base[match_offset] - 2; - if (extra > 3) { - /* verbatim and aligned bits */ - extra -= 3; - READ_BITS(verbatim_bits, extra); - match_offset += (verbatim_bits << 3); - READ_HUFFSYM(ALIGNED, aligned_bits); - match_offset += aligned_bits; - } - else if (extra == 3) { - /* aligned bits only */ - READ_HUFFSYM(ALIGNED, aligned_bits); - match_offset += aligned_bits; - } - else if (extra > 0) { /* extra==1, extra==2 */ - /* verbatim bits only */ - READ_BITS(verbatim_bits, extra); - match_offset += verbatim_bits; - } - else /* extra == 0 */ { - /* ??? */ - match_offset = 1; - } - - /* update repeated offset LRU queue */ - R2 = R1; R1 = R0; R0 = match_offset; - } - else if (match_offset == 0) { - match_offset = R0; - } - else if (match_offset == 1) { - match_offset = R1; - R1 = R0; R0 = match_offset; - } - else /* match_offset == 2 */ { - match_offset = R2; - R2 = R0; R0 = match_offset; - } - - rundest = window + window_posn; - this_run -= match_length; - - /* copy any wrapped around source data */ - if (window_posn >= match_offset) { - /* no wrap */ - runsrc = rundest - match_offset; - } else { - runsrc = rundest + (window_size - match_offset); - copy_length = match_offset - window_posn; - if (copy_length < match_length) { - match_length -= copy_length; - window_posn += copy_length; - while (copy_length-- > 0) *rundest++ = *runsrc++; - runsrc = window; - } - } - window_posn += match_length; - - /* copy match data - no worries about destination wraps */ - while (match_length-- > 0) *rundest++ = *runsrc++; - } - } - break; - - case LZX_BLOCKTYPE_UNCOMPRESSED: - if ((inpos + this_run) > endinp) return DECR_ILLEGALDATA; - memcpy(window + window_posn, inpos, (size_t) this_run); - inpos += this_run; window_posn += this_run; - break; - - default: - return DECR_ILLEGALDATA; /* might as well */ - } - - } - } - - if (togo != 0) return DECR_ILLEGALDATA; - memcpy(CAB(outbuf), window + ((!window_posn) ? window_size : window_posn) - - outlen, (size_t) outlen); - - LZX(window_posn) = window_posn; - LZX(R0) = R0; - LZX(R1) = R1; - LZX(R2) = R2; - - /* intel E8 decoding */ - if ((LZX(frames_read)++ < 32768) && LZX(intel_filesize) != 0) { - if (outlen <= 6 || !LZX(intel_started)) { - LZX(intel_curpos) += outlen; - } - else { - UBYTE *data = CAB(outbuf); - UBYTE *dataend = data + outlen - 10; - LONG curpos = LZX(intel_curpos); - LONG filesize = LZX(intel_filesize); - LONG abs_off, rel_off; - - LZX(intel_curpos) = curpos + outlen; - - while (data < dataend) { - if (*data++ != 0xE8) { curpos++; continue; } - abs_off = data[0] | (data[1]<<8) | (data[2]<<16) | (data[3]<<24); - if ((abs_off >= -curpos) && (abs_off < filesize)) { - rel_off = (abs_off >= 0) ? abs_off - curpos : abs_off + filesize; - data[0] = (UBYTE) rel_off; - data[1] = (UBYTE) (rel_off >> 8); - data[2] = (UBYTE) (rel_off >> 16); - data[3] = (UBYTE) (rel_off >> 24); - } - data += 4; - curpos += 5; - } - } - } - return DECR_OK; -} - - - - -/* all the file IO is abstracted into these routines: - * cabinet_(open|close|read|seek|skip|getoffset) - * file_(open|close|write) - */ - -/* ensure_filepath("a/b/c/d.txt") ensures a, a/b and a/b/c exist as dirs */ -int ensure_filepath(char *path) { - struct stat st_buf; - mode_t m; - char *p; - int ok; - - m = umask(0); umask(m); /* obtain user's umask */ - - for (p = path; *p; p++) { - if ((p != path) && (*p == '/')) { - *p = 0; - ok = (stat(path, &st_buf) == 0) && S_ISDIR(st_buf.st_mode); - if (!ok) ok = (mkdir(path, 0777 & ~m) == 0); - *p = '/'; - if (!ok) return 0; - } - } - return 1; -} - -/* opens a file for output, returns success */ -int file_open(struct file *fi, int lower, char *dir) { - char c, *s, *d, *name; - int ok = 0; - - if (!(name = malloc(strlen(fi->filename) + (dir ? strlen(dir) : 0) + 2))) { - fprintf(stderr, "out of memory!\n"); - return 0; - } - - /* start with blank name */ - *name = 0; - - /* add output directory if needed */ - if (dir) { - strcpy(name, dir); - strcat(name, "/"); - } - - - /* remove leading slashes */ - s = fi->filename; - while (*s == '\\') s++; - - /* copy from fi->filename to new name, converting MS-DOS slashes to UNIX - * slashes as we go. Also lowercases characters if needed. - */ - d = &name[strlen(name)]; - do { - c = *s++; - *d++ = (c=='/') ? '\\' : ((c=='\\') ? '/' : - (lower ? tolower((unsigned char) c) : c)); - } while (c); - - /* create directories if needed, attempt to write file */ - if (ensure_filepath(name)) { - fi->fh = fopen(name, "wb"); - if (fi->fh) ok = 1; - } - - /* as full filename is no longer needed, free it */ - free(name); - - if (!ok) { - perror(fi->filename); - } - return ok; -} - -/* closes a completed file, updates protections and timestamp */ -void file_close(struct file *fi) { - struct utimbuf utb; - struct tm time; - mode_t m; - - if (fi->fh) { - fclose(fi->fh); - } - fi->fh = NULL; - - m = umask(0); umask(m); /* obtain user's umask */ - chmod(fi->filename, - ((mode_t) 0444 - | (fi->attribs & cffile_A_EXEC ? 0111 : 0) - | (fi->attribs & cffile_A_RDONLY ? 0 : 0222)) & ~ m - ); - - - time.tm_sec = (fi->time << 1) & 0x3e; - time.tm_min = (fi->time >> 5) & 0x3f; - time.tm_hour = (fi->time >> 11); - time.tm_mday = fi->date & 0x1f; - time.tm_mon =((fi->date >> 5) & 0xf) - 1; - time.tm_year = (fi->date >> 9) + 80; - time.tm_isdst = -1; -#ifdef HAVE_UTIME - utb.actime = utb.modtime = mktime(&time); - utime(fi->filename, &utb); -#endif -} - -int file_write(struct file *fi, UBYTE *buf, size_t length) { - if (fwrite((void *)buf, 1, length, fi->fh) != length) { - perror(fi->filename); - return 0; - } - return 1; -} - - -void cabinet_close(struct cabinet *cab) { - if (cab->fh) { - fclose(cab->fh); - } - cab->fh = NULL; -} - -void cabinet_seek(struct cabinet *cab, off_t offset) { - if (fseek(cab->fh, offset, SEEK_SET) < 0) { - perror(cab->filename); - } -} - -void cabinet_skip(struct cabinet *cab, off_t distance) { - if (fseek(cab->fh, distance, SEEK_CUR) < 0) { - perror(cab->filename); - } -} - -off_t cabinet_getoffset(struct cabinet *cab) { - return ftell(cab->fh); -} - -/* read data from a cabinet, returns success */ -int cabinet_read(struct cabinet *cab, UBYTE *buf, size_t length) { - size_t avail = (size_t) (cab->filelen - cabinet_getoffset(cab)); - if (length > avail) { - fprintf(stderr, "%s: WARNING; cabinet is truncated\n", cab->filename); - length = avail; - } - if (fread((void *)buf, 1, length, cab->fh) != length) { - perror(cab->filename); - return 0; - } - return 1; -} - -/* try to open a cabinet file, returns success */ -int cabinet_open(struct cabinet *cab) { - char *name = cab->filename; - FILE *fh; - - /* note: this is now case sensitive */ - if (!(fh = fopen(name, "rb"))) { - perror(name); - return 0; - } - - /* seek to end of file */ - if (fseek(fh, 0, SEEK_END) != 0) { - perror(name); - fclose(fh); - return 0; - } - - /* get length of file */ - cab->filelen = ftell(fh); - - /* return to the start of the file */ - if (fseek(fh, 0, SEEK_SET) != 0) { - perror(name); - fclose(fh); - return 0; - } - - cab->fh = fh; - return 1; -} - -/* allocate and read an aribitrarily long string from the cabinet */ -char *cabinet_read_string(struct cabinet *cab) { - off_t len=256, base = cabinet_getoffset(cab), maxlen = cab->filelen - base; - int ok = 0, i; - UBYTE *buf = NULL; - do { - if (len > maxlen) len = maxlen; - if (!(buf = realloc(buf, (size_t) len))) break; - if (!cabinet_read(cab, buf, (size_t) len)) break; - - /* search for a null terminator in what we've just read */ - for (i=0; i < len; i++) { - if (!buf[i]) {ok=1; break;} - } - - if (!ok) { - if (len == maxlen) { - fprintf(stderr, "%s: WARNING; cabinet is truncated\n", cab->filename); - break; - } - len += 256; - cabinet_seek(cab, base); - } - } while (!ok); - - if (!ok) { - if (buf) free(buf); else fprintf(stderr, "out of memory!\n"); - return NULL; - } - - /* otherwise, set the stream to just after the string and return */ - cabinet_seek(cab, base + ((off_t) strlen((char *) buf)) + 1); - return (char *) buf; -} - -/* reads the header and all folder and file entries in this cabinet */ -int cabinet_read_entries(struct cabinet *cab) { - int num_folders, num_files, header_resv, folder_resv = 0, i; - struct folder *fol, *linkfol = NULL; - struct file *file, *linkfile = NULL; - off_t base_offset; - UBYTE buf[64]; - - /* read in the CFHEADER */ - base_offset = cabinet_getoffset(cab); - if (!cabinet_read(cab, buf, cfhead_SIZEOF)) { - return 0; - } - - /* check basic MSCF signature */ - if (EndGetI32(buf+cfhead_Signature) != 0x4643534d) { - fprintf(stderr, "%s: not a Microsoft cabinet file\n", cab->filename); - return 0; - } - - /* get the number of folders */ - num_folders = EndGetI16(buf+cfhead_NumFolders); - if (num_folders == 0) { - fprintf(stderr, "%s: no folders in cabinet\n", cab->filename); - return 0; - } - - /* get the number of files */ - num_files = EndGetI16(buf+cfhead_NumFiles); - if (num_files == 0) { - fprintf(stderr, "%s: no files in cabinet\n", cab->filename); - return 0; - } - - /* just check the header revision */ - if ((buf[cfhead_MajorVersion] > 1) || - (buf[cfhead_MajorVersion] == 1 && buf[cfhead_MinorVersion] > 3)) - { - fprintf(stderr, "%s: WARNING; cabinet format version > 1.3\n", - cab->filename); - } - - /* read the reserved-sizes part of header, if present */ - cab->flags = EndGetI16(buf+cfhead_Flags); - if (cab->flags & cfheadRESERVE_PRESENT) { - if (!cabinet_read(cab, buf, cfheadext_SIZEOF)) return 0; - header_resv = EndGetI16(buf+cfheadext_HeaderReserved); - folder_resv = buf[cfheadext_FolderReserved]; - cab->block_resv = buf[cfheadext_DataReserved]; - - if (header_resv > 60000) { - fprintf(stderr, "%s: WARNING; header reserved space > 60000\n", - cab->filename); - } - - /* skip the reserved header */ - if (header_resv) fseek(cab->fh, (off_t) header_resv, SEEK_CUR); - } - - if (cab->flags & cfheadPREV_CABINET) { - cab->prevname = cabinet_read_string(cab); - if (!cab->prevname) return 0; - cab->previnfo = cabinet_read_string(cab); - } - - if (cab->flags & cfheadNEXT_CABINET) { - cab->nextname = cabinet_read_string(cab); - if (!cab->nextname) return 0; - cab->nextinfo = cabinet_read_string(cab); - } - - /* read folders */ - for (i = 0; i < num_folders; i++) { - if (!cabinet_read(cab, buf, cffold_SIZEOF)) return 0; - if (folder_resv) cabinet_skip(cab, folder_resv); - - fol = (struct folder *) calloc(1, sizeof(struct folder)); - if (!fol) { fprintf(stderr, "out of memory!\n"); return 0; } - - fol->cab[0] = cab; - fol->offset[0] = base_offset + (off_t) EndGetI32(buf+cffold_DataOffset); - fol->num_blocks = EndGetI16(buf+cffold_NumBlocks); - fol->comp_type = EndGetI16(buf+cffold_CompType); - - if (!linkfol) cab->folders = fol; else linkfol->next = fol; - linkfol = fol; - } - - /* read files */ - for (i = 0; i < num_files; i++) { - if (!cabinet_read(cab, buf, cffile_SIZEOF)) return 0; - file = (struct file *) calloc(1, sizeof(struct file)); - if (!file) { fprintf(stderr, "out of memory!\n"); return 0; } - - file->length = EndGetI32(buf+cffile_UncompressedSize); - file->offset = EndGetI32(buf+cffile_FolderOffset); - file->index = EndGetI16(buf+cffile_FolderIndex); - file->time = EndGetI16(buf+cffile_Time); - file->date = EndGetI16(buf+cffile_Date); - file->attribs = EndGetI16(buf+cffile_Attribs); - file->filename = cabinet_read_string(cab); - if (!file->filename) return 0; - if (!linkfile) cab->files = file; else linkfile->next = file; - linkfile = file; - } - return 1; -} - - -/* this does the tricky job of running through every file in the cabinet, - * including spanning cabinets, and working out which file is in which - * folder in which cabinet. It also throws out the duplicate file entries - * that appear in spanning cabinets. There is memory leakage here because - * those entries are not freed. See the XAD CAB client for an - * implementation of this that correctly frees the discarded file entries. - */ -struct file *process_files(struct cabinet *basecab) { - struct cabinet *cab; - struct file *outfi = NULL, *linkfi = NULL, *nextfi, *fi, *cfi; - struct folder *fol, *firstfol, *lastfol = NULL, *predfol; - int i, mergeok; - - for (cab = basecab; cab; cab = cab->nextcab) { - /* firstfol = first folder in this cabinet */ - /* lastfol = last folder in this cabinet */ - /* predfol = last folder in previous cabinet (or NULL if first cabinet) */ - predfol = lastfol; - firstfol = cab->folders; - for (lastfol = firstfol; lastfol->next;) lastfol = lastfol->next; - mergeok = 1; - - for (fi = cab->files; fi; fi = nextfi) { - i = fi->index; - nextfi = fi->next; - - if (i < cffileCONTINUED_FROM_PREV) { - for (fol = firstfol; fol && i--; ) fol = fol->next; - fi->folder = fol; /* NULL if an invalid folder index */ - } - else { - /* folder merging */ - if (i == cffileCONTINUED_TO_NEXT - || i == cffileCONTINUED_PREV_AND_NEXT) { - if (cab->nextcab && !lastfol->contfile) lastfol->contfile = fi; - } - - if (i == cffileCONTINUED_FROM_PREV - || i == cffileCONTINUED_PREV_AND_NEXT) { - /* these files are to be continued in yet another - * cabinet, don't merge them in just yet */ - if (i == cffileCONTINUED_PREV_AND_NEXT) mergeok = 0; - - /* only merge once per cabinet */ - if (predfol) { - if ((cfi = predfol->contfile) - && (cfi->offset == fi->offset) - && (cfi->length == fi->length) - && (strcmp(cfi->filename, fi->filename) == 0) - && (predfol->comp_type == firstfol->comp_type)) { - /* increase the number of splits */ - if ((i = ++(predfol->num_splits)) > CAB_SPLITMAX) { - mergeok = 0; - fprintf(stderr, "%s: internal error, increase CAB_SPLITMAX\n", - basecab->filename); - } - else { - /* copy information across from the merged folder */ - predfol->offset[i] = firstfol->offset[0]; - predfol->cab[i] = firstfol->cab[0]; - predfol->next = firstfol->next; - predfol->contfile = firstfol->contfile; - - if (firstfol == lastfol) lastfol = predfol; - firstfol = predfol; - predfol = NULL; /* don't merge again within this cabinet */ - } - } - else { - /* if the folders won't merge, don't add their files */ - mergeok = 0; - } - } - - if (mergeok) fi->folder = firstfol; - } - } - - if (fi->folder) { - if (linkfi) linkfi->next = fi; else outfi = fi; - linkfi = fi; - } - } /* for (fi= .. */ - } /* for (cab= ...*/ - - return outfi; -} - -/* validates and reads file entries from a cabinet at offset [offset] in - * file [name]. Returns a cabinet structure if successful, or NULL - * otherwise. - */ -struct cabinet *load_cab_offset(char *name, off_t offset) { - struct cabinet *cab = (struct cabinet *) calloc(1, sizeof(struct cabinet)); - int ok; - if (!cab) return NULL; - - cab->filename = name; - if ((ok = cabinet_open(cab))) { - cabinet_seek(cab, offset); - ok = cabinet_read_entries(cab); - cabinet_close(cab); - } - - if (ok) return cab; - free(cab); - return NULL; -} - -/* Searches a file for embedded cabinets (also succeeds on just normal - * cabinet files). The first result of this search will be returned, and - * the remaining results will be chained to it via the cab->next structure - * member. - */ -#define SEARCH_SIZE (32*1024) -UBYTE search_buf[SEARCH_SIZE]; - -struct cabinet *find_cabs_in_file(char *name) { - struct cabinet *cab, *cab2, *firstcab = NULL, *linkcab = NULL; - UBYTE *pstart = &search_buf[0], *pend, *p; - ULONG offset, caboff, cablen, foffset, filelen; - size_t length; - int state = 0, found = 0, ok = 0; - - /* open the file and search for cabinet headers */ - if ((cab = (struct cabinet *) calloc(1, sizeof(struct cabinet)))) { - cab->filename = name; - if (cabinet_open(cab)) { - filelen = (ULONG) cab->filelen; - for (offset = 0; offset < filelen; offset += length) { - /* search length is either the full length of the search buffer, - * or the amount of data remaining to the end of the file, - * whichever is less. - */ - length = filelen - offset; - if (length > SEARCH_SIZE) length = SEARCH_SIZE; - - /* fill the search buffer with data from disk */ - if (!cabinet_read(cab, search_buf, length)) break; - - /* read through the entire buffer. */ - p = pstart; - pend = &search_buf[length]; - while (p < pend) { - switch (state) { - /* starting state */ - case 0: - /* we spend most of our time in this while loop, looking for - * a leading 'M' of the 'MSCF' signature - */ - while (*p++ != 0x4D && p < pend); - if (p < pend) state = 1; /* if we found tht 'M', advance state */ - break; - - /* verify that the next 3 bytes are 'S', 'C' and 'F' */ - case 1: state = (*p++ == 0x53) ? 2 : 0; break; - case 2: state = (*p++ == 0x43) ? 3 : 0; break; - case 3: state = (*p++ == 0x46) ? 4 : 0; break; - - /* we don't care about bytes 4-7 */ - /* bytes 8-11 are the overall length of the cabinet */ - case 8: cablen = *p++; state++; break; - case 9: cablen |= *p++ << 8; state++; break; - case 10: cablen |= *p++ << 16; state++; break; - case 11: cablen |= *p++ << 24; state++; break; - - /* we don't care about bytes 12-15 */ - /* bytes 16-19 are the offset within the cabinet of the filedata */ - case 16: foffset = *p++; state++; break; - case 17: foffset |= *p++ << 8; state++; break; - case 18: foffset |= *p++ << 16; state++; break; - case 19: foffset |= *p++ << 24; - /* now we have recieved 20 bytes of potential cab header. */ - /* work out the offset in the file of this potential cabinet */ - caboff = offset + (p-pstart) - 20; - - /* check that the files offset is less than the alleged length - * of the cabinet, and that the offset + the alleged length are - * 'roughly' within the end of overall file length - */ - if ((foffset < cablen) && - ((caboff + foffset) < (filelen + 32)) && - ((caboff + cablen) < (filelen + 32)) ) - { - /* found a potential result - try loading it */ - found++; - cab2 = load_cab_offset(name, (off_t) caboff); - if (cab2) { - /* success */ - ok++; - - /* cause the search to restart after this cab's data. */ - offset = caboff + cablen; - if (offset < cab->filelen) cabinet_seek(cab, offset); - length = 0; - p = pend; - - /* link the cab into the list */ - if (linkcab == NULL) firstcab = cab2; - else linkcab->next = cab2; - linkcab = cab2; - } - } - state = 0; - break; - default: - p++, state++; break; - } - } - } - cabinet_close(cab); - } - free(cab); - } - - /* if there were cabinets that were found but are not ok, point this out */ - if (found > ok) { - fprintf(stderr, "%s: WARNING; found %d bad cabinets\n", name, found-ok); - } - - /* if no cabinets were found, let the user know */ - if (!firstcab) { - fprintf(stderr, "%s: not a Microsoft cabinet file.\n", name); - } - return firstcab; -} - -/* UTF translates two-byte unicode characters into 1, 2 or 3 bytes. - * %000000000xxxxxxx -> %0xxxxxxx - * %00000xxxxxyyyyyy -> %110xxxxx %10yyyyyy - * %xxxxyyyyyyzzzzzz -> %1110xxxx %10yyyyyy %10zzzzzz - * - * Therefore, the inverse is as follows: - * First char: - * 0x00 - 0x7F = one byte char - * 0x80 - 0xBF = invalid - * 0xC0 - 0xDF = 2 byte char (next char only 0x80-0xBF is valid) - * 0xE0 - 0xEF = 3 byte char (next 2 chars only 0x80-0xBF is valid) - * 0xF0 - 0xFF = invalid - */ - -/* translate UTF -> ASCII */ -int convertUTF(UBYTE *in) { - UBYTE c, *out = in, *end = in + strlen((char *) in) + 1; - ULONG x; - - do { - /* read unicode character */ - if ((c = *in++) < 0x80) x = c; - else { - if (c < 0xC0) return 0; - else if (c < 0xE0) { - x = (c & 0x1F) << 6; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F); - } - else if (c < 0xF0) { - x = (c & 0xF) << 12; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F)<<6; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F); - } - else return 0; - } - - /* terrible unicode -> ASCII conversion */ - if (x > 127) x = '_'; - - if (in > end) return 0; /* just in case */ - } while ((*out++ = (UBYTE) x)); - return 1; -} - -void print_fileinfo(struct file *fi) { - int d = fi->date, t = fi->time; - char *fname = NULL; - - if (fi->attribs & cffile_A_NAME_IS_UTF) { - fname = malloc(strlen(fi->filename) + 1); - if (fname) { - strcpy(fname, fi->filename); - convertUTF((UBYTE *) fname); - } - } - - printf("%9u | %02d.%02d.%04d %02d:%02d:%02d | %s\n", - fi->length, - d & 0x1f, (d>>5) & 0xf, (d>>9) + 1980, - t >> 11, (t>>5) & 0x3f, (t << 1) & 0x3e, - fname ? fname : fi->filename - ); - - if (fname) free(fname); -} - -int NONEdecompress(int inlen, int outlen) { - if (inlen != outlen) return DECR_ILLEGALDATA; - memcpy(CAB(outbuf), CAB(inbuf), (size_t) inlen); - return DECR_OK; -} - -ULONG checksum(UBYTE *data, UWORD bytes, ULONG csum) { - int len; - ULONG ul = 0; - - for (len = bytes >> 2; len--; data += 4) { - csum ^= ((data[0]) | (data[1]<<8) | (data[2]<<16) | (data[3]<<24)); - } - - switch (bytes & 3) { - case 3: ul |= *data++ << 16; - case 2: ul |= *data++ << 8; - case 1: ul |= *data; - } - csum ^= ul; - - return csum; -} - -int decompress(struct file *fi, int savemode, int fix) { - ULONG bytes = savemode ? fi->length : fi->offset - CAB(offset); - struct cabinet *cab = CAB(current)->cab[CAB(split)]; - UBYTE buf[cfdata_SIZEOF], *data; - UWORD inlen, len, outlen, cando; - ULONG cksum; - LONG err; - - while (bytes > 0) { - /* cando = the max number of bytes we can do */ - cando = CAB(outlen); - if (cando > bytes) cando = bytes; - - /* if cando != 0 */ - if (cando && savemode) file_write(fi, CAB(outpos), cando); - - CAB(outpos) += cando; - CAB(outlen) -= cando; - bytes -= cando; if (!bytes) break; - - /* we only get here if we emptied the output buffer */ - - /* read data header + data */ - inlen = outlen = 0; - while (outlen == 0) { - /* read the block header, skip the reserved part */ - if (!cabinet_read(cab, buf, cfdata_SIZEOF)) return DECR_INPUT; - cabinet_skip(cab, cab->block_resv); - - /* we shouldn't get blocks over CAB_INPUTMAX in size */ - data = CAB(inbuf) + inlen; - len = EndGetI16(buf+cfdata_CompressedSize); - inlen += len; - if (inlen > CAB_INPUTMAX) return DECR_INPUT; - if (!cabinet_read(cab, data, len)) return DECR_INPUT; - - /* clear two bytes after read-in data */ - data[len+1] = data[len+2] = 0; - - /* perform checksum test on the block (if one is stored) */ - cksum = EndGetI32(buf+cfdata_CheckSum); - if (cksum && cksum != checksum(buf+4, 4, checksum(data, len, 0))) { - /* checksum is wrong */ - if (fix && ((fi->folder->comp_type & cffoldCOMPTYPE_MASK) - == cffoldCOMPTYPE_MSZIP)) - { - fprintf(stderr, "%s: WARNING; checksum failed\n", fi->filename); - } - else { - return DECR_CHECKSUM; - } - } - - /* outlen=0 means this block was part of a split block */ - outlen = EndGetI16(buf+cfdata_UncompressedSize); - if (outlen == 0) { - cabinet_close(cab); - cab = CAB(current)->cab[++CAB(split)]; - if (!cabinet_open(cab)) return DECR_INPUT; - cabinet_seek(cab, CAB(current)->offset[CAB(split)]); - } - } - - /* decompress block */ - if ((err = CAB(decompress)(inlen, outlen))) { - if (fix && ((fi->folder->comp_type & cffoldCOMPTYPE_MASK) - == cffoldCOMPTYPE_MSZIP)) - { - fprintf(stderr, "%s: WARNING; failed decrunching block\n", - fi->filename); - } - else { - return err; - } - } - CAB(outlen) = outlen; - CAB(outpos) = CAB(outbuf); - } - - return DECR_OK; -} - - -void extract_file(struct file *fi, int lower, int fix, char *dir) { - struct folder *fol = fi->folder, *oldfol = CAB(current); - LONG err = DECR_OK; - - /* is a change of folder needed? do we need to reset the current folder? */ - if (fol != oldfol || fi->offset < CAB(offset)) { - UWORD comptype = fol->comp_type; - int ct1 = comptype & cffoldCOMPTYPE_MASK; - int ct2 = oldfol ? (oldfol->comp_type & cffoldCOMPTYPE_MASK) : 0; - - /* if the archiver has changed, call the old archiver's free() function */ - if (ct1 != ct2) { - switch (ct2) { - case cffoldCOMPTYPE_LZX: - if (LZX(window)) { - free(LZX(window)); - LZX(window) = NULL; - } - break; - case cffoldCOMPTYPE_QUANTUM: - if (QTM(window)) { - free(QTM(window)); - QTM(window) = NULL; - } - break; - } - } - - switch (ct1) { - case cffoldCOMPTYPE_NONE: - CAB(decompress) = NONEdecompress; - break; - - case cffoldCOMPTYPE_MSZIP: - CAB(decompress) = ZIPdecompress; - break; - - case cffoldCOMPTYPE_QUANTUM: - CAB(decompress) = QTMdecompress; - err = QTMinit((comptype >> 8) & 0x1f, (comptype >> 4) & 0xF); - break; - - case cffoldCOMPTYPE_LZX: - CAB(decompress) = LZXdecompress; - err = LZXinit((comptype >> 8) & 0x1f); - break; - - default: - err = DECR_DATAFORMAT; - } - if (err) goto exit_handler; - - /* initialisation OK, set current folder and reset offset */ - if (oldfol) cabinet_close(oldfol->cab[CAB(split)]); - if (!cabinet_open(fol->cab[0])) goto exit_handler; - cabinet_seek(fol->cab[0], fol->offset[0]); - CAB(current) = fol; - CAB(offset) = 0; - CAB(outlen) = 0; /* discard existing block */ - CAB(split) = 0; - } - - if (fi->offset > CAB(offset)) { - /* decode bytes and send them to /dev/null */ - if ((err = decompress(fi, 0, fix))) goto exit_handler; - CAB(offset) = fi->offset; - } - if (!file_open(fi, lower, dir)) return; - err = decompress(fi, 1, fix); - if (err) CAB(current) = NULL; else CAB(offset) += fi->length; - file_close(fi); - -exit_handler: - if (err) { - char *errmsg, *cabname; - switch (err) { - case DECR_NOMEMORY: - errmsg = "out of memory!\n"; break; - case DECR_ILLEGALDATA: - errmsg = "%s: illegal or corrupt data\n"; break; - case DECR_DATAFORMAT: - errmsg = "%s: unsupported data format\n"; break; - case DECR_CHECKSUM: - errmsg = "%s: checksum error\n"; break; - case DECR_INPUT: - errmsg = "%s: input error\n"; break; - case DECR_OUTPUT: - errmsg = "%s: output error\n"; break; - default: - errmsg = "%s: unknown error (BUG)\n"; - } - - if (CAB(current)) { - cabname = CAB(current)->cab[CAB(split)]->filename; - } - else { - cabname = fi->folder->cab[0]->filename; - } - - fprintf(stderr, errmsg, cabname); - } -} - -/* tries to find *cabname, from the directory path of origcab, correcting the - * case of *cabname if necessary, If found, writes back to *cabname. - */ -void find_cabinet_file(char **cabname, char *origcab) { - char *tail, *cab, *name, *nextpart; - struct dirent *entry; - struct stat st_buf; - int found = 0, len; - DIR *dir; - - /* ensure we have a cabinet name at all */ - if (!(name = *cabname)) return; - - /* find if there's a directory path in the origcab */ - tail = origcab ? strrchr(origcab, '/') : NULL; - - if ((cab = (char *) malloc((tail ? tail-origcab : 1) + strlen(name) + 2))) { - /* add the directory path from the original cabinet name */ - if (tail) { - memcpy(cab, origcab, tail-origcab); - cab[tail-origcab] = '\0'; - } - else { - /* default directory path of '.' */ - cab[0] = '.'; - cab[1] = '\0'; - } - - do { - /* we don't want null cabinet filenames */ - if (name[0] == '\0') break; - - /* if there is a directory component in the cabinet name, - * look for that alone first - */ - nextpart = strchr(name, '\\'); - if (nextpart) *nextpart = '\0'; - - /* try accessing the component with its current name (case-sensitive) */ - len = strlen(cab); strcat(cab, "/"); strcat(cab, name); - found = (stat(cab, &st_buf) == 0) && - nextpart ? S_ISDIR(st_buf.st_mode) : S_ISREG(st_buf.st_mode); - - /* if the component was not found, look for it in the current dir */ - if (!found) { - cab[len] = '\0'; - if ((dir = opendir(cab))) { - while ((entry = readdir(dir))) { - if (strcasecmp(name, entry->d_name) == 0) { - strcat(cab, "/"); strcat(cab, entry->d_name); found = 1; - } - } - closedir(dir); - } - } - - /* restore the real name and skip to the next directory component - * or actual cabinet name - */ - if (nextpart) *nextpart = '\\', name = &nextpart[1]; - - /* while there is another directory component, and while we - * successfully found the current component - */ - } while (nextpart && found); - - - /* if we found the cabinet, change the next cabinet's name. - * otherwise, pretend nothing happened - */ - if (found) { - free((void *) *cabname); - *cabname = cab; - } - else { - free((void *) cab); - } - } -} - -/* process_cabinet() is called by main() for every file listed on the - * command line. It will find every cabinet file in that file, and will - * search for every chained cabinet attached to those cabinets, then it - * will either extract or list the cabinet(s). Returns 0 for success or 1 - * for failure (unlike most cabextract functions). - */ -int process_cabinet(char *cabname, char *dir, - int fix, int view, int lower, int quiet) { - - struct cabinet *basecab, *cab, *cab1, *cab2; - struct file *filelist, *fi; - - /* has the list-mode header been seen before? */ - int viewhdr = 0; - - if (view || !quiet) { - printf("%s cabinet: %s\n", view ? "Viewing" : "Extracting", cabname); - } - - /* load the file requested */ - basecab = find_cabs_in_file(cabname); - if (!basecab) return 1; - - /* iterate over all cabinets found in that file */ - for (cab = basecab; cab; cab=cab->next) { - - /* bi-directionally load any spanning cabinets -- backwards */ - for (cab1 = cab; cab1->flags & cfheadPREV_CABINET; cab1 = cab1->prevcab) { - if (!quiet) printf("%s: extends backwards to %s (%s)\n", cabname, - cab1->prevname, cab1->previnfo); - find_cabinet_file(&(cab1->prevname), cabname); - if (!(cab1->prevcab = load_cab_offset(cab1->prevname, 0))) { - fprintf(stderr, "%s: can't read previous cabinet %s\n", - cabname, cab1->prevname); - break; - } - cab1->prevcab->nextcab = cab1; - } - - /* bi-directionally load any spanning cabinets -- forwards */ - for (cab2 = cab; cab2->flags & cfheadNEXT_CABINET; cab2 = cab2->nextcab) { - if (!quiet) printf("%s: extends to %s (%s)\n", cabname, - cab2->nextname, cab2->nextinfo); - find_cabinet_file(&(cab2->nextname), cabname); - if (!(cab2->nextcab = load_cab_offset(cab2->nextname, 0))) { - fprintf(stderr, "%s: can't read next cabinet %s\n", - cabname, cab2->nextname); - break; - } - cab2->nextcab->prevcab = cab2; - } - - filelist = process_files(cab1); - CAB(current) = NULL; - - if (view && !viewhdr) { - printf("File size | Date Time | Name\n"); - printf("----------+---------------------+-------------\n"); - viewhdr = 1; - } - for (fi = filelist; fi; fi = fi->next) { - if (view) { - print_fileinfo(fi); - } - else { - if (!quiet) printf(" extracting: %s\n", fi->filename); - extract_file(fi, lower, fix, dir); - } - } - } - - if (view) printf("\n"); - else if (!quiet) printf("Finished processing cabinet.\n\n"); - return 0; -} - - -struct option opts[] = { - { "version", 0, NULL, 'v' }, - { "help", 0, NULL, 'h' }, - { "list", 0, NULL, 'l' }, - { "quiet", 0, NULL, 'q' }, - { "lowercase", 0, NULL, 'L' }, - { "fix", 0, NULL, 'f' }, - { "directory", 1, NULL, 'd' }, - { NULL, 0, NULL, 0 } -}; - -int main(int argc, char *argv[]) { - int help=0, list=0, lower=0, view=0, quiet=0, fix=0, x, err=0; - char *dir = NULL; - while ((x = getopt_long(argc, argv, "vhlqLfd:", opts, NULL)) != -1) { - switch (x) { - case 'v': view = 1; break; - case 'h': help = 1; break; - case 'l': list = 1; break; - case 'q': quiet = 1; break; - case 'L': lower = 1; break; - case 'f': fix = 1; break; - case 'd': dir = optarg; break; - } - } - - if (help) { - fprintf(stderr, - "Usage: %s [options] [-d dir] \n\n" - "This will extract all files from a cabinet or executable cabinet.\n" - "For multi-part cabinets, only specify the first file in the set.\n\n" - "Options:\n" - " -v --version print version / list cabinet\n" - " -h --help show this help page\n" - " -l --list list contents of cabinet\n" - " -q --quiet only print errors and warnings\n" - " -L --lowercase make filenames lowercase\n" - " -f --fix fix (some) corrupted cabinets\n" - " -d --directory extract all files to the given directory\n\n" - "cabextract %s (C) 2000-2002 Stuart Caie \n" - "This is free software with ABSOLUTELY NO WARRANTY.\n", - argv[0], VERSION - ); - return 1; - } - - if (optind == argc) { - /* no arguments other than the options */ - if (view) { - printf("cabextract version %s\n", VERSION); - return 0; - } - else { - fprintf(stderr, "cabextract: No cabinet files specified.\n" - "Try '%s --help' for more information.\n", argv[0]); - return 1; - } - } - - while (optind != argc) { - err |= process_cabinet(argv[optind++], dir, fix, view||list, lower, quiet); - } - - return err; -} diff --git a/src/install/acquire/cabextract/cabextract.spec b/src/install/acquire/cabextract/cabextract.spec deleted file mode 100644 index 537270e..0000000 --- a/src/install/acquire/cabextract/cabextract.spec +++ /dev/null @@ -1,35 +0,0 @@ -Summary: a program to extract Microsoft Cabinet files -Name: cabextract -Version: 0.6 -Release: 1 -Group: Applications/Archiving -Copyright: GPL -Source: http://www.kyz.uklinux.net/downloads/%{name}-%{version}.tar.gz -URL: http://www.kyz.uklinux.net/cabextract.php3 -BuildRoot: %{_tmppath}/%{name}-%{version}-root -Prefix: /usr - -%description -Cabinet (.CAB) files are a form of archive, which Microsoft use to -distribute their software, and things like Windows Font Packs. The -cabextract program simply unpacks such files. - -%prep -%setup - -%build -CFLAGS=${RPM_OPT_FLAGS} ./configure --prefix=%{prefix} -make - -%install -rm -rf ${RPM_BUILD_ROOT} -%makeinstall - -%clean -rm -rf ${RPM_BUILD_ROOT} - -%files -%defattr(0644, root, root, 0755) -%doc AUTHORS ChangeLog NEWS README -%attr(0755, root, root) %{_bindir}/cabextract -%{_mandir}/man1/cabextract.1* diff --git a/src/install/acquire/cabextract/cabextract.spec.in b/src/install/acquire/cabextract/cabextract.spec.in deleted file mode 100644 index f0c7128..0000000 --- a/src/install/acquire/cabextract/cabextract.spec.in +++ /dev/null @@ -1,35 +0,0 @@ -Summary: a program to extract Microsoft Cabinet files -Name: cabextract -Version: @VERSION@ -Release: 1 -Group: Applications/Archiving -Copyright: GPL -Source: http://www.kyz.uklinux.net/downloads/%{name}-%{version}.tar.gz -URL: http://www.kyz.uklinux.net/cabextract.php3 -BuildRoot: %{_tmppath}/%{name}-%{version}-root -Prefix: /usr - -%description -Cabinet (.CAB) files are a form of archive, which Microsoft use to -distribute their software, and things like Windows Font Packs. The -cabextract program simply unpacks such files. - -%prep -%setup - -%build -CFLAGS=${RPM_OPT_FLAGS} ./configure --prefix=%{prefix} -make - -%install -rm -rf ${RPM_BUILD_ROOT} -%makeinstall - -%clean -rm -rf ${RPM_BUILD_ROOT} - -%files -%defattr(0644, root, root, 0755) -%doc AUTHORS ChangeLog NEWS README -%attr(0755, root, root) %{_bindir}/cabextract -%{_mandir}/man1/cabextract.1* diff --git a/src/install/acquire/cabextract/cabinfo.c b/src/install/acquire/cabextract/cabinfo.c deleted file mode 100644 index dd48cd7..0000000 --- a/src/install/acquire/cabextract/cabinfo.c +++ /dev/null @@ -1,497 +0,0 @@ -/* cabinfo -- dumps useful information from cabinets - * (C) 2000 Stuart Caie - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include - -/* structure offsets */ -#define cfhead_Signature (0x00) -#define cfhead_CabinetSize (0x08) -#define cfhead_FileOffset (0x10) -#define cfhead_MinorVersion (0x18) -#define cfhead_MajorVersion (0x19) -#define cfhead_NumFolders (0x1A) -#define cfhead_NumFiles (0x1C) -#define cfhead_Flags (0x1E) -#define cfhead_SetID (0x20) -#define cfhead_CabinetIndex (0x22) -#define cfhead_SIZEOF (0x24) -#define cfheadext_HeaderReserved (0x00) -#define cfheadext_FolderReserved (0x02) -#define cfheadext_DataReserved (0x03) -#define cfheadext_SIZEOF (0x04) -#define cffold_DataOffset (0x00) -#define cffold_NumBlocks (0x04) -#define cffold_CompType (0x06) -#define cffold_SIZEOF (0x08) -#define cffile_UncompressedSize (0x00) -#define cffile_FolderOffset (0x04) -#define cffile_FolderIndex (0x08) -#define cffile_Date (0x0A) -#define cffile_Time (0x0C) -#define cffile_Attribs (0x0E) -#define cffile_SIZEOF (0x10) -#define cfdata_CheckSum (0x00) -#define cfdata_CompressedSize (0x04) -#define cfdata_UncompressedSize (0x06) -#define cfdata_SIZEOF (0x08) - -/* flags */ -#define cffoldCOMPTYPE_MASK (0x000f) -#define cffoldCOMPTYPE_NONE (0x0000) -#define cffoldCOMPTYPE_MSZIP (0x0001) -#define cffoldCOMPTYPE_QUANTUM (0x0002) -#define cffoldCOMPTYPE_LZX (0x0003) -#define cfheadPREV_CABINET (0x0001) -#define cfheadNEXT_CABINET (0x0002) -#define cfheadRESERVE_PRESENT (0x0004) -#define cffileCONTINUED_FROM_PREV (0xFFFD) -#define cffileCONTINUED_TO_NEXT (0xFFFE) -#define cffileCONTINUED_PREV_AND_NEXT (0xFFFF) -#define cffile_A_RDONLY (0x01) -#define cffile_A_HIDDEN (0x02) -#define cffile_A_SYSTEM (0x04) -#define cffile_A_ARCH (0x20) -#define cffile_A_EXEC (0x40) -#define cffile_A_NAME_IS_UTF (0x80) - - -FILE *fh; -char *filename; -unsigned long filelength; -void search(); -void getinfo(); - -#define EndGetI32(a) ((((a)[3])<<24)|(((a)[2])<<16)|(((a)[1])<<8)|((a)[0])) -#define EndGetI16(a) ((((a)[1])<<8)|((a)[0])) -#define GETLONG(n) EndGetI32(&buf[n]) -#define GETWORD(n) EndGetI16(&buf[n]) -#define GETBYTE(n) ((int)buf[n]) - -#define GETOFFSET (ftell(fh)) -#define READ(buf,len) if (myread((void *)(buf),(len))) return -#define SKIP(offset) if (myseek((offset),SEEK_CUR)) return -#define SEEK(offset) if (myseek((offset),SEEK_SET)) return - - - -int myread(void *buf, int length) { - int remain = filelength - GETOFFSET; - if (length > remain) length = remain; - if (fread(buf, 1, length, fh) != length) { - perror(filename); - return 1; - } - return 0; -} - -int myseek(unsigned long offset, int mode) { - if (fseek(fh, offset, mode) != 0) { - perror(filename); - return 1; - } - return 0; -} - -int main(int argc, char *argv[]) { - printf("Cabinet information dumper by Stuart Caie \n"); - - if (argc <= 1) { - printf("Usage: %s \n", argv[0]); - return 1; - } - - if (!(fh = fopen((filename = argv[1]), "rb"))) { - perror(filename); - return 1; - } - - if (fseek(fh, 0, SEEK_END) != 0) { - perror(filename); - fclose(fh); - return 1; - } - - filelength = (unsigned long) ftell(fh); - - if (fseek(fh, 0, SEEK_SET) != 0) { - perror(filename); - fclose(fh); - return 1; - } - - printf("Examining file \"%s\" (%u bytes)...\n", filename, filelength); - search(); - fclose(fh); - return 0; -} - - -#define SEARCH_SIZE (32*1024) -unsigned char search_buf[SEARCH_SIZE]; - -void search() { - unsigned char *pstart = &search_buf[0], *pend, *p; - unsigned long offset, caboff, cablen, foffset; - size_t length; - int state = 0; - - for (offset = 0; offset < filelength; offset += length) { - /* search length is either the full length of the search buffer, - * or the amount of data remaining to the end of the file, - * whichever is less. - */ - length = filelength - offset; - if (length > SEARCH_SIZE) length = SEARCH_SIZE; - - /* fill the search buffer with data from disk */ - SEEK(offset); - READ(&search_buf[0], length); - /* read through the entire buffer. */ - p = pstart; - pend = &search_buf[length]; - while (p < pend) { - switch (state) { - /* starting state */ - case 0: - /* we spend most of our time in this while loop, looking for - * a leading 'M' of the 'MSCF' signature - */ - while (*p++ != 0x4D && p < pend); - if (p < pend) state = 1; /* if we found tht 'M', advance state */ - break; - - /* verify that the next 3 bytes are 'S', 'C' and 'F' */ - case 1: state = (*p++ == 0x53) ? 2 : 0; break; - case 2: state = (*p++ == 0x43) ? 3 : 0; break; - case 3: state = (*p++ == 0x46) ? 4 : 0; break; - - /* we don't care about bytes 4-7 */ - /* bytes 8-11 are the overall length of the cabinet */ - case 8: cablen = *p++; state++; break; - case 9: cablen |= *p++ << 8; state++; break; - case 10: cablen |= *p++ << 16; state++; break; - case 11: cablen |= *p++ << 24; state++; break; - - /* we don't care about bytes 12-15 */ - /* bytes 16-19 are the offset within the cabinet of the filedata */ - case 16: foffset = *p++; state++; break; - case 17: foffset |= *p++ << 8; state++; break; - case 18: foffset |= *p++ << 16; state++; break; - case 19: foffset |= *p++ << 24; - /* now we have recieved 20 bytes of potential cab header. */ - /* work out the offset in the file of this potential cabinet */ - caboff = offset + (p-pstart) - 20; - /* check that the files offset is less than the alleged length - * of the cabinet, and that the offset + the alleged length are - * 'roughly' within the end of overall file length - */ - if ((foffset < cablen) && - ((caboff + foffset) < (filelength + 32)) && - ((caboff + cablen) < (filelength + 32)) ) - { - /* found a potential result - try loading it */ - printf("Found cabinet header at offset %u\n", caboff); - SEEK(caboff); - getinfo(); - offset = caboff + cablen; - length = 0; - p = pend; - } - state = 0; - break; - - default: - p++, state++; break; - } /* switch state */ - } /* while p < pend */ - } /* while offset < filelength */ -} - - - - - -#define CAB_NAMEMAX (1024) - -/* UTF translates two-byte unicode characters into 1, 2 or 3 bytes. - * %000000000xxxxxxx -> %0xxxxxxx - * %00000xxxxxyyyyyy -> %110xxxxx %10yyyyyy - * %xxxxyyyyyyzzzzzz -> %1110xxxx %10yyyyyy %10zzzzzz - * - * Therefore, the inverse is as follows: - * First char: - * 0x00 - 0x7F = one byte char - * 0x80 - 0xBF = invalid - * 0xC0 - 0xDF = 2 byte char (next char only 0x80-0xBF is valid) - * 0xE0 - 0xEF = 3 byte char (next 2 chars only 0x80-0xBF is valid) - * 0xF0 - 0xFF = invalid - */ - -/* translate UTF -> ASCII */ -int convertUTF(unsigned char *in) { - unsigned char c, *out = in, *end = in + strlen(in) + 1; - unsigned int x; - - do { - /* read unicode character */ - if ((c = *in++) < 0x80) x = c; - else { - if (c < 0xC0) return 0; - else if (c < 0xE0) { - x = (c & 0x1F) << 6; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F); - } - else if (c < 0xF0) { - x = (c & 0xF) << 12; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F)<<6; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F); - } - else return 0; - } - - /* terrible unicode -> ASCII conversion */ - if (x > 127) x = '_'; - - if (in > end) return 0; /* just in case */ - } while ((*out++ = (unsigned char) x)); - return 1; -} - - - -void getinfo() { - unsigned char buf[64]; - unsigned char namebuf[CAB_NAMEMAX]; - char *name; - - int num_folders, num_files, num_blocks = 0; - int header_res = 0, folder_res = 0, data_res = 0; - int i, x, offset, base_offset, files_offset, base; - - base_offset = GETOFFSET; - - READ(&buf, cfhead_SIZEOF); - - x = GETWORD(cfhead_Flags); - - printf( - "\n*** HEADER SECTION ***\n\n" - "Cabinet signature = '%4.4s'\n" - "Cabinet size = %u bytes\n" - "Offset of files = %u\n" - "Cabinet format version = %d.%d\n" - "Number of folders = %u\n" - "Number of files = %u\n" - "Header flags = 0x%04x%s%s%s\n" - "Set ID = %u\n" - "Cabinet set index = %u\n", - - buf, - GETLONG(cfhead_CabinetSize), - files_offset = (GETLONG(cfhead_FileOffset) + base_offset), - GETBYTE(cfhead_MajorVersion), - GETBYTE(cfhead_MinorVersion), - num_folders = GETWORD(cfhead_NumFolders), - num_files = GETWORD(cfhead_NumFiles), - x, - ((x & cfheadPREV_CABINET) ? " PREV_CABINET" : ""), - ((x & cfheadNEXT_CABINET) ? " NEXT_CABINET" : ""), - ((x & cfheadRESERVE_PRESENT) ? " RESERVE_PRESENT" : ""), - GETWORD(cfhead_SetID), - GETWORD(cfhead_CabinetIndex) - ); - - if (num_folders == 0) { printf("ERROR: no folders\n"); return; } - if (num_files == 0) { printf("ERROR: no files\n"); return; } - - if (buf[0]!='M' || buf[1]!='S' || buf[2]!='C' || buf[3]!='F') - printf("WARNING: cabinet doesn't start with MSCF signature\n"); - - if (GETBYTE(cfhead_MajorVersion) > 1 - || GETBYTE(cfhead_MinorVersion) > 3) - printf("WARNING: format version > 1.3\n"); - - - - if (x & cfheadRESERVE_PRESENT) { - READ(&buf, cfheadext_SIZEOF); - header_res = GETWORD(cfheadext_HeaderReserved); - folder_res = GETBYTE(cfheadext_FolderReserved); - data_res = GETBYTE(cfheadext_DataReserved); - } - - printf("Reserved header space = %u\n", header_res); - printf("Reserved folder space = %u\n", folder_res); - printf("Reserved datablk space = %u\n", data_res); - - if (header_res > 60000) - printf("WARNING: header reserved space > 60000\n"); - - if (header_res) { - printf("[Reserved header: offset %lu, size %u]\n", GETOFFSET, header_res); - SKIP(header_res); - } - - if (x & cfheadPREV_CABINET) { - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - printf("Previous cabinet file = %s\n", namebuf); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - printf("Previous disk name = %s\n", namebuf); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - } - - if (x & cfheadNEXT_CABINET) { - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - printf("Next cabinet file = %s\n", namebuf); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - printf("Next disk name = %s\n", namebuf); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - } - - printf("\n*** FOLDERS SECTION ***\n"); - - for (i = 0; i < num_folders; i++) { - offset = GETOFFSET; - READ(&buf, cffold_SIZEOF); - - switch(GETWORD(cffold_CompType) & cffoldCOMPTYPE_MASK) { - case cffoldCOMPTYPE_NONE: name = "stored"; break; - case cffoldCOMPTYPE_MSZIP: name = "MSZIP"; break; - case cffoldCOMPTYPE_QUANTUM: name = "Quantum"; break; - case cffoldCOMPTYPE_LZX: name = "LZX"; break; - default: name = "unknown"; break; - } - - printf( - "\n[New folder at offset %u]\n" - "Offset of folder = %u\n" - "Num. blocks in folder = %u\n" - "Compression type = 0x%04x [%s]\n", - - offset, - base_offset + GETLONG(cffold_DataOffset), - GETWORD(cffold_NumBlocks), - GETWORD(cffold_CompType), - name - ); - - num_blocks += GETWORD(cffold_NumBlocks); - - if (folder_res) { - printf("[Reserved folder: offset %lu, size %u]\n", GETOFFSET, folder_res); - SKIP(folder_res); - } - } - - printf("\n*** FILES SECTION ***\n"); - - if (GETOFFSET != files_offset) { - printf("WARNING: weird file offset in header\n"); - SEEK(files_offset); - } - - - for (i = 0; i < num_files; i++) { - offset = GETOFFSET; - READ(&buf, cffile_SIZEOF); - - switch (GETWORD(cffile_FolderIndex)) { - case cffileCONTINUED_PREV_AND_NEXT: - name = "continued from previous and to next cabinet"; - break; - case cffileCONTINUED_FROM_PREV: - name = "continued from previous cabinet"; - break; - case cffileCONTINUED_TO_NEXT: - name = "continued to next cabinet"; - break; - default: - name = "normal folder"; - break; - } - - x = GETWORD(cffile_Attribs); - - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - - /* convert filename */ - if (x & cffile_A_NAME_IS_UTF) { - if (!convertUTF(namebuf)) printf("WARNING: invalid UTF filename"); - } - - printf( - "\n[New file at offset %u]\n" - "File name = %s\n" - "File size = %u bytes\n" - "Offset within folder = %u\n" - "Folder index = 0x%04x [%s]\n" - "Date / time = %02d/%02d/%4d %02d:%02d:%02d\n" - "File attributes = 0x%02x %s%s%s%s%s\n", - offset, - namebuf, - GETLONG(cffile_UncompressedSize), - GETLONG(cffile_FolderOffset), - GETWORD(cffile_FolderIndex), - name, - GETWORD(cffile_Date) & 0x1f, - (GETWORD(cffile_Date)>>5) & 0xf, - (GETWORD(cffile_Date)>>9) + 1980, - GETWORD(cffile_Time) >> 11, - (GETWORD(cffile_Time)>>5) & 0x3f, - (GETWORD(cffile_Time) << 1) & 0x3e, - x, - (x & cffile_A_RDONLY) ? "RDONLY " : "", - (x & cffile_A_HIDDEN) ? "HIDDEN " : "", - (x & cffile_A_SYSTEM) ? "SYSTEM " : "", - (x & cffile_A_ARCH) ? "ARCH " : "", - (x & cffile_A_EXEC) ? "EXEC " : "" - ); - } - - printf("\n*** DATABLOCKS SECTION ***\n"); - printf("*** Note: offset is BLOCK offset. Add 8 for DATA offset! ***\n\n"); - - for (i = 0; i < num_blocks; i++) { - offset = GETOFFSET; - READ(&buf, cfdata_SIZEOF); - printf("Block %5d: offset %10d / csum %08x / c=%5d / u=%5d\n", - i, offset, GETLONG(cfdata_CheckSum), - x = GETWORD(cfdata_CompressedSize), - GETWORD(cfdata_UncompressedSize) - ); - SKIP(x); - } - -} diff --git a/src/install/acquire/cabextract/config.h.in b/src/install/acquire/cabextract/config.h.in deleted file mode 100644 index eba9169..0000000 --- a/src/install/acquire/cabextract/config.h.in +++ /dev/null @@ -1,89 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* Define to `int' if doesn't define. */ -#undef mode_t - -/* Define to `long' if doesn't define. */ -#undef off_t - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define if you have the getopt_long function. */ -#undef HAVE_GETOPT_LONG - -/* Define if you have the memcpy function. */ -#undef HAVE_MEMCPY - -/* Define if you have the mktime function. */ -#undef HAVE_MKTIME - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the strchr function. */ -#undef HAVE_STRCHR - -/* Define if you have the utime function. */ -#undef HAVE_UTIME - -/* Define if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the header file. */ -#undef HAVE_GETOPT_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_DIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define if you have the header file. */ -#undef HAVE_UTIME_H - -/* Name of package */ -#undef PACKAGE - -/* Version number of package */ -#undef VERSION - diff --git a/src/install/acquire/cabextract/configure b/src/install/acquire/cabextract/configure deleted file mode 100755 index c2dbc06..0000000 --- a/src/install/acquire/cabextract/configure +++ /dev/null @@ -1,2302 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=cabextract.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:559: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:612: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:669: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE=cabextract - -VERSION=0.6 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:715: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:728: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:741: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:754: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:767: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:784: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:814: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:865: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:897: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 908 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:939: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:944: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:972: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1015: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1068: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1101: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1132: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.$ac_ext | *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi - -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT - - - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1165: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1245: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1349: checking whether time.h and sys/time.h may both be included" >&5 -if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -int main() { -struct tm *tp; -; return 0; } -EOF -if { (eval echo configure:1363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_header_time=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_time=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_time" 1>&6 -if test $ac_cv_header_time = yes; then - cat >> confdefs.h <<\EOF -#define TIME_WITH_SYS_TIME 1 -EOF - -fi - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1388: checking for $ac_hdr that defines DIR" >&5 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include <$ac_hdr> -int main() { -DIR *dirp = 0; -; return 0; } -EOF -if { (eval echo configure:1401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1426: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 -fi - -else -echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1467: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lx $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lx" -else - echo "$ac_t""no" 1>&6 -fi - -fi - -for ac_hdr in ctype.h limits.h stdlib.h string.h strings.h \ - utime.h sys/stat.h sys/time.h sys/types.h getopt.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1513: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1551: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:1605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1626: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_inline=$ac_kw; break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -done - -fi - -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in - inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline -EOF - ;; - *) cat >> confdefs.h <&6 -echo "configure:1666: checking for mode_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_mode_t=yes -else - rm -rf conftest* - ac_cv_type_mode_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_mode_t" 1>&6 -if test $ac_cv_type_mode_t = no; then - cat >> confdefs.h <<\EOF -#define mode_t int -EOF - -fi - -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1699: checking for off_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_off_t=yes -else - rm -rf conftest* - ac_cv_type_off_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF -#define off_t long -EOF - -fi - -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1732: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF - -fi - - -for ac_func in strchr strcasecmp memcpy utime -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1768: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -fi -done - -for ac_func in mktime -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1823: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" -fi -done - - - -for ac_func in getopt_long -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1881: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS getopt.o getopt1.o" -fi -done - - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile cabextract.spec config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@EXEEXT@%$EXEEXT%g -s%@CPP@%$CPP%g -s%@LIBOBJS@%$LIBOBJS%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/src/install/acquire/cabextract/configure.in b/src/install/acquire/cabextract/configure.in deleted file mode 100644 index 14531a8..0000000 --- a/src/install/acquire/cabextract/configure.in +++ /dev/null @@ -1,34 +0,0 @@ -.dnl Process this file with autoconf to produce a configure script. -AC_INIT(cabextract.c) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(cabextract, 0.6) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_INSTALL -AC_EXEEXT - -dnl Checks for libraries. - -dnl Checks for header files. -AC_HEADER_STDC -AC_HEADER_TIME -AC_HEADER_DIRENT -AC_CHECK_HEADERS(ctype.h limits.h stdlib.h string.h strings.h \ - utime.h sys/stat.h sys/time.h sys/types.h getopt.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_C_INLINE -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_CHECK_FUNCS(strchr strcasecmp memcpy utime) -AC_REPLACE_FUNCS(mktime) - -dnl check for getopt in standard library -AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) - -AC_OUTPUT(Makefile cabextract.spec) diff --git a/src/install/acquire/cabextract/debian/README.Debian b/src/install/acquire/cabextract/debian/README.Debian deleted file mode 100644 index 5c285db..0000000 --- a/src/install/acquire/cabextract/debian/README.Debian +++ /dev/null @@ -1,6 +0,0 @@ -cabextract for Debian ----------------------- - -This was packaged for debian to help msttcorefonts work better. - - -- Eric Sharkey , Thu, 11 Jan 2001 13:05:48 -0500 diff --git a/src/install/acquire/cabextract/debian/changelog b/src/install/acquire/cabextract/debian/changelog deleted file mode 100644 index 29983f8..0000000 --- a/src/install/acquire/cabextract/debian/changelog +++ /dev/null @@ -1,45 +0,0 @@ -cabextract (0.6-1) unstable; urgency=low - - * New upstream release - - -- Stuart Caie Mon, 29 Jul 2002 13:31:37 +0100 - -cabextract (0.5-1) unstable; urgency=low - - * New upstream release (Closes: #123961) - - -- Eric Sharkey Mon, 6 May 2002 20:07:25 -0400 - -cabextract (0.2-2) unstable; urgency=low - - * Specify path to configure script (Closes: #89269) - - -- Eric Sharkey Sun, 11 Mar 2001 22:17:10 -0500 - -cabextract (0.2-1) unstable; urgency=low - - * New Upstream Release - - -- Eric Sharkey Tue, 6 Mar 2001 11:55:58 -0500 - -cabextract (0.1-3) unstable; urgency=low - - * Fix grammar: Closes: #82794 - - -- Eric Sharkey Fri, 26 Jan 2001 15:16:55 -0500 - -cabextract (0.1-2) unstable; urgency=low - - * Ignore documentation in New Maintainer's guide and install into - debian/cabextract rather than debian/tmp - * Closes: #83237 - - -- Eric Sharkey Wed, 24 Jan 2001 15:50:30 -0500 - -cabextract (0.1-1) unstable; urgency=low - - * Initial Release. - * Closes: 81492 - - -- Eric Sharkey Thu, 11 Jan 2001 13:05:48 -0500 - diff --git a/src/install/acquire/cabextract/debian/control b/src/install/acquire/cabextract/debian/control deleted file mode 100644 index 92cb470..0000000 --- a/src/install/acquire/cabextract/debian/control +++ /dev/null @@ -1,14 +0,0 @@ -Source: cabextract -Section: utils -Priority: extra -Maintainer: Eric Sharkey -Build-Depends: debhelper (>> 2.0.0) -Standards-Version: 3.2.1 - -Package: cabextract -Architecture: any -Depends: ${shlibs:Depends} -Description: a program to extract Microsoft Cabinet files - Cabextract is a program which unpacks cabinet (.cab) files, which - are a form of archive Microsoft uses to distribute their software - and things like Windows Font Packs. diff --git a/src/install/acquire/cabextract/debian/copyright b/src/install/acquire/cabextract/debian/copyright deleted file mode 100644 index c4be8f9..0000000 --- a/src/install/acquire/cabextract/debian/copyright +++ /dev/null @@ -1,13 +0,0 @@ -This package was debianized by Eric Sharkey on -Thu, 11 Jan 2001 13:05:48 -0500. - -It was downloaded from http://www.kyz.uklinux.net/cabextract.php3 - -Upstream Author(s): Stuart Caie - -Copyright: - -You are free to distribute this software under the terms of -the GNU General Public License. -On Debian systems, the complete text of the GNU General Public -License can be found in /usr/share/common-licenses/GPL file. diff --git a/src/install/acquire/cabextract/debian/dirs b/src/install/acquire/cabextract/debian/dirs deleted file mode 100644 index adee15e..0000000 --- a/src/install/acquire/cabextract/debian/dirs +++ /dev/null @@ -1,5 +0,0 @@ -usr -usr/bin -usr/share -usr/share/doc -usr/share/doc/cabextract diff --git a/src/install/acquire/cabextract/debian/docs b/src/install/acquire/cabextract/debian/docs deleted file mode 100644 index 86dfdb8..0000000 --- a/src/install/acquire/cabextract/debian/docs +++ /dev/null @@ -1,3 +0,0 @@ -README -NEWS -AUTHORS diff --git a/src/install/acquire/cabextract/debian/rules b/src/install/acquire/cabextract/debian/rules deleted file mode 100755 index 201f9c4..0000000 --- a/src/install/acquire/cabextract/debian/rules +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# This is the debhelper compatability version to use. -export DH_COMPAT=2 - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - ./configure --prefix=$(CURDIR)/debian/cabextract/usr --mandir=$(CURDIR)/debian/cabextract/usr/share/man --infodir=$(CURDIR)/debian/cabextract/usr/share/info - - - touch configure-stamp - -build: configure-stamp build-stamp -build-stamp: - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - #/usr/bin/docbook-to-man debian/cabextract.sgml > cabextract.1 - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) clean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/cabextract. - \$(MAKE) install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot -# dh_installdebconf - dh_installdocs - dh_installexamples - dh_installmenu -# dh_installemacsen -# dh_installpam -# dh_installinit - dh_installcron - dh_installmanpages - dh_installinfo -# dh_undocumented - dh_installchangelogs - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_makeshlibs - dh_installdeb -# dh_perl - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/src/install/acquire/cabextract/getopt.c b/src/install/acquire/cabextract/getopt.c deleted file mode 100644 index 4744e43..0000000 --- a/src/install/acquire/cabextract/getopt.c +++ /dev/null @@ -1,1055 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to drepper@gnu.org - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 - Free Software Foundation, Inc. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -# define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -# include -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -# ifndef const -# define const -# endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -# include -# include -#endif /* GNU C library. */ - -#ifdef VMS -# include -# if HAVE_STRING_H - 0 -# include -# endif -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -# ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -# else -# define _(msgid) (msgid) -# endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -# include -# define my_index strchr -#else - -# if HAVE_STRING_H -# include -# else -# include -# endif - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -#ifndef getenv -extern char *getenv (); -#endif - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -# if (!defined __STDC__ || !__STDC__) && !defined strlen -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -# endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -# ifdef text_set_element -text_set_element (__libc_subinit, store_args_and_env); -# endif /* text_set_element */ - -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined __STDC__ && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#ifdef _LIBC - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memset (__mempcpy (new_str, __getopt_nonoption_flags, - nonoption_flags_max_len), - '\0', top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined __STDC__ && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), - '\0', nonoption_flags_max_len - len); - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - int print_errors = opterr; - if (optstring[0] == ':') - print_errors = 0; - - optarg = NULL; - - if (optind == 0 || !__getopt_initialized) - { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) -#else -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (print_errors) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (print_errors) - { - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - } - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (print_errors) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (print_errors) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (print_errors) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (print_errors) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (print_errors) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (print_errors) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (print_errors) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (print_errors) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/src/install/acquire/cabextract/getopt.h b/src/install/acquire/cabextract/getopt.h deleted file mode 100644 index b0147e9..0000000 --- a/src/install/acquire/cabextract/getopt.h +++ /dev/null @@ -1,169 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -# if defined __STDC__ && __STDC__ - const char *name; -# else - char *name; -# endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#if defined __STDC__ && __STDC__ -# ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int __argc, char *const *__argv, const char *__shortopts); -# else /* not __GNU_LIBRARY__ */ -extern int getopt (); -# endif /* __GNU_LIBRARY__ */ - -# ifndef __need_getopt -extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, - const struct option *__longopts, int *__longind); -extern int getopt_long_only (int __argc, char *const *__argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int __argc, char *const *__argv, - const char *__shortopts, - const struct option *__longopts, int *__longind, - int __long_only); -# endif -#else /* not __STDC__ */ -extern int getopt (); -# ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -# endif -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ diff --git a/src/install/acquire/cabextract/getopt1.c b/src/install/acquire/cabextract/getopt1.c deleted file mode 100644 index 3d264f2..0000000 --- a/src/install/acquire/cabextract/getopt1.c +++ /dev/null @@ -1,188 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "getopt.h" - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/src/install/acquire/cabextract/install-sh b/src/install/acquire/cabextract/install-sh deleted file mode 100755 index c122ef9..0000000 --- a/src/install/acquire/cabextract/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/src/install/acquire/cabextract/ja/cabextract.1 b/src/install/acquire/cabextract/ja/cabextract.1 deleted file mode 100644 index 8ea871c..0000000 --- a/src/install/acquire/cabextract/ja/cabextract.1 +++ /dev/null @@ -1,70 +0,0 @@ -.TH CABEXTRACT 1 "2001ǯ 8·î 2Æü" -.SH ̾Á° -cabextract \- Microsoft cabinet (.cab) archives ¤«¤é¥Õ¥¡¥¤¥ë¤ò²òÅह¤ë¥×¥í¥°¥é¥à -.SH ½ñ¼° -.B cabextract -.RB [ -v ] -.RB [ -h ] -.RB [ -l ] -.RB [ -q ] -.RB [ -L ] -.RB [ -f ] -.RB [ -d \fIdir\fP ] -.I " ¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë" ... -.SH ¾ÜºÙ -.B cabextract -¤Ï¡¢Microsoft ¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë·Á¼° (.cab) ¤Þ¤¿¤Ï¡¢ -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤¬Ëä¤á¹þ¤Þ¤ì¤¿¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë (¤è¤¯ .exe ¥Õ¥¡¥¤¥ë¤Ç¸«¤Ä¤«¤ë) -¤«¤é²òÅह¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£ -.PP -.B cabextract -¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Ç»ØÄꤵ¤ì¤¿Á´¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤«¤é -¥Õ¥¡¥¤¥ë¤òÃê½Ð¤¹¤ë¤Ç¤·¤ç¤¦¡£ -.PP -´ö¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¤Ëʬ³ä¤µ¤ì¤¿¥Þ¥ë¥Á¥Ñ¡¼¥È¤Î¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë -¤Î¾ì¹ç¤Ï¡¢ -.I ºÇ½é¤Î -¥Õ¥¡¥¤¥ë¤Î¤ß¤ò -.B cabextract -¤Î°ú¿ô¤ËÍ¿¤¨¤ì¤Ð¡¢»Ä¤ê¤Î¥Õ¥¡¥¤¥ë¤ò¼«Æ°Åª¤Ë¸¡½Ð¤·¤Þ¤¹¡£ -.SH ¥ª¥×¥·¥ç¥ó -¥ª¥×¥·¥ç¥ó¤ÎÍ×Ìó¤Ï¡¢°Ê²¼¤ò»²¾È²¼¤µ¤¤¡£ -.TP -.B \-v -¥³¥Þ¥ó¥É¥é¥¤¥ó¤«¤é¡¢Ã±ÆȤǻØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ -.B cabextract -¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òɽ¼¨¤·¤Æ½ªÎ»¤·¤Þ¤¹¡£ -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¤È¤òÍ¿¤¨¤¿¾ì¹ç¤Ï¡¢ -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£ -.TP -.B \-h -¥Ø¥ë¥×¤Î¥Ú¡¼¥¸¤òɽ¼¨¤·½ªÎ»¤·¤Þ¤¹¡£ -.TP -.B \-l -¤½¤ì¤é¤òÃê½Ð¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ -Í¿¤¨¤é¤ì¤¿¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£ -.TP -.B \-q -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤òÃê½Ð¤¹¤ë¾ì¹ç¡¢ -¥¨¥é¡¼¤È·Ù¹ð¥á¥Ã¥»¡¼¥¸¤ò½ü¤­¡¢Á´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤»¤ó¡£ -.TP -.B \-L -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤òÃê½Ð¤¹¤ë¾ì¹ç¡¢ -³Æ²òÅव¤ì¤¿¥Õ¥¡¥¤¥ë̾¤ò¾®Ê¸»ú¤È¤·¤ÆºîÀ®¤¹¤ë¡£ -.TP -.B \-f -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤òÃê½Ð¤¹¤ë¾ì¹ç¡¢ -ÌäÂ꤬¤¢¤Ã¤¿ MSZIP¥Ö¥í¥Ã¥¯¤ò̵»ë¤·¤Þ¤¹¡£ -ÌäÂ꤬¤¢¤Ã¤¿ MSZIP¥Ö¥í¥Ã¥¯¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ -·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡£ -.TP -.B \-d \fIdir\fP -¥Ç¥£¥ì¥¯¥È¥ê \fIdir\fP ¤ËÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò²òÅष¤Þ¤¹¡£ -.SH Ãø¼Ô -¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¡¢ -Stuart Caie ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¡¢ -Debian GNU/Linux ¥·¥¹¥Æ¥à¤Î¤¿¤á¤Ë¡¢ -Eric Sharkey ¤Î¤ß¤Ë¤è¤Ã¤Æ¥Ù¡¼¥¹¤¬½ñ¤«¤ì¤Þ¤·¤¿¡£ -.SH Ìõ¼Ô -ÆüËܸìÌõ¤Ï¡¢Katsumi Saito ¤¬ -¹Ô¤¤¤Þ¤·¤¿¡£ diff --git a/src/install/acquire/cabextract/magic.cabinet b/src/install/acquire/cabextract/magic.cabinet deleted file mode 100644 index 72d0bff..0000000 --- a/src/install/acquire/cabextract/magic.cabinet +++ /dev/null @@ -1,6 +0,0 @@ -#------------------------------------------------------------------------------ -# Microsoft Cabinet files -# -# From (part of cabextract package) -0 string \x4D\x53\x43\x46 Microsoft Cabinet file - diff --git a/src/install/acquire/cabextract/missing b/src/install/acquire/cabextract/missing deleted file mode 100755 index d46f79f..0000000 --- a/src/install/acquire/cabextract/missing +++ /dev/null @@ -1,198 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.in; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`$configure_ac'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`$configure_ac'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`$configure_ac'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/src/install/acquire/cabextract/mkinstalldirs b/src/install/acquire/cabextract/mkinstalldirs deleted file mode 100755 index 6b3b5fc..0000000 --- a/src/install/acquire/cabextract/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id$ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/src/install/acquire/cabextract/mktime.c b/src/install/acquire/cabextract/mktime.c deleted file mode 100644 index b63fa05..0000000 --- a/src/install/acquire/cabextract/mktime.c +++ /dev/null @@ -1,541 +0,0 @@ -/* mktime: convert a `struct tm' to a time_t value - Copyright (C) 1993-1997, 1998 Free Software Foundation, Inc. - Contributed by Paul Eggert (eggert@twinsun.com). - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -/* Define this to have a standalone program to test this implementation of - mktime. */ -/* #define DEBUG 1 */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef _LIBC -# define HAVE_LIMITS_H 1 -# define STDC_HEADERS 1 -#endif - -/* Assume that leap seconds are possible, unless told otherwise. - If the host has a `zic' command with a `-L leapsecondfilename' option, - then it supports leap seconds; otherwise it probably doesn't. */ -#ifndef LEAP_SECONDS_POSSIBLE -# define LEAP_SECONDS_POSSIBLE 1 -#endif - -#include /* Some systems define `time_t' here. */ -#include - -#if HAVE_LIMITS_H -# include -#endif - -#if DEBUG -# include -# if STDC_HEADERS -# include -# endif -/* Make it work even if the system's libc has its own mktime routine. */ -# define mktime my_mktime -#endif /* DEBUG */ - -#ifndef __P -# if defined (__GNUC__) || (defined (__STDC__) && __STDC__) -# define __P(args) args -# else -# define __P(args) () -# endif /* GCC. */ -#endif /* Not __P. */ - -#ifndef CHAR_BIT -# define CHAR_BIT 8 -#endif - -/* The extra casts work around common compiler bugs. */ -#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) -/* The outer cast is needed to work around a bug in Cray C 5.0.3.0. - It is necessary at least when t == time_t. */ -#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ - ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0)) -#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) - -#ifndef INT_MIN -# define INT_MIN TYPE_MINIMUM (int) -#endif -#ifndef INT_MAX -# define INT_MAX TYPE_MAXIMUM (int) -#endif - -#ifndef TIME_T_MIN -# define TIME_T_MIN TYPE_MINIMUM (time_t) -#endif -#ifndef TIME_T_MAX -# define TIME_T_MAX TYPE_MAXIMUM (time_t) -#endif - -#define TM_YEAR_BASE 1900 -#define EPOCH_YEAR 1970 - -#ifndef __isleap -/* Nonzero if YEAR is a leap year (every 4 years, - except every 100th isn't, and every 400th is). */ -# define __isleap(year) \ - ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) -#endif - -/* How many days come before each month (0-12). */ -const unsigned short int __mon_yday[2][13] = - { - /* Normal years. */ - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, - /* Leap years. */ - { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } - }; - -static struct tm *ranged_convert __P ((struct tm *(*) __P ((const time_t *, - struct tm *)), - time_t *, struct tm *)); -static time_t ydhms_tm_diff __P ((int, int, int, int, int, const struct tm *)); -time_t __mktime_internal __P ((struct tm *, - struct tm *(*) (const time_t *, struct tm *), - time_t *)); - - -#ifdef _LIBC -# define my_mktime_localtime_r __localtime_r -#else -/* If we're a mktime substitute in a GNU program, then prefer - localtime to localtime_r, since many localtime_r implementations - are buggy. */ -static struct tm *my_mktime_localtime_r __P ((const time_t *, struct tm *)); -static struct tm * -my_mktime_localtime_r (t, tp) - const time_t *t; - struct tm *tp; -{ - struct tm *l = localtime (t); - if (! l) - return 0; - *tp = *l; - return tp; -} -#endif /* ! _LIBC */ - - -/* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP), - measured in seconds, ignoring leap seconds. - YEAR uses the same numbering as TM->tm_year. - All values are in range, except possibly YEAR. - If TP is null, return a nonzero value. - If overflow occurs, yield the low order bits of the correct answer. */ -static time_t -ydhms_tm_diff (year, yday, hour, min, sec, tp) - int year, yday, hour, min, sec; - const struct tm *tp; -{ - if (!tp) - return 1; - else - { - /* Compute intervening leap days correctly even if year is negative. - Take care to avoid int overflow. time_t overflow is OK, since - only the low order bits of the correct time_t answer are needed. - Don't convert to time_t until after all divisions are done, since - time_t might be unsigned. */ - int a4 = (year >> 2) + (TM_YEAR_BASE >> 2) - ! (year & 3); - int b4 = (tp->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (tp->tm_year & 3); - int a100 = a4 / 25 - (a4 % 25 < 0); - int b100 = b4 / 25 - (b4 % 25 < 0); - int a400 = a100 >> 2; - int b400 = b100 >> 2; - int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); - time_t years = year - (time_t) tp->tm_year; - time_t days = (365 * years + intervening_leap_days - + (yday - tp->tm_yday)); - return (60 * (60 * (24 * days + (hour - tp->tm_hour)) - + (min - tp->tm_min)) - + (sec - tp->tm_sec)); - } -} - - -static time_t localtime_offset; - -/* Convert *TP to a time_t value. */ -time_t -mktime (tp) - struct tm *tp; -{ -#ifdef _LIBC - /* POSIX.1 8.1.1 requires that whenever mktime() is called, the - time zone names contained in the external variable `tzname' shall - be set as if the tzset() function had been called. */ - __tzset (); -#endif - - return __mktime_internal (tp, my_mktime_localtime_r, &localtime_offset); -} - -/* Use CONVERT to convert *T to a broken down time in *TP. - If *T is out of range for conversion, adjust it so that - it is the nearest in-range value and then convert that. */ -static struct tm * -ranged_convert (convert, t, tp) - struct tm *(*convert) __P ((const time_t *, struct tm *)); - time_t *t; - struct tm *tp; -{ - struct tm *r; - - if (! (r = (*convert) (t, tp)) && *t) - { - time_t bad = *t; - time_t ok = 0; - struct tm tm; - - /* BAD is a known unconvertible time_t, and OK is a known good one. - Use binary search to narrow the range between BAD and OK until - they differ by 1. */ - while (bad != ok + (bad < 0 ? -1 : 1)) - { - time_t mid = *t = (bad < 0 - ? bad + ((ok - bad) >> 1) - : ok + ((bad - ok) >> 1)); - if ((r = (*convert) (t, tp))) - { - tm = *r; - ok = mid; - } - else - bad = mid; - } - - if (!r && ok) - { - /* The last conversion attempt failed; - revert to the most recent successful attempt. */ - *t = ok; - *tp = tm; - r = tp; - } - } - - return r; -} - - -/* Convert *TP to a time_t value, inverting - the monotonic and mostly-unit-linear conversion function CONVERT. - Use *OFFSET to keep track of a guess at the offset of the result, - compared to what the result would be for UTC without leap seconds. - If *OFFSET's guess is correct, only one CONVERT call is needed. */ -time_t -__mktime_internal (tp, convert, offset) - struct tm *tp; - struct tm *(*convert) __P ((const time_t *, struct tm *)); - time_t *offset; -{ - time_t t, dt, t0, t1, t2; - struct tm tm; - - /* The maximum number of probes (calls to CONVERT) should be enough - to handle any combinations of time zone rule changes, solar time, - leap seconds, and oscillations around a spring-forward gap. - POSIX.1 prohibits leap seconds, but some hosts have them anyway. */ - int remaining_probes = 6; - - /* Time requested. Copy it in case CONVERT modifies *TP; this can - occur if TP is localtime's returned value and CONVERT is localtime. */ - int sec = tp->tm_sec; - int min = tp->tm_min; - int hour = tp->tm_hour; - int mday = tp->tm_mday; - int mon = tp->tm_mon; - int year_requested = tp->tm_year; - int isdst = tp->tm_isdst; - - /* Ensure that mon is in range, and set year accordingly. */ - int mon_remainder = mon % 12; - int negative_mon_remainder = mon_remainder < 0; - int mon_years = mon / 12 - negative_mon_remainder; - int year = year_requested + mon_years; - - /* The other values need not be in range: - the remaining code handles minor overflows correctly, - assuming int and time_t arithmetic wraps around. - Major overflows are caught at the end. */ - - /* Calculate day of year from year, month, and day of month. - The result need not be in range. */ - int yday = ((__mon_yday[__isleap (year + TM_YEAR_BASE)] - [mon_remainder + 12 * negative_mon_remainder]) - + mday - 1); - - int sec_requested = sec; -#if LEAP_SECONDS_POSSIBLE - /* Handle out-of-range seconds specially, - since ydhms_tm_diff assumes every minute has 60 seconds. */ - if (sec < 0) - sec = 0; - if (59 < sec) - sec = 59; -#endif - - /* Invert CONVERT by probing. First assume the same offset as last time. - Then repeatedly use the error to improve the guess. */ - - tm.tm_year = EPOCH_YEAR - TM_YEAR_BASE; - tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0; - t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm); - - for (t = t1 = t2 = t0 + *offset; - (dt = ydhms_tm_diff (year, yday, hour, min, sec, - ranged_convert (convert, &t, &tm))); - t1 = t2, t2 = t, t += dt) - if (t == t1 && t != t2 - && (isdst < 0 || tm.tm_isdst < 0 - || (isdst != 0) != (tm.tm_isdst != 0))) - /* We can't possibly find a match, as we are oscillating - between two values. The requested time probably falls - within a spring-forward gap of size DT. Follow the common - practice in this case, which is to return a time that is DT - away from the requested time, preferring a time whose - tm_isdst differs from the requested value. In practice, - this is more useful than returning -1. */ - break; - else if (--remaining_probes == 0) - return -1; - - /* If we have a match, check whether tm.tm_isdst has the requested - value, if any. */ - if (dt == 0 && 0 <= isdst && 0 <= tm.tm_isdst) - { - int dst_diff = (isdst != 0) - (tm.tm_isdst != 0); - if (dst_diff) - { - /* Move two hours in the direction indicated by the disagreement, - probe some more, and switch to a new time if found. - The largest known fallback due to daylight savings is two hours: - once, in Newfoundland, 1988-10-30 02:00 -> 00:00. */ - time_t ot = t - 2 * 60 * 60 * dst_diff; - while (--remaining_probes != 0) - { - struct tm otm; - if (! (dt = ydhms_tm_diff (year, yday, hour, min, sec, - ranged_convert (convert, &ot, &otm)))) - { - t = ot; - tm = otm; - break; - } - if ((ot += dt) == t) - break; /* Avoid a redundant probe. */ - } - } - } - - *offset = t - t0; - -#if LEAP_SECONDS_POSSIBLE - if (sec_requested != tm.tm_sec) - { - /* Adjust time to reflect the tm_sec requested, not the normalized value. - Also, repair any damage from a false match due to a leap second. */ - t += sec_requested - sec + (sec == 0 && tm.tm_sec == 60); - if (! (*convert) (&t, &tm)) - return -1; - } -#endif - - if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) - { - /* time_t isn't large enough to rule out overflows in ydhms_tm_diff, - so check for major overflows. A gross check suffices, - since if t has overflowed, it is off by a multiple of - TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of - the difference that is bounded by a small value. */ - - double dyear = (double) year_requested + mon_years - tm.tm_year; - double dday = 366 * dyear + mday; - double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested; - - /* On Irix4.0.5 cc, dividing TIME_T_MIN by 3 does not produce - correct results, ie., it erroneously gives a positive value - of 715827882. Setting a variable first then doing math on it - seems to work. (ghazi@caip.rutgers.edu) */ - - const time_t time_t_max = TIME_T_MAX; - const time_t time_t_min = TIME_T_MIN; - - if (time_t_max / 3 - time_t_min / 3 < (dsec < 0 ? - dsec : dsec)) - return -1; - } - - *tp = tm; - return t; -} - -#ifdef weak_alias -weak_alias (mktime, timelocal) -#endif - -#if DEBUG - -static int -not_equal_tm (a, b) - struct tm *a; - struct tm *b; -{ - return ((a->tm_sec ^ b->tm_sec) - | (a->tm_min ^ b->tm_min) - | (a->tm_hour ^ b->tm_hour) - | (a->tm_mday ^ b->tm_mday) - | (a->tm_mon ^ b->tm_mon) - | (a->tm_year ^ b->tm_year) - | (a->tm_mday ^ b->tm_mday) - | (a->tm_yday ^ b->tm_yday) - | (a->tm_isdst ^ b->tm_isdst)); -} - -static void -print_tm (tp) - struct tm *tp; -{ - if (tp) - printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", - tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, - tp->tm_hour, tp->tm_min, tp->tm_sec, - tp->tm_yday, tp->tm_wday, tp->tm_isdst); - else - printf ("0"); -} - -static int -check_result (tk, tmk, tl, lt) - time_t tk; - struct tm tmk; - time_t tl; - struct tm *lt; -{ - if (tk != tl || !lt || not_equal_tm (&tmk, lt)) - { - printf ("mktime ("); - print_tm (&tmk); - printf (")\nyields ("); - print_tm (lt); - printf (") == %ld, should be %ld\n", (long) tl, (long) tk); - return 1; - } - - return 0; -} - -int -main (argc, argv) - int argc; - char **argv; -{ - int status = 0; - struct tm tm, tmk, tml; - struct tm *lt; - time_t tk, tl; - char trailer; - - if ((argc == 3 || argc == 4) - && (sscanf (argv[1], "%d-%d-%d%c", - &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) - == 3) - && (sscanf (argv[2], "%d:%d:%d%c", - &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) - == 3)) - { - tm.tm_year -= TM_YEAR_BASE; - tm.tm_mon--; - tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); - tmk = tm; - tl = mktime (&tmk); - lt = localtime (&tl); - if (lt) - { - tml = *lt; - lt = &tml; - } - printf ("mktime returns %ld == ", (long) tl); - print_tm (&tmk); - printf ("\n"); - status = check_result (tl, tmk, tl, lt); - } - else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) - { - time_t from = atol (argv[1]); - time_t by = atol (argv[2]); - time_t to = atol (argv[3]); - - if (argc == 4) - for (tl = from; tl <= to; tl += by) - { - lt = localtime (&tl); - if (lt) - { - tmk = tml = *lt; - tk = mktime (&tmk); - status |= check_result (tk, tmk, tl, tml); - } - else - { - printf ("localtime (%ld) yields 0\n", (long) tl); - status = 1; - } - } - else - for (tl = from; tl <= to; tl += by) - { - /* Null benchmark. */ - lt = localtime (&tl); - if (lt) - { - tmk = tml = *lt; - tk = tl; - status |= check_result (tk, tmk, tl, tml); - } - else - { - printf ("localtime (%ld) yields 0\n", (long) tl); - status = 1; - } - } - } - else - printf ("Usage:\ -\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ -\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ -\t%s FROM BY TO - # Do not test those values (for benchmark).\n", - argv[0], argv[0], argv[0]); - - return status; -} - -#endif /* DEBUG */ - -/* -Local Variables: -compile-command: "gcc -DDEBUG -DHAVE_LIMITS_H -DSTDC_HEADERS -Wall -W -O -g mktime.c -o mktime" -End: -*/ diff --git a/src/install/acquire/cabextract/stamp-h.in b/src/install/acquire/cabextract/stamp-h.in deleted file mode 100644 index 9788f70..0000000 --- a/src/install/acquire/cabextract/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/src/install/acquire/cabinet-memory.c b/src/install/acquire/cabinet-memory.c deleted file mode 100644 index 6e2c4cc..0000000 --- a/src/install/acquire/cabinet-memory.c +++ /dev/null @@ -1,217 +0,0 @@ -/* $Id$ - * cabextract memory allocation for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "cabinet-memory.h" /* self */ -#include -#include -#include -#include - - -struct _CaptiveAcquireCabinetMemoryObject { - GObject parent_instance; - - /*< private >*/ - GHashTable *memory_hash; - gpointer data; - gsize data_size; - }; -struct _CaptiveAcquireCabinetMemoryObjectClass { - GObjectClass parent_class; - }; - -static CaptiveAcquireCabinetMemoryObject *memory_object; -static GSList *memory_object_slist; - -static gpointer captive_acquire_cabinet_memory_object_parent_class=NULL; - -static void captive_acquire_cabinet_memory_object_finalize_foreach - (gpointer mem /* key */,gpointer mem_val,gpointer user_data /* unused */) -{ - g_return_if_fail(mem!=NULL); - g_return_if_fail(mem_val!=NULL); - g_return_if_fail(mem==mem_val); - - g_free(mem); -} - -static void captive_acquire_cabinet_memory_object_finalize(CaptiveAcquireCabinetMemoryObject *memory) -{ - g_return_if_fail(memory!=NULL); - g_return_if_fail(memory!=memory_object); - - g_hash_table_foreach(memory->memory_hash, - captive_acquire_cabinet_memory_object_finalize_foreach, /* func */ - NULL); /* user_data; unused */ - - g_hash_table_destroy(memory->memory_hash); - - g_free(memory->data); - memory->data=NULL; - memory->data_size=0; - - G_OBJECT_CLASS(captive_acquire_cabinet_memory_object_parent_class)->finalize((GObject *)memory); -} - -static void captive_acquire_cabinet_memory_object_class_init(CaptiveAcquireCabinetMemoryObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); - - captive_acquire_cabinet_memory_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_acquire_cabinet_memory_object_finalize; -} - -static void captive_acquire_cabinet_memory_object_init(CaptiveAcquireCabinetMemoryObject *memory_object) -{ - memory_object->memory_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - -GType captive_acquire_cabinet_memory_object_get_type(void) -{ -static GType captive_acquire_cabinet_memory_object_type=0; - - if (!captive_acquire_cabinet_memory_object_type) { -static const GTypeInfo captive_acquire_cabinet_memory_object_info={ - sizeof(CaptiveAcquireCabinetMemoryObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_acquire_cabinet_memory_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveAcquireCabinetMemoryObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_acquire_cabinet_memory_object_init, - }; - - captive_acquire_cabinet_memory_object_type=g_type_register_static(G_TYPE_OBJECT, - "CaptiveAcquireCabinetMemoryObject",&captive_acquire_cabinet_memory_object_info,0); - } - - return captive_acquire_cabinet_memory_object_type; -} - -CaptiveAcquireCabinetMemoryObject *acquire_cabinet_memory_object_new(void) -{ - return g_object_new( - CAPTIVE_ACQUIRE_CABINET_MEMORY_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name */ -} - -void acquire_cabinet_memory_object_push(CaptiveAcquireCabinetMemoryObject *memory) -{ - g_return_if_fail(CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT(memory)); - - if (memory_object) - memory_object_slist=g_slist_prepend(memory_object_slist,memory_object); - memory_object=memory; -} - -/* 'memory' is just a sanity check */ -void acquire_cabinet_memory_object_pop(CaptiveAcquireCabinetMemoryObject *memory) -{ - g_return_if_fail(CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT(memory)); - g_return_if_fail(memory==memory_object); - - if (!memory_object_slist) - memory_object=NULL; - else { - memory_object=memory_object_slist->data; - g_assert(memory_object!=NULL); - memory_object_slist=g_slist_delete_link(memory_object_slist,memory_object_slist); - } -} - -gpointer acquire_cabinet_memory_malloc(gulong n_bytes) -{ -gpointer r; - - g_return_val_if_fail(CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT(memory_object),NULL); - - r=g_malloc(n_bytes); - g_assert((!r)==(!n_bytes)); - if (r) - g_hash_table_insert(memory_object->memory_hash,r,r); - - return r; -} - -gpointer acquire_cabinet_memory_malloc0(gulong n_bytes) -{ -gpointer r; - - g_return_val_if_fail(CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT(memory_object),NULL); - - r=g_malloc0(n_bytes); - g_assert((!r)==(!n_bytes)); - if (r) - g_hash_table_insert(memory_object->memory_hash,r,r); - - return r; -} - -gpointer acquire_cabinet_memory_realloc(gpointer mem,gulong n_bytes) -{ -gpointer r; -gboolean errbool; - - g_return_val_if_fail(CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT(memory_object),NULL); - - if (mem!=NULL) { - errbool=g_hash_table_remove(memory_object->memory_hash,mem); - g_assert(errbool==TRUE); - } - r=g_realloc(mem,n_bytes); - g_assert((!r)==(!n_bytes)); - if (r) - g_hash_table_insert(memory_object->memory_hash,r,r); - - return r; -} - -void acquire_cabinet_memory_free(gpointer mem) -{ -gboolean errbool; - - g_return_if_fail(CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT(memory_object)); - - if (mem!=NULL) { - errbool=g_hash_table_remove(memory_object->memory_hash,mem); - g_assert(errbool==TRUE); - } - g_free(mem); -} - -/* UGLY HACK for 'cabextract/cabextract.c/decomp_state' */ -gpointer acquire_cabinet_memory_data_get(gsize size) -{ - g_return_val_if_fail(size>0,NULL); - g_return_val_if_fail(CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT(memory_object),NULL); - - if (!memory_object->data_size) { - memory_object->data_size=size; - memory_object->data=g_malloc0(memory_object->data_size); - } - - g_assert(memory_object->data_size==size); - g_assert(memory_object->data!=NULL); - - return memory_object->data; -} diff --git a/src/install/acquire/cabinet-memory.h b/src/install/acquire/cabinet-memory.h deleted file mode 100644 index a829068..0000000 --- a/src/install/acquire/cabinet-memory.h +++ /dev/null @@ -1,57 +0,0 @@ -/* $Id$ - * Include file for cabextract memory allocation for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_CABINET_MEMORY_H -#define _CAPTIVE_INSTALL_ACQUIRE_CABINET_MEMORY_H 1 - - -#include -#include - - -G_BEGIN_DECLS - -#define CAPTIVE_ACQUIRE_CABINET_MEMORY_TYPE_OBJECT (captive_acquire_cabinet_memory_object_get_type()) -#define CAPTIVE_ACQUIRE_CABINET_MEMORY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_ACQUIRE_CABINET_MEMORY_TYPE_OBJECT,CaptiveAcquireCabinetMemoryObject)) -#define CAPTIVE_ACQUIRE_CABINET_MEMORY_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_ACQUIRE_CABINET_MEMORY_TYPE_OBJECT,CaptiveAcquireCabinetMemoryObjectClass)) -#define CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_ACQUIRE_CABINET_MEMORY_TYPE_OBJECT)) -#define CAPTIVE_ACQUIRE_CABINET_MEMORY_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_ACQUIRE_CABINET_MEMORY_TYPE_OBJECT)) -#define CAPTIVE_ACQUIRE_CABINET_MEMORY_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_ACQUIRE_CABINET_MEMORY_TYPE_OBJECT,CaptiveAcquireCabinetMemoryObjectClass)) -typedef struct _CaptiveAcquireCabinetMemoryObject CaptiveAcquireCabinetMemoryObject; -typedef struct _CaptiveAcquireCabinetMemoryObjectClass CaptiveAcquireCabinetMemoryObjectClass; - - -GType captive_acquire_cabinet_memory_object_get_type(void); - -CaptiveAcquireCabinetMemoryObject *acquire_cabinet_memory_object_new(void); - -void acquire_cabinet_memory_object_push(CaptiveAcquireCabinetMemoryObject *memory); -void acquire_cabinet_memory_object_pop(CaptiveAcquireCabinetMemoryObject *memory); - -gpointer acquire_cabinet_memory_malloc (gulong n_bytes); -gpointer acquire_cabinet_memory_malloc0(gulong n_bytes); -gpointer acquire_cabinet_memory_realloc(gpointer mem,gulong n_bytes); -void acquire_cabinet_memory_free (gpointer mem); - -gpointer acquire_cabinet_memory_data_get(gsize size); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_CABINET_MEMORY_H */ diff --git a/src/install/acquire/cabinet.c b/src/install/acquire/cabinet.c deleted file mode 100644 index 3967631..0000000 --- a/src/install/acquire/cabinet.c +++ /dev/null @@ -1,438 +0,0 @@ -/* $Id$ - * cabextract interface for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "cabinet.h" /* self */ -#include -#include -#include -#include "cabextract/cabextract.h" -#include "captivemodid.h" -#include "moduriload.h" -#include -#include -#include "main.h" -#include -#include -#include -#include "cabinet-memory.h" - -#include - - -/* Config: */ -#define ACQUIRE_CABINET_READ_RAW_READ_TRY_MAX 5 -#define ACQUIRE_CABINET_READ_RAW_READ_TIMEOUT 20 -#define ACQUIRE_CABINET_READ_RAW_READ_ITER_SEC 0 -#define ACQUIRE_CABINET_READ_RAW_READ_ITER_USEC 100000 - - -#define ACQUIRE_CABINET_READ_RAW_READ_TIMEOUT_ITERS \ - ((ACQUIRE_CABINET_READ_RAW_READ_TIMEOUT *1000000LL) \ - /(ACQUIRE_CABINET_READ_RAW_READ_ITER_SEC*1000000LL+ACQUIRE_CABINET_READ_RAW_READ_ITER_USEC)) - - -void acquire_cabinet_seek(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset) -{ - g_return_if_fail(acquire_cabinet!=NULL); - - /* Do not: (*ui_progress)(acquire_cabinet->uri); - * as we currently extract some specific file out of it. - */ - (*ui_progress)(NULL); - - acquire_cabinet->offset=offset; -} - -void acquire_cabinet_seek_skip(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset) -{ - g_return_if_fail(acquire_cabinet!=NULL); - - (*ui_progress)(NULL); - - acquire_cabinet->offset+=offset; -} - -GnomeVFSFileOffset acquire_cabinet_tell(struct acquire_cabinet *acquire_cabinet) -{ - g_return_val_if_fail(acquire_cabinet!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - (*ui_progress)(NULL); - - return acquire_cabinet->offset; -} - -static guint handler_SIGALRM_hits; -static sigjmp_buf handler_SIGALRM_sigjmp_buf; - -static void handler_SIGALRM(int signo) -{ - g_return_if_fail(signo==SIGALRM); - - /* Try to abort the read(2) call first. - * If it already read something it will return the partially read data. - * Otherwise gnome_vfs_inet_connection_read() will loop back to retry read(2) - * and we will abort it after 1 second. OK, some data may be read that time - * but who cares. - */ - if (handler_SIGALRM_hits++handlep,&offset_current); - if (GNOME_VFS_OK==errvfsresult && (GnomeVFSFileOffset)offset_current!=offset) - errvfsresult=gnome_vfs_seek(*acquire_cabinet->handlep,GNOME_VFS_SEEK_START,offset); - if (GNOME_VFS_OK==errvfsresult) - errvfsresult=gnome_vfs_read(*acquire_cabinet->handlep,buffer,bytes,bytes_read); - } - else - errvfsresult=GNOME_VFS_ERROR_INTERRUPTED; - itimerval.it_interval.tv_sec=0; - itimerval.it_interval.tv_usec=0; - itimerval.it_value=itimerval.it_interval; - errint=setitimer( - ITIMER_REAL, /* which */ - &itimerval, /* value */ - NULL); /* ovalue */ - g_assert(errint==0); - errint=sigaction( - SIGALRM, /* signum */ - &oldact, /* act */ - NULL); /* oldact */ - g_assert(errint==0); - if (errvfsresult==GNOME_VFS_OK) { - g_assert(*bytes_read>0); - return GNOME_VFS_OK; - } - - /* Reopen '*acquire_cabinet->handlep' */ - g_assert(acquire_cabinet->handle_uri!=NULL); - if (GNOME_VFS_OK==(errvfsresult=gnome_vfs_open_uri(&handle_new,acquire_cabinet->handle_uri, - GNOME_VFS_OPEN_READ|GNOME_VFS_OPEN_RANDOM))) { - gnome_vfs_close(*acquire_cabinet->handlep); /* errors ignored */ - *acquire_cabinet->handlep=handle_new; - } - } - - return GNOME_VFS_ERROR_IO; -} - -#define ACQUIRE_CABINET_BYTE_CACHED(acquire_cabinet,pos) (!(acquire_cabinet)->base_cached \ - || (acquire_cabinet)->base_cached[(pos)/8] & 1<<((pos)&7)) -#define ACQUIRE_CABINET_SET_BYTE_CACHED(acquire_cabinet,pos) ((acquire_cabinet)->base_cached[(pos)/8] |= 1<<((pos)&7)) - -GnomeVFSResult acquire_cabinet_read - (struct acquire_cabinet *acquire_cabinet,gpointer buffer,GnomeVFSFileSize bytes,GnomeVFSFileSize *bytes_read) -{ -GnomeVFSFileOffset offset_start,offset_end,read_behind; -GnomeVFSResult errvfsresult; -GnomeVFSFileSize bytes_read_now; - - g_return_val_if_fail(acquire_cabinet!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL || bytes==0,GNOME_VFS_ERROR_BAD_PARAMETERS); - - *bytes_read=0; - - if ((*ui_progress)(NULL)) - return GNOME_VFS_ERROR_INTERRUPTED; - - bytes=MAX(0,MIN(bytes,acquire_cabinet->size-acquire_cabinet->offset)); - if (!bytes) - return GNOME_VFS_ERROR_EOF; - - while (bytes) { - read_behind =acquire_cabinet->offset+bytes; - - /* GnomeVFS block transfer: */ - offset_start=acquire_cabinet->offset; - offset_end =acquire_cabinet->offset; - while (offset_endoffset_start) { - errvfsresult=acquire_cabinet_read_raw(acquire_cabinet, - acquire_cabinet->base+offset_start,offset_end-offset_start,&bytes_read_now,offset_start); - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - g_assert(bytes_read_now>0); - acquire_cabinet->cabinet_done+=bytes_read_now; - if (ui_progress_bar) - (*ui_progress_bar)(acquire_cabinet->cabinet_done,acquire_cabinet->cabinet_used); - while (bytes_read_now) { - ACQUIRE_CABINET_SET_BYTE_CACHED(acquire_cabinet,offset_start); - offset_start++; - bytes_read_now--; - } - } - - /* Memory block transfer: */ - offset_start=acquire_cabinet->offset; - offset_end =acquire_cabinet->offset; - while (offset_endbase+offset_start,offset_end-offset_start); - if (bytes_read) - *bytes_read+=offset_end-offset_start; - buffer+=offset_end-offset_start; - bytes-=offset_end-offset_start; - acquire_cabinet->offset=offset_end; - } - - return GNOME_VFS_OK; -} - -static void acquire_cabinet_set_uri(struct acquire_cabinet *acquire_cabinet,GnomeVFSURI *uri) -{ -GnomeVFSURI *uri_cabextract; - - g_return_if_fail(acquire_cabinet!=NULL); - g_return_if_fail(uri!=NULL); - - /* FIXME: HACK: Use proper 'cabextract' scheme after it gets implemented. - * GnomeVFS will return NULL on gnome_vfs_uri_new() with scheme not available. - */ - uri_cabextract=gnome_vfs_uri_new("file://"); - g_assert(uri_cabextract->parent==NULL); - /* Do not: g_assert(!strcmp(uri_cabextract->method_string,"file")); - * uri_cabextract->method_string=g_strdup("cabextract"); - * as it will just strip such anchor. FIXME: Why? - */ - - uri_cabextract->parent=gnome_vfs_uri_dup(uri); - - acquire_cabinet->uri=uri_cabextract; - acquire_cabinet->handle_uri=gnome_vfs_uri_ref(uri); - acquire_cabinet->filename=gnome_vfs_uri_to_string(acquire_cabinet->uri,GNOME_VFS_URI_HIDE_PASSWORD); -} - -struct acquire_cabinet *acquire_cabinet_new_from_memory - (gconstpointer file_base,size_t file_length,GnomeVFSURI *uri,gint cabinet_used) -{ -struct acquire_cabinet *r; - - g_return_val_if_fail(file_base!=NULL,NULL); - g_return_val_if_fail(uri!=NULL,NULL); - - captive_new(r); - r->base=(/* de-const */ gpointer)file_base; - r->base_cached=NULL; - r->offset=0; - r->handlep=NULL; - r->size=file_length; - acquire_cabinet_set_uri(r,uri); - r->cabinet_done=0; - r->cabinet_used=cabinet_used; - r->memory=acquire_cabinet_memory_object_new(); - - return r; -} - -struct acquire_cabinet *acquire_cabinet_new_from_handle - (GnomeVFSHandle **handlep,GnomeVFSFileInfo *file_info,GnomeVFSURI *uri,gint cabinet_used) -{ -struct acquire_cabinet *r; - - g_return_val_if_fail(handlep!=NULL,NULL); - g_return_val_if_fail(*handlep!=NULL,NULL); - g_return_val_if_fail(file_info!=NULL,NULL); - g_return_val_if_fail(uri!=NULL,NULL); - - captive_new(r); - if (MAP_FAILED==(r->base=mmap( - NULL, /* start */ - CAPTIVE_ROUND_UP64(file_info->size,getpagesize()), /* length */ - PROT_READ|PROT_WRITE, - MAP_ANONYMOUS|MAP_PRIVATE /* flags */ - |MAP_NORESERVE, /* We will not probably not read the whole cabinet. */ - -1, /* fd; ignored due to MAP_ANONYMOUS */ - 0))) { /* offset; ignored due to MAP_ANONYMOUS */ - g_free(r); - g_return_val_if_reached(NULL); - } - captive_new0n(r->base_cached,CAPTIVE_ROUND_UP64(file_info->size,8)/8); - r->offset=0; - r->handlep=handlep; - r->size=file_info->size; - r->cabinet_done=0; - r->cabinet_used=cabinet_used; - - acquire_cabinet_set_uri(r,uri); - r->memory=acquire_cabinet_memory_object_new(); - - return r; -} - -void acquire_cabinet_free(struct acquire_cabinet *acquire_cabinet) -{ - g_return_if_fail(acquire_cabinet!=NULL); - - if (acquire_cabinet->base_cached) { - munmap(acquire_cabinet->base,CAPTIVE_ROUND_UP64(acquire_cabinet->size,getpagesize())); /* errors ignored */ - g_free(acquire_cabinet->base_cached); - } - g_free((/* de-const */ gchar *)acquire_cabinet->filename); - gnome_vfs_uri_unref(acquire_cabinet->uri); - gnome_vfs_uri_unref(acquire_cabinet->handle_uri); - g_object_unref(acquire_cabinet->memory); - g_free(acquire_cabinet); -} - -static struct file *file_write_fi_assertion; -static GByteArray *file_write_bytearray; - -int file_write(struct file *fi, UBYTE *buf, size_t length) -{ - g_return_val_if_fail(fi!=NULL,0); - g_return_val_if_fail(buf!=NULL || length==0,0); - - g_return_val_if_fail(fi==file_write_fi_assertion,0); - g_return_val_if_fail(file_write_bytearray!=NULL,0); - - if ((*ui_progress)(NULL)) - return 0; - - g_byte_array_append(file_write_bytearray,buf,length); - - return 1; /* success */ -} - -void acquire_cabinet_load(struct acquire_cabinet *acquire_cabinet) -{ -struct cabinet *basecab; -struct file *filelist,*fi; - - g_return_if_fail(acquire_cabinet!=NULL); - - if (ui_progress_bar) - (*ui_progress_bar)(acquire_cabinet->cabinet_done,acquire_cabinet->cabinet_used); - - if ((*ui_progress)(acquire_cabinet->uri)) - return; - - acquire_cabinet_memory_object_push(acquire_cabinet->memory); - - basecab=find_cabs_in_file(acquire_cabinet); - if (!basecab) - goto fail_memory_pop; - if (basecab->next) - goto fail_memory_pop; - if (basecab->prevcab || basecab->nextcab) - goto fail_memory_pop; - - filelist=process_files(basecab); - - for (fi=filelist;fi;fi=fi->next) { -gpointer file_buffer; -GnomeVFSURI *uri_fi; -int errint; - - if (!captivemodid_module_length_is_valid(fi->length)) - continue; - - uri_fi=gnome_vfs_uri_append_file_name(acquire_cabinet->uri,fi->filename); - if ((*ui_progress)(uri_fi)) { - gnome_vfs_uri_unref(uri_fi); - goto fail_memory_pop; - } - - file_write_fi_assertion=fi; - file_write_bytearray=g_byte_array_new(); - /* extract_file() returns 1 for success. */ - errint=extract_file(fi, - 0, /* lower; ignored now */ - FALSE, /* fix */ - NULL); /* dir; ignored now */ - if (!errint || fi->length!=file_write_bytearray->len) { - g_byte_array_free(file_write_bytearray, - TRUE); /* free_segment */ - gnome_vfs_uri_unref(uri_fi); - if (!errint) - goto fail_memory_pop; - continue; - } - file_buffer=g_byte_array_free(file_write_bytearray, - FALSE); /* free_segment */ - mod_uri_load_file_from_memory(file_buffer,fi->length,uri_fi); - gnome_vfs_uri_unref(uri_fi); - g_free(file_buffer); - } - - /* FALLTHRU */ - -fail_memory_pop: - acquire_cabinet_memory_object_pop(acquire_cabinet->memory); -} diff --git a/src/install/acquire/cabinet.h b/src/install/acquire/cabinet.h deleted file mode 100644 index e94a25c..0000000 --- a/src/install/acquire/cabinet.h +++ /dev/null @@ -1,70 +0,0 @@ -/* $Id$ - * Include file for drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_CABINET_H -#define _CAPTIVE_INSTALL_ACQUIRE_CABINET_H 1 - - -#include -#include -#include -#include "cabinet-memory.h" - - -G_BEGIN_DECLS - -/* It is not 'GObject'-based as we will move to GnomeVFS handler cabextract:// - * anyway. - */ - -struct acquire_cabinet { - gpointer base; - guint8 *base_cached; - GnomeVFSFileOffset offset; - GnomeVFSHandle **handlep; - GnomeVFSFileSize size; - const gchar *filename; - GnomeVFSURI *uri; - GnomeVFSURI *handle_uri; - void (*seek)(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset); - void (*seek_skip)(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset); - GnomeVFSFileOffset (*tell)(struct acquire_cabinet *acquire_cabinet); - GnomeVFSResult (*read) - (struct acquire_cabinet *acquire_cabinet,gpointer buffer,GnomeVFSFileSize bytes,GnomeVFSFileSize *bytes_read); - gint cabinet_done,cabinet_used; - CaptiveAcquireCabinetMemoryObject *memory; /* cabextract/cabextract.c memory leaks tracker */ - }; - -void acquire_cabinet_seek(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset); -void acquire_cabinet_seek_skip(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset); -GnomeVFSFileOffset acquire_cabinet_tell(struct acquire_cabinet *acquire_cabinet); -GnomeVFSResult acquire_cabinet_read - (struct acquire_cabinet *acquire_cabinet,gpointer buffer,GnomeVFSFileSize bytes,GnomeVFSFileSize *bytes_read); - -struct acquire_cabinet *acquire_cabinet_new_from_memory - (gconstpointer file_base,size_t file_length,GnomeVFSURI *uri,gint cabinet_used); -struct acquire_cabinet *acquire_cabinet_new_from_handle - (GnomeVFSHandle **handlep,GnomeVFSFileInfo *file_info,GnomeVFSURI *uri,gint cabinet_used); -void acquire_cabinet_free(struct acquire_cabinet *acquire_cabinet); -void acquire_cabinet_load(struct acquire_cabinet *acquire_cabinet); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_CABINET_H */ diff --git a/src/install/acquire/captive-install-acquire.pod.pl.in b/src/install/acquire/captive-install-acquire.pod.pl.in deleted file mode 100644 index 8fc6887..0000000 --- a/src/install/acquire/captive-install-acquire.pod.pl.in +++ /dev/null @@ -1,162 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for captive-install-acquire(1) man page -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -my $vardir='@localstatedir@/lib/@PACKAGE@'; -$vardir=~s#\$\Q{prefix}\E#'@prefix@';#ge; -$vardir="/var/lib/@PACKAGE@" if $vardir=~/^@/; -my $sysconfdir='@sysconfdir@'; -$sysconfdir=~s#\$\Q{prefix}\E#'@prefix@';#ge; -$sysconfdir="/etc" if $sysconfdir=~/^@/; - -print <<'POD_EOF'; -=head1 NAME - -@PACKAGE@-install-acquire - Find MS Windows XP driver files for B - - -=head1 SYNOPSIS - -=for man -\fB@PACKAGE@-install-acquire\fP [\fB--text] -[\fB-v\fP|\fB--verbose\fP] [\fB-n\fP|\fB--dry\fP] -.br - [\fB--modid-path\fP=\fBpath\fP] [\fB--scan-disks\fP] [\fB--scan-disks-quick\fP] -.br - [\fB--scan-path\fP=\fBpath/URI\fP] [\fB--microsoft-com\fP] - - -=head1 DESCRIPTION - -Program acquires the needed I driver files. Multiple -methods of getting the driver files are supported. All the driver files are -stored to the directory -POD_EOF -print "B<$vardir/>\n"; -print <<'POD_EOF'; -where they are -expected by B(8). - - -=head1 OPTIONS - -Program will run interactively if no action options (B<--scan-disks>, -B<--scan-disks-quick>, B<--scan-path> or B<--microsoft-com>) are specified. -Otherwise the requested action(s) is proceeded in silent batch mode. - -=over - -=item B<--text> - -Disable I user interface even if I is available. -You must specify this option as the first one. This option has effect only for -interactive mode (no action options specified). - - -=item B<-v>|B<--verbose> - -Display additional information during disks scanning. - - -=item B<-n>|B<--dry> - -Perform all the operations but do not modify anything (no drivers are -stored to -POD_EOF -print "B<$vardir/>\n"; -print <<'POD_EOF'; -directory). - - -=item B<--modid-path>=B - -Path to B<.captivemodid.xml> database (default: -POD_EOF -print "B<$sysconfdir/w32-mod-id.captivemodid.xml>"; -print <<'POD_EOF'; -). This file contains -identifications (B(1)) of known compatible I -driver files. B<@PACKAGE@-install-acquire>(1) will ignore any files not -identified by this file although you may try to copy them to -POD_EOF -print "B<$vardir/>\n"; -print <<'POD_EOF'; -manually for B<@PACKAGE@>(7) clients. - - -=item B<--scan-disks> - -Scan all files on any local hard drive (mounted or unmounted) B or -(mounted) B partitions. This scanning includes I (B<.cab>) -archives. This scanning can last for very long time. - - -=item B<--scan-disks-quick> - -Reduced version of B<--scan-disks>. Only B subdirectory in -the root of any local hard drive (mounted or unmounted) B or (mounted) -B partition is investigated. This scan should find existing driver files -in already existing I installations. - - -=item B<--scan-path>=B - -Scan the specified B for device driver files. You may use either -filename (B), directory (B), B -disk file/directory (B) or remote -I filename (B). Remote I directory -(such as B) is not supported. - -Possibly specified directory is always scanned recursively. - - -=item B<--microsoft-com> - -You can download the best available version of needed drivers from -I. They can be found in I (URL -B) - -Legal: In some countries you need to have valid I license -to use it. - -Program will need to download approx 61MB of data (the cabinet file is 307MB; -1MB=1e6B here). - - -=back - - -=head1 SEE ALSO - -B<@PACKAGE@-install-fstab>(1), B<@PACKAGE@>(7), B(7) - - -=head1 AUTHOR - -Jan Kratochvil >, - I -POD_EOF -1; diff --git a/src/install/acquire/captivemodid-list.pl b/src/install/acquire/captivemodid-list.pl deleted file mode 100755 index 2a1f22b..0000000 --- a/src/install/acquire/captivemodid-list.pl +++ /dev/null @@ -1,139 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# Extract the list of files to download from Microsoft. -# Copyright (C) 2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use strict; -use warnings; - -require LWP::Simple; -use URI::Escape; - - -sub unamp($) -{ -my($ref)=@_; - - die "non-amp amp: $$ref" if $$ref=~/&(?!amp;)/; - $$ref=~s/&/&/go; -} - -print STDERR "Downloading index: "; -my $found_total; -my @found; -my $found_processed=0; -my $next='results.aspx?freetext=&productID=4C937A02-BAE0-4317-A1A9-0C56CD979D05&categoryId=7&period=&sortCriteria=date&nr=50&DisplayLang=en&type=a'; -my $BASE='http://www.microsoft.com/downloads/'; -my $VALIDATION_CODE=$ARGV[0] or die "ARGV[0]=VALIDATION_CODE"; - -while ($next) { - my $page=LWP::Simple::get($BASE.$next) or die; - my($page_total,$page_first,$page_last)=($page=~m{(\d+) results found; results (\d+)-(\d+) shown.}) or die; - die if !$page_total; - $found_total=$page_total if !$found_total; - $found_total==$page_total or die; - $found_processed+1==$page_first or die "(found_processed+1)(".($found_processed+1)."!=page_first($page_first)"; - $page_last>=$page_first or die; - if ($page_last<$found_total) { - $page_last==$page_first+50-1 or die; - ($next)=($page=~m{Next\s+>}) or die; - unamp \$next; - $next=~/^info.aspx[?]/ or die; - } - else { - $page_last==$found_total or die; - $next=undef(); - } - - while ($page=~m{

[^<]*(?: ]*>]*\balt="Genuine Windows download"[^>]*>)?

}g) { - my($url)=($1); - $found_processed++; - unamp \$url; - push @found,$url; - } - print STDERR "."; - $found_processed==$page_last or die "found_processed(".($found_processed).")!=page_last($page_last)"; - } -print STDERR " found: ".(0+@found)."\n"; - -my @download; -print STDERR "Downloading product pages: "; -for my $found (@found) { - my $page=LWP::Simple::get($BASE.$found) or die; - my($lang)=($page=~m{}); - # - print STDERR "+"; - my @stage2; - if (!$lang) { - @stage2=$found; - } - else { - while ($lang=~s{}{}) { - my($short,$long)=($1,$2); - (my $found_lang=$found)=~s/((?:\b|%26)DisplayLang(?:=|%3d))en\b/$1$short/ or die $found; - push @stage2,$found_lang; - } - !$lang or die; - die if !@stage2; - } - for my $stage2 (@stage2) { - my $delim='&'; - $delim='%26' if $stage2=~/%26DisplayLang/i; - $stage2.="${delim}Hash=$VALIDATION_CODE"; - $stage2=$BASE.$stage2; - my $page=LWP::Simple::get($stage2) or die $stage2; - while ($page=~m{

Object moved to }) { - $stage2=$1; - unamp \$stage2; - $page=LWP::Simple::get($stage2) or die $stage2; - } - my $download; - while ($page=~m{window.open(?:.)'(http://download.microsoft.com/download/[^']*)',null,}g) { - die if $download; - $download=$1; - } - if ($download) { - push @download,$download; - print STDERR "."; - } - elsif ($page=~m{}) { - my $files=$1; - my $download_orig=@download; - while ($files=~m{[^<>]*}g) { - my $url=$1; - unamp \$url; - push @download,$url; - } - die if $download_orig==@download; - print STDERR "_"; - } - elsif ($page=~m{
}) { - print STDERR "!"; - } - else { - die $stage2; - } - } - } -for (@download) { - next if !/^info.aspx[?].*&u=(http%3a[^&]*)$/; - $_=uri_unescape $1; - } -@download=sort keys(%{{ map(($_=>1),@download) }}); -print STDERR " found downloads: ".(0+@download)."\n"; -print "$_\n" for @download; diff --git a/src/install/acquire/captivemodid-print.pl b/src/install/acquire/captivemodid-print.pl deleted file mode 100755 index 34f6708..0000000 --- a/src/install/acquire/captivemodid-print.pl +++ /dev/null @@ -1,692 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# Scan downloaded Microsoft files to build the .captivemodid.xml file core. -# Copyright (C) 2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use strict; -use warnings; - -use Cwd; -use Carp qw(confess cluck); -use Digest::MD5 qw(md5_hex); -use File::Remove qw(remove); -use Getopt::Long; -use Data::Dumper; -require Config::IniHash; -require File::Basename; - - -confess if !$ENV{"HOME"}; -my $tmp=$ENV{"HOME"}."/tmp/captivemodid"; -confess "tmp '$tmp' too dangerous for tmpwatch(8)" if $tmp=~m{^/tmp\b} || $tmp=~m{^/var/tmp\b}; -my $out; - - -my $opt_quiet; -die if !GetOptions( - "q|quiet+",\$opt_quiet, - ); - - -our $dirnew=$ARGV[0]; -do { $dirnew="."; warn "Defaulting ARGV[0] to: $dirnew"; } if !$dirnew; -our $out=$ARGV[1]; -warn "No output md5 directory, not copying." if !$out; - - -my %type=( - "ntoskrnl.exe"=>"Kernel", - "ntkrnlpa.exe"=>"Kernel PA", - "ntkrnlmp.exe"=>"Kernel SMP", - "ntkrpamp.exe"=>"Kernel SMP PA", - "cdfs.sys" =>"CD-ROM/iso-9660", - "fastfat.sys" =>"FastFAT/vfat", - "ntfs.sys" =>"NTFS", - ); - -my %lang=( - "ar"=>"Arabic", - "hk"=>"Chinese (Hong Kong SAR)", - "cn"=>"Chinese (Simplified)", - "tw"=>"Chinese (Traditional)", - "cs"=>"Czech", - "da"=>"Danish", - "nl"=>"Dutch", - "en"=>"English", - "fi"=>"Finnish", - "fr"=>"French", - "de"=>"German", - "el"=>"Greek", - "he"=>"Hebrew", - "hu"=>"Hungarian", - "it"=>"Italian", - "ja"=>"Japanese", - "ko"=>"Korean", - "no"=>"Norwegian", - "pl"=>"Polish", - "br"=>"Portugese (Brazil)", - "pt"=>"Portugese (Portugal)", - "ru"=>"Russian", - "es"=>"Spanish", - "sv"=>"Swedish", - "tr"=>"Turkish", - "ara"=>"Arabic", - "chh"=>"Chinese (Hong Kong SAR)", - "chs"=>"Chinese (Simplified)", - "cht"=>"Chinese (Traditional)", - "csy"=>"Czech", - "dan"=>"Danish", - "nld"=>"Dutch", - "enu"=>"English", - "fin"=>"Finnish", - "fra"=>"French", - "deu"=>"German", - "ell"=>"Greek", - "heb"=>"Hebrew", - "hun"=>"Hungarian", - "ita"=>"Italian", - "jpn"=>"Japanese", - "kor"=>"Korean", - "nor"=>"Norwegian", - "plk"=>"Polish", - "ptb"=>"Portugese (Brazil)", - "ptg"=>"Portugese (Portugal)", - "rus"=>"Russian", - "esn"=>"Spanish", - "sve"=>"Swedish", - "trk"=>"Turkish", - ); - - -sub name_valid($) -{ -my($name)=@_; - $name=~tr/-/_/; - $name=lc $name; - return 0 if $name=~/[^a-z]ia64[^a-z]/; - return 1; -} - -sub name_to_lang($) -{ -my($name)=@_; - - $name=~tr/-/_/; - $name=lc $name; - my $r; - while (my($subst,$long)=each(%lang)) { - next if $name!~/[^a-z]$subst[^a-z]/; -# FIXME - cluck "$name: $subst" if $r; - $r=$long; - } -# FIXME - cluck $name if !$r; - return $r; -} - -my @checked_build=qw( - chk - debug - ); - -sub name_is_debug($) -{ -my($name)=@_; - - $name=~tr/-/_/; - $name=lc $name; - for my $subst (@checked_build) { - return 1 if $name=~/[^a-z]$subst[^a-z]/; - } - return 0; -} - -my $ver_prefix="5.1.2600."; -my @stack_out; -my %md5sum_printed_global; - -sub stack0_flush() -{ - return if $opt_quiet; - # $md5sum_printed_local[$stacki]{md5}=1; - my @md5sum_printed_local; - while (my $stack=shift @stack_out) { - my $hiding=1; - for my $stacki (0..$#$stack) { - my $this=$stack->[$stacki]; - $hiding=0 if !$md5sum_printed_local[$stacki]{$this->{"md5"}}; - next if $hiding; - splice @md5sum_printed_local,$stacki,@md5sum_printed_local-$stacki,{$this->{"md5"}=>1}; - my $dupe_global=$md5sum_printed_global{$this->{"md5"}}++; - my $print=""; - $print.=<<"HERE" if $dupe_global; - -HERE - $print.=<<"HERE" if !$dupe_global; - -{"is_debug"} ? "" : "Checked Build "]}@{[ $this->{"lang"} ]} $ver_prefix@{[ $this->{"ver"} ]} @{[ $this->{"this_name"} ]}" /> -HERE - $print=~s/^/"\t" x (1+$stacki)/egm; - print $print; - } - } - print "\n"; -} - -our @stack; -my %md5sum_stored; -my $last_stack0_filename; - -sub check($$) -{ -my($filename_unused,$basename_orig)=@_; - - return if !$type{lc $basename_orig}; - my $final_type=$basename_orig; - my $final_name=$type{$final_type} or confess; - $final_type="ntoskrnl.exe" if $final_type=~/^nt.*[.]exe$/; - (my $basename_orig_=$basename_orig)=~s/.$/_/; - (my $basename0=$stack[0]->{"filename"})=~s{^.*/}{} or confess; - return if !name_valid($basename0); - stack0_flush() if $last_stack0_filename && $last_stack0_filename ne $stack[0]->{"filename"}; - $last_stack0_filename=$stack[0]->{"filename"}; - for my $stacki (0..$#stack) { - my $this=$stack[$stacki]; - my $filename=$this->{"filename"} or confess; - my $relname=$this->{"relname"} or confess; - (my $basename=$filename)=~s{^.*/}{} or confess; - my $expanded=$stack[$#stack]->{"filename"}; - my $this_name; - my $type; - if ($stacki==$#stack-1 && $basename eq $basename_orig_) { - $this->{"type"} eq "cabinet" or confess; - $type=$this->{"type"} or confess; - $this_name="$final_name Cabinet"; - } - elsif ($stacki<$#stack) { - $type=$this->{"type"} or confess; - $this_name="Cabinet"; - } - else { - $type=$final_type or confess; - confess Dumper(\@stack) if $type eq "cabinet"; - $this_name=$final_name; - } - my $length=(stat $filename)[7] or confess; - my $dist=$stack[0]->{"filename"}; - $dist=~s{^.*/}{} or confess; - my $lang=name_to_lang $basename0; - local *F; - open F,$expanded or confess; - my $buf=""; - my $buf2; - my $ver; - while (my $got=read F,$buf2,0x1000) { - confess $expanded if !defined $got; - last if !$got; - confess $expanded if $got<0; - confess $expanded if length($buf2)!=$got; - $buf.=$buf2; - $ver=$buf; - $ver=~s/\x00\x00+/!/g; - $ver=~tr/\x00//d; - $ver=~tr/!/\x00/; - last if $ver=~s/^.*\x00\Q$ver_prefix\E(\d+)[ \x00].*$/$1/s; - $ver=undef(); - $buf=substr($buf,-0x100); - } - confess $expanded if !$ver; - close F or confess; - $ver=~/^\d+$/ or confess "$expanded: $ver"; - my $pri=sprintf "510%04u00",$ver; - $pri+=90; - $pri-=10 if $lang ne "English"; - $pri-=20 if $basename_orig=~/^ntkrnlpa/; - $pri-=40 if $basename_orig=~/^ntkrnlmp/; - $pri-=60 if $basename_orig=~/^ntkrpamp/; - $pri+=5000000 if my $is_debug=name_is_debug $basename0; - local *F; - open F,$filename or confess; - my $md5obj=Digest::MD5->new(); - $md5obj->addfile(*F); - close F or confess; - my $md5sum=lc $md5obj->hexdigest(); - if (!$md5sum_stored{$md5sum}++ && $out && $stacki==$#stack) { - my $dir="$out/$final_type"; - - mkdir_checked($dir) if !-d $dir; - spawn("cp -p '$filename' '$dir/$md5sum'"); - } - - my %new=( - %$this, - "type"=>$type, - "length"=>$length, - "priority"=>$pri, - "md5"=>$md5sum, - "dist"=>$dist, - "lang"=>$lang, - "ver"=>$ver, - "this_name"=>$this_name, - "is_debug"=>$is_debug, - ); - # Highest priority/version of all the files in the cabinet: - for (qw(ver priority)) { - next if !$this->{$_}; - $new{$_}=$this->{$_} if $new{$_}<$this->{$_}; - delete $this->{$_} if $this->{$_}<$new{$_}; - } - do { cluck Dumper($this,\%new) if $new{$_} ne $this->{$_}; } for keys(%$this); - %$this=%new; - } - # It is intentional to copy only the references - to update their "ver". - push @stack_out,[@stack]; -} - -sub spawn($) -{ -my($command)=@_; - - my $code=system "($command)".' >&2'; - confess "$code: $command" if $code; -} - -sub rm_rf($) -{ -my($dir)=@_; - - return if !-e $dir; - # Do not: Can't remove directory xyzzy: Directory not empty - # -r--r--r-- xyzzy - # remove \1,$dir or confess "$dir: $!"; - spawn "rm -rf '$dir'"; -} - -sub mkdir_checked -{ -my(@dirs)=@_; - - for (@dirs) { - mkdir $_ or confess "$_: $!"; - } -} - - -our $depth=-1; - -sub prep() -{ - confess if $dirnew; - $dirnew="$tmp/$depth"; - chdir "/" or confess; - rm_rf $dirnew; - mkdir_checked $dirnew; - chdir $dirnew or confess "chdir: $dirnew"; - return $dirnew; -} - -sub relname($) -{ -my($filename)=@_; - - return $filename if $filename=~s{^\Q$tmp\E/\d+/}{}; - (my $basename=$filename)=~s{^.*/}{} or confess; - return $basename; -} - -my %unknown; -sub process(;$$); -sub process(;$$) -{ -my($ref,$reftype)=@_; - - my $dirname=$dirnew or confess; - $dirnew=undef(); - local $depth=$depth+1; - my @stack_orig=@stack; - local @stack; - - # Handle so-called 'mspatch'. - # Look for Product/Technology: Platform SDK - # Item like: Microsoft Windows SDK - # http://www.microsoft.com/downloads/details.aspx?FamilyID=2297bdc9-b5ae-4b8a-b601-eef54a52867a&DisplayLang=en - # http://download.microsoft.com/download/0/7/3/073d42b8-e2ba-4293-ad97-28365dc2d655/6.0.5270.0.9.WindowsSDK_Vista_idw.DVD.Rel_Update.img - # Setup/WinSDK-SDK_MSI_SMP-common.0.cab - # APATCH 5.1.2600.0 Patch Application Utility - # Do not use: Windows Installer SDK (x86): APATCH 1.94 Patch Application Utility - # as it will break on some files (incompatible with some new features). - # You need proper Wine setup incl. its binary filetype registration. - if (-e "$dirname/_sfx_manifest_") { - Config::IniHash::ReadINI("_sfx_manifest_", - # The only way how to read it in the original order: - "forValue"=>sub { - my($dest_raw,$src_raw,$sectionname,$inihashref)=@_; - return if $sectionname ne "Deltas"; - $dest_raw=~tr{\\}{/}; - $src_raw=~tr{\\}{/}; - my $dest=($dest_raw=~/^\s*"([^"]+)"\s*$/)[0] or confess; - my($patch,$src)=($src_raw=~/^\s*"([^"]+)"\s*,\s*"([^"]+)"\s*$/) or confess; - my $destdir=File::Basename::dirname($dest); - cluck "$dirname/$patch" if !-r "$dirname/$patch"; - cluck "$dirname/$src" if !-r "$dirname/$src"; - # Not &mkdir: Take care of already existing directories and ... "-p". - spawn "mkdir -p '$dirname/$destdir'"; - rm_rf "$dirname/$dest"; - spawn "true;(apatch '$dirname/$patch' '$dirname/$src' '$dirname/$dest' &>/dev/null)"; - return; - }, - ); - } - - local *FIND; - open FIND,"find '$dirname' -type f|sort|" or confess $dirname; - local $_; - while () { - next if $_ eq ""; - print STDERR "." if !$depth; - chomp; - my $filename=$_; - $filename=~m{^/} or confess $filename; - (my $basename=$filename)=~s{^.*/}{} or confess; - -r $filename or do { cluck Dumper(\@stack,$filename); system("ls -l '$filename'"); }; - $$ref=$reftype if $ref; - my $this={ - "filename"=>$filename, - "relname"=>relname($filename), - }; - @stack=(@stack_orig,$this); - - if ($basename=~/[.]_p$/) { - do { cluck "Missing $_" if !-e $_; } for "_sfx_manifest_"; - next; - } - - check $filename,$basename; - - local *MIME; - open MIME,"file -b -i '$filename'|" or confess; - my $mime=do { local $/; or confess; }; - close MIME or confess; - chomp $mime; - next if $mime=~m{^text/}; - next if $mime=~m{^image/}; - next if $mime=~m{^audio/}; - next if $mime eq 'application/x-empty'; - next if $mime eq 'application/msaccess'; - - local *ID; - open ID,"file -b '$filename'|" or confess; - my $id=do { local $/; or confess; }; - close ID or confess; - chomp $id; - next if $id eq 'Microsoft Office Document'; - next if $id=~/^PDF document, version 1[.]\d+$/; - next if $id eq 'Rich Text Format data, version 1,'; - next if $id=~/^x86 boot sector, /; - next if $id eq 'data'; - next if $id eq 'MZ executable for MS-DOS'; - next if $id eq 'XML document text'; - next if $id eq 'MS Windows HtmlHelp Data'; - next if $id eq 'MPEG sequence'; - next if $id=~/^MSVC program database ver /; - next if $id eq 'Lotus 1-2-3'; - next if $id eq 'MS Windows Help Data'; - next if $id=~/^Macromedia Flash data, /; - next if $id eq 'Microsoft ASF'; # .wmv - next if $id eq 'GLF_BINARY_LSB_FIRST'; # .hlp - next if $id=~/^Sendmail frozen configuration /; - next if $id eq 'Assembler source'; - next if $id=~/^DBase 3 data file/; - next if $id=~/^Macintosh HFS Extended version /; - next if $id=~/^MPEG ADTS, /; # .txt?,.hlp? - next if $id eq 'MS-DOS executable (COM)'; - next if $id eq 'NE executable for MS Windows 3.x (driver)'; - next if $id eq 'TrueType font data'; - next if $id eq 'Windows NT registry file'; - next if $id eq 'lif file'; # .sig? - next if $id=~/^Infocom game data /; # .chm? - next if $id=~/^Sun disk label /; # .dl_? - next if $id=~/^compiled Java class data, /; - next if $id=~/^Minix filesystem/; # .dl_? - next if $id eq 'DBase 3 index file'; # .nls? - next if $id=~/^Macintosh MFS data /; # .cp_? - next if $id eq 'ACB archive data'; # .cat? - next if $id eq 'COM executable for MS-DOS'; # .edb? - next if $id eq 'SysEx File - Gulbransen'; # .edb? - next if $id eq 'LE executable for MS Windows (VxD)'; # .386? - - # Do not: - #next if $id=~/^PE executable for MS Windows .* 32-bit$/; # TODO - - if ($id eq 'PE executable for MS Windows (GUI) Intel 80386 32-bit, InnoSetup self-extracting archive') { - # FIXME: http://innounp.sourceforge.net/ - next; - } - if (0 - || $id=~/^Microsoft Cabinet archive data, \d+ byte(?:s)?, \d+ file(?:s)?$/ - || $id eq 'PE executable for MS Windows (GUI) Intel 80386 32-bit, MS CAB-Installer self-extracting archive' - # Catch all unidentified flying cabinets: - || $id=~/^PE executable for MS Windows .* 32-bit$/ - ) { - # Acceleration: Spawning cabextract(1) is slow, try to find "MSCF" first. - local *CAB; - open CAB,$filename or confess $filename; - my $buf=""; - my $buf2; - my $mscf; # magic - while (my $got=read CAB,$buf2,0x1000) { - confess $filename if !defined $got; - last if !$got; - confess $filename if $got<0; - confess $filename if length($buf2)!=$got; - $buf.=$buf2; - last if $mscf=($buf=~/MSCF/s); - $buf=substr($buf,-4); - } - close CAB or confess; - next if !$mscf; - prep(); - spawn q{cabextract -q '}.$filename.q{' 2>&1|grep -v ': \(}.join(q{\|}, - q{WARNING; possible [0-9]* extra bytes at end of file.}, - q{no valid cabinets found}, - q{checksum error}, - q{error in CAB data format}, - ).q{\)$';true}; - process(\$this->{"type"},"cabinet"); - next; - } - if (0 - || $id eq 'PE executable for MS Windows (GUI) Intel 80386 32-bit, ZIP self-extracting archive (WinZip)' - || $id=~/^Zip archive data, / - ) { - prep(); - spawn "unzip -q '$filename'"; - process(); - next; - } - # non-"32-bit" - amd64 in fact but not detected by file(1). - # Really. - next if $id=~/^PE executable for MS Windows/; - if ($id=~m{^gzip compressed data, was "\S+", from Win/32}) { - prep(); - spawn "gzip -d <'$filename' >'$basename'"; - process(); - next; - } - if ($id eq 'tar archive') { - prep(); - spawn "tar xf '$filename'"; - process(); - next; - } - warn "$filename: $mime - $id" if !$unknown{$mime,$id}++; - } - close FIND or confess; - $dirnew=undef(); -} - - -$dirnew=getcwd()."/".$dirnew if $dirnew!~m{^/}; -$out =getcwd()."/".$out if $out && $out!~m{^/}; -rm_rf $tmp; -mkdir_checked $tmp; -if ($out) { - rm_rf $out; - mkdir_checked $out; - } -$|=1; -print <<"HERE"; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -HERE -process; -stack0_flush() if $last_stack0_filename; -rm_rf $tmp; -print STDERR "\n"; -print <<'HERE'; - - -HERE diff --git a/src/install/acquire/captivemodid.c b/src/install/acquire/captivemodid.c deleted file mode 100644 index bc9c24d..0000000 --- a/src/install/acquire/captivemodid.c +++ /dev/null @@ -1,332 +0,0 @@ -/* $Id$ - * W32 disk modules identifier for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captivemodid.h" /* self */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "../../libcaptive/include/captive/libxml.h" - -#include - - -gchar *calc_md5(gconstpointer base,size_t length) -{ -unsigned char md5_bin[1+128/8]; /* 128 bits==16 bytes; '1+' for leading stub to prevent shorter output of BN_bn2hex() */ -BIGNUM *bignum; -char *hex; -gchar *r,*gs; - - /* already done above */ - /* Calculate MD5 sum and convert it to hex string: */ - MD5(base,length,md5_bin+1); - md5_bin[0]=0xFF; /* stub to prevent shorter output of BN_bn2hex() */ - bignum=BN_bin2bn(md5_bin,1+128/8,NULL); - hex=BN_bn2hex(bignum); - g_assert(strlen(hex)==2*(1+128/8)); - r=g_strdup(hex+2); - OPENSSL_free(hex); - BN_free(bignum); - - g_assert(strlen(r)==32); - for (gs=r;*gs;gs++) { - g_assert(isxdigit(*gs)); - *gs=tolower(*gs); - g_assert(isxdigit(*gs)); - } - return r; -} - - -/* map: GINT_TO_POINTER(captivemodid_module.length) -> !=NULL */ -static GHashTable *module_valid_length_hash; - -static void module_valid_length_hash_init(void) -{ - if (module_valid_length_hash) - return; - module_valid_length_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - -/* map: (const xmlChar *)md5 -> (struct captivemodid_module *) */ -static GHashTable *module_md5_hash; - -static void module_md5_hash_init(void) -{ - if (module_md5_hash) - return; - module_md5_hash=g_hash_table_new(g_str_hash,g_str_equal); -} - -/* map: (const xmlChar *)type -> (gpointer)GINT_TO_POINTER(priority) */ -/* We remove entry for module with already the best priority found, - * therefore captivemodid_module_type_best_priority_lookup() will return - * 'G_MININT' afterwards. - */ -static GHashTable *module_type_best_priority_hash; - -static void module_type_best_priority_hash_init(void) -{ - if (module_type_best_priority_hash) - return; - module_type_best_priority_hash=g_hash_table_new(g_str_hash,g_str_equal); -} - -static void captivemodid_load_module(struct captivemodid_module *module) -{ -struct captivemodid_module *module_md5_conflict; -gpointer valid_length_value_gpointer; - - module_md5_hash_init(); - if ((module_md5_conflict=g_hash_table_lookup(module_md5_hash,module->md5))) { - g_warning(_("Ignoring module \"%s\" as it has MD5 conflict with: %s"), - module->id,module_md5_conflict->id); - return; - } - g_hash_table_insert(module_md5_hash,(/* de-const */ xmlChar *)module->md5,module); - - module_valid_length_hash_init(); - if (!g_hash_table_lookup_extended(module_valid_length_hash,GINT_TO_POINTER(module->length), - NULL, /* orig_key */ - &valid_length_value_gpointer)) /* value */ - g_hash_table_insert(module_valid_length_hash,GINT_TO_POINTER(module->length),GINT_TO_POINTER(module->cabinet_used)); - else { - /* Conflicting 'cabinet_used' values for single 'cabinet size'? */ - if (valid_length_value_gpointer && GPOINTER_TO_INT(valid_length_value_gpointer)!=module->cabinet_used) - g_hash_table_insert(module_valid_length_hash,GINT_TO_POINTER(module->length),NULL); - } - - if (strcmp((const char *)module->type,"cabinet")) { - if (module->priority>captivemodid_module_type_best_priority_lookup(module->type)) { - module_type_best_priority_hash_init(); - g_hash_table_insert(module_type_best_priority_hash, - (/* de-const */ xmlChar *)module->type,GINT_TO_POINTER(module->priority)); - } - } -} - -gboolean captivemodid_module_length_is_valid(GnomeVFSFileSize file_size) -{ -gint file_size_gint; - - if ((GnomeVFSFileSize)(file_size_gint=file_size)!=file_size) /* Size too big to be valid. */ - return FALSE; - module_valid_length_hash_init(); - return g_hash_table_lookup_extended(module_valid_length_hash,GINT_TO_POINTER(file_size_gint), - NULL, /* orig_key */ - NULL); /* value */ -} - -gint captivemodid_cabinet_length_to_used(gint cabinet_length) -{ -gpointer valid_length_value_gpointer; - - if (!g_hash_table_lookup_extended(module_valid_length_hash,GINT_TO_POINTER(cabinet_length), - NULL, /* orig_key */ - &valid_length_value_gpointer)) /* value */ - return 0; - return GPOINTER_TO_INT(valid_length_value_gpointer); -} - -struct captivemodid_module *captivemodid_module_md5_lookup(const gchar *file_md5) -{ - g_return_val_if_fail(file_md5!=NULL,NULL); - - module_md5_hash_init(); - return g_hash_table_lookup(module_md5_hash,file_md5); -} - -gint captivemodid_module_type_best_priority_lookup(const xmlChar *module_type) -{ -gpointer r_gpointer; -gboolean errbool; - - g_return_val_if_fail(module_type!=NULL,G_MININT); - - module_type_best_priority_hash_init(); - errbool=g_hash_table_lookup_extended(module_type_best_priority_hash, - module_type, /* lookup_key */ - NULL, /* orig_key */ - &r_gpointer); /* value */ - if (!errbool) - return G_MININT; - - return GPOINTER_TO_INT(r_gpointer); -} - -/* Returns: TRUE if all modules were found. */ -gboolean captivemodid_module_type_best_priority_found(const xmlChar *module_type) -{ -gboolean errbool; - - g_return_val_if_fail(module_type!=NULL,FALSE); - - module_type_best_priority_hash_init(); - errbool=g_hash_table_remove(module_type_best_priority_hash,module_type); - g_assert(errbool==TRUE); - - return !g_hash_table_size(module_type_best_priority_hash); -} - -static xmlChar *captivemodid_load_module_xml_get_attr - (const gchar *captivemodid_pathname,xmlTextReader *xml_reader,const gchar *attr_name) -{ -xmlChar *r; - - if (!(r=xmlTextReaderGetAttribute(xml_reader,BAD_CAST attr_name))) { - /* FIXME: File line identification? */ - g_warning(_("%s: Undefined attributes: %s"),captivemodid_pathname,attr_name); - return NULL; - } - return r; -} - -static long captivemodid_load_module_xml_get_attr_l - (const gchar *captivemodid_pathname,xmlTextReader *xml_reader,const gchar *attr_name,long num_min,long num_max) -{ -xmlChar *string; -long r; -char *ends; - - g_return_val_if_fail(num_min-1num_max) { - g_warning(_("%s: Numer of out range %ld..%ld: %ld"),captivemodid_pathname,num_min,num_max,r); - return num_min-1; - } - return r; -} - -static void captivemodid_load_module_xml(const gchar *captivemodid_pathname,xmlTextReader *xml_reader) -{ -struct captivemodid_module *module; -xmlChar *cabinet_used_string; - - captive_new0(module); - if (!(module->type=captivemodid_load_module_xml_get_attr(captivemodid_pathname,xml_reader,"type"))) - goto fail_free_module; - if (!(module->md5 =captivemodid_load_module_xml_get_attr(captivemodid_pathname,xml_reader,"md5"))) - goto fail_free_module; - if (strlen((const char *)module->md5)!=strspn((const char *)module->md5,"0123456789abcdef")) { - g_warning(_("%s: Attribute 'md5' can be only lower-cased hexstring: %s"),captivemodid_pathname,module->md5); - goto fail_free_module; - } - if (strlen((const char *)module->md5)!=32) { - g_warning(_("%s: Attribute 'md5' length must be 32: %s"),captivemodid_pathname,module->md5); - goto fail_free_module; - } - if (!(module->id =captivemodid_load_module_xml_get_attr(captivemodid_pathname,xml_reader,"id"))) - goto fail_free_module; - if (0>=(module->length=captivemodid_load_module_xml_get_attr_l( - captivemodid_pathname,xml_reader,"length",1,G_MAXINT-1))) - goto fail_free_module; - if (!(cabinet_used_string=xmlTextReaderGetAttribute(xml_reader,BAD_CAST "cabinet_used"))) - module->cabinet_used=0; - else { - xmlFree(cabinet_used_string); - if (0>=(module->cabinet_used=captivemodid_load_module_xml_get_attr_l( - captivemodid_pathname,xml_reader,"cabinet_used",1,G_MAXINT-1))) - goto fail_free_module; - } - if (G_MININT>=(module->priority=captivemodid_load_module_xml_get_attr_l(captivemodid_pathname,xml_reader,"priority", - G_MININT+1,G_MAXINT-1))) - goto fail_free_module; - captivemodid_load_module(module); - return; - -fail_free_module: - xmlFree((xmlChar *)module->type); - xmlFree((xmlChar *)module->md5); - xmlFree((xmlChar *)module->id); - g_free(module); -} - -static void captivemodid_load_foreach - (const xmlChar *type /* key */,gpointer priority_gpointer /* value */,gpointer user_data /* unused */) -{ - g_return_if_fail(type!=NULL); - - g_return_if_fail(captivemodid_module_best_priority_notify!=NULL); - - (*captivemodid_module_best_priority_notify)((const gchar *)type); -} - -void (*captivemodid_module_best_priority_notify)(const gchar *module_type); - -gboolean captivemodid_load(const gchar *captivemodid_pathname) -{ -xmlTextReader *xml_reader; - - if (!(xml_reader=xmlNewTextReaderFilename(captivemodid_pathname))) - return FALSE; - while (1==xmlTextReaderRead(xml_reader)) { - switch (xmlTextReaderNodeType(xml_reader)) { - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_COMMENT: - break; - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_SIGNIFICANT_WHITESPACE: - break; - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_TEXT: /* Even empty nodes have some '#text'. */ - break; - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_END: /* We do not track tag ends. */ - break; - - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_START: { -const xmlChar *xml_name; - - xml_name=xmlTextReaderName(xml_reader); - /**/ if (!xmlStrcmp(xml_name,BAD_CAST "modid")) { /* root tag */ - } - else if (!xmlStrcmp(xml_name,BAD_CAST "module")) - captivemodid_load_module_xml(captivemodid_pathname,xml_reader); - else g_warning(_("%s: Unknown ELEMENT node: %s"),captivemodid_pathname,xml_name); - xmlFree((xmlChar *)xml_name); - } break; - - default: g_assert_not_reached(); - } - } - xmlFreeTextReader(xml_reader); - - if (captivemodid_module_best_priority_notify) { - g_hash_table_foreach(module_type_best_priority_hash, - (GHFunc)captivemodid_load_foreach,NULL); - } - return TRUE; -} diff --git a/src/install/acquire/captivemodid.h b/src/install/acquire/captivemodid.h deleted file mode 100644 index c40bd75..0000000 --- a/src/install/acquire/captivemodid.h +++ /dev/null @@ -1,54 +0,0 @@ -/* $Id$ - * Include file for W32 disk modules identifier for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_CAPTIVEMODID_H -#define _CAPTIVE_INSTALL_ACQUIRE_CAPTIVEMODID_H 1 - - -#include -#include -#include /* for xmlChar */ -#include - - -G_BEGIN_DECLS - -struct captivemodid_module { - const xmlChar *type; - gint length; - const xmlChar *md5; - const xmlChar *id; - gint priority; - gint cabinet_used; - }; - -extern void (*captivemodid_module_best_priority_notify)(const gchar *module_type); - -gchar *calc_md5(gconstpointer base,size_t length); -gboolean captivemodid_module_length_is_valid(GnomeVFSFileSize file_size); -struct captivemodid_module *captivemodid_module_md5_lookup(const gchar *file_md5); -gint captivemodid_module_type_best_priority_lookup(const xmlChar *module_type); -gboolean captivemodid_module_type_best_priority_found(const xmlChar *module_type); -gboolean captivemodid_load(const gchar *captivemodid_pathname); -gint captivemodid_cabinet_length_to_used(gint cabinet_length); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_CAPTIVEMODID_H */ diff --git a/src/install/acquire/compatibility-test.sh b/src/install/acquire/compatibility-test.sh deleted file mode 100755 index e8f8dce..0000000 --- a/src/install/acquire/compatibility-test.sh +++ /dev/null @@ -1,124 +0,0 @@ -#! /bin/sh -# -# $Id$ -# Test compatibility of the "ntfs.sys" and "ntoskrnl.exe" files. -# Copyright (C) 2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# Example result: -# - - -set -e -#set -x - -# Directory containing /ntfs.sys/* and /ntoskrnl.exe/* files to test. -out="$1" - -# Second directory containing files exactly like $out; appended. -out_extra="$2" - -# Binary regular file containing NTFS image with >=1500k of free space. -# This file is never modified. -image="$3" - - -test -d "$out" -test -d "$out_extra" -test -f "$image" - -# Test commit() at the written 1MB: -head -qc 1500k /dev/urandom >/tmp/captive-sanity-orig.bin -rm -rf /tmp/captive-sanity-module -mkdir /tmp/captive-sanity-module - -: >/tmp/captive-sanity-out-all - -count_ntfs=` echo $out/ntfs.sys/* $out_extra/ntfs.sys/* |tr ' ' '\n'|wc -l` -count_ntoskrnl=`echo $out/ntoskrnl.exe/* $out_extra/ntoskrnl.exe/*|tr ' ' '\n'|wc -l` -count_combo=$[$count_ntfs*$count_ntoskrnl] - -total_passed=0 -total_export=0 -total_error=0 -total_ok=0 - -cat </tmp/captive-sanity-command -put /tmp/captive-sanity-orig.bin sanity.bin -get sanity.bin /tmp/captive-sanity-copy.bin -quit -HERE - -for ntfs_sys in $out/ntfs.sys/* $out_extra/ntfs.sys/* ;do -rm -f /tmp/captive-sanity-module/ntfs.sys -ln $ntfs_sys /tmp/captive-sanity-module/ntfs.sys - -for ntoskrnl_exe in $out/ntoskrnl.exe/* $out_extra/ntoskrnl.exe/*;do -rm -f /tmp/captive-sanity-module/ntoskrnl.exe -ln $ntoskrnl_exe /tmp/captive-sanity-module/ntoskrnl.exe - -rm -f /tmp/captive-sanity-copy.bin -set +e -../../client/cmdline/captive-cmdline /tmp/captive-sanity-out -error=$? -set -e -if grep -q 'Export not found for: ' /tmp/captive-sanity-out;then - total_export=$[$total_export+1] -elif [ $error -ne 0 ];then - total_error=$[$total_error+1] - cat /tmp/captive-sanity-out - cat <>/tmp/captive-sanity-out-all --------- -ntfs.sys=$ntfs_sys -ntoskrnl.exe=$ntoskrnl_exe -HERE - cat /tmp/captive-sanity-out >>/tmp/captive-sanity-out-all -else - cmp /tmp/captive-sanity-orig.bin /tmp/captive-sanity-copy.bin - total_ok=$[$total_ok+1] -fi -rm -f /tmp/captive-sanity-copy.bin - -total_passed=$[$total_passed+1] -echo "done: $total_passed of $count_combo [total_export=$total_export total_error=$total_error total_ok=$total_ok]" - -done -done 2>&1 | grep -v 'sanity: line .*: .* Aborted.*captive-cmdline' - -rm -rf /tmp/captive-sanity-module -rm -f /tmp/captive-sanity-orig.bin -rm -f /tmp/captive-sanity-command - -echo "--------" -cat /tmp/captive-sanity-out-all - -echo "--------" -echo /tmp/captive-sanity-out-all - -# Do not: echo "total_export=$total_export" -# echo "total_error=$total_error" -# echo "total_ok=$total_ok" -# as the variables will not pass out of the 'for...done' loop above. diff --git a/src/install/acquire/diskscan.c b/src/install/acquire/diskscan.c deleted file mode 100644 index e958b3d..0000000 --- a/src/install/acquire/diskscan.c +++ /dev/null @@ -1,158 +0,0 @@ -/* $Id$ - * W32 disk modules finder for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include "../libcaptive-install/proc_partitions.h" -#include "main.h" -#include - - -/* Config: */ -#define FILENAME_ETC_MTAB "/etc/mtab" - - -struct mod_uri_libntfs_proc_partitions_foreach_param { - GHashTable *proc_partitions_ntfs_hash; - GList *uri_list; /* of (GnomeVFSURI *) */ - }; - -static void mod_uri_libntfs_proc_partitions_foreach(const gchar *device /* key */,const gchar *vol_name /* value */, - struct mod_uri_libntfs_proc_partitions_foreach_param *foreach_param /* user_data */) -{ -GnomeVFSURI *uri_device,*uri_libntfs; -static gboolean libntfs_warned=FALSE; - - g_return_if_fail(device!=NULL); - g_return_if_fail(vol_name!=NULL); - g_return_if_fail(foreach_param!=NULL); - - uri_libntfs=gnome_vfs_uri_new("libntfs:///"); - if (!uri_libntfs) { - if (!libntfs_warned) { - libntfs_warned=TRUE; - g_warning(_("'libntfs' GnomeVFS method not supported; install package 'ntfsprogs-gnomevfs' >=%s"),"1.8.0beta2"); - } - return; - } - g_assert(uri_libntfs->parent==NULL); - - uri_device=gnome_vfs_uri_new("file:///"); - g_assert(uri_device!=NULL); - uri_device=gnome_vfs_uri_append_path(uri_device,device); - g_assert(uri_device->parent==NULL); - - uri_libntfs->parent=uri_device; - - foreach_param->uri_list=g_list_prepend(foreach_param->uri_list,uri_libntfs); -} - -static GList * /* of (GnomeVFSURI *) */ mod_uri_libntfs_proc_partitions(void) -{ -/* map: (gchar *)device -> (gchar *)vol_name */ -GHashTable *proc_partitions_ntfs_hash; -struct mod_uri_libntfs_proc_partitions_foreach_param foreach_param; - - proc_partitions_ntfs_hash=proc_partitions_ntfs_hash_get(optarg_verbose); - - foreach_param.proc_partitions_ntfs_hash=proc_partitions_ntfs_hash; - foreach_param.uri_list=NULL; - g_hash_table_foreach(proc_partitions_ntfs_hash, - (GHFunc)mod_uri_libntfs_proc_partitions_foreach, /* func */ - &foreach_param); /* user_data */ - g_hash_table_destroy(proc_partitions_ntfs_hash); - - return foreach_param.uri_list; -} - - -static GList * /* of (GnomeVFSURI *) */ mod_uri_mtab(void) -{ -struct mntent *mntent; -FILE *mntentfiler; -GList *uri_list; /* of (GnomeVFSURI *) */ -GnomeVFSURI *uri; - - if (!(mntentfiler=setmntent(FILENAME_ETC_MTAB,"r"))) { - g_warning(_("Cannot open \"%s\" for reading: %m"),FILENAME_ETC_MTAB); - return NULL; - } - uri_list=NULL; - while ((mntent=getmntent(mntentfiler))) { - if (!strcmp(mntent->mnt_type,"proc")) /* optimize... */ - continue; - uri=gnome_vfs_uri_new("file:///"); - g_assert(uri!=NULL); - uri=gnome_vfs_uri_append_path(uri,mntent->mnt_dir); - uri_list=g_list_prepend(uri_list,uri); - } - if (1!=endmntent(mntentfiler)) - g_warning(_("Cannot close \"%s\" after reading: %m"),FILENAME_ETC_MTAB); - - return uri_list; -} - -static GList * /* of (GnomeVFSURI *) */ filter_non_local_uri(GList * /* of (GnomeVFSURI *) */ uri_list) -{ -GList *uril; - - /* Filter-out non-local URIs */ - for (uril=uri_list;uril;) { -GnomeVFSURI *uri=uril->data; -GList *uril_remove; - - if (!gnome_vfs_uri_is_local(uri)) { - if (optarg_verbose) { -gchar *uri_string; - - uri_string=gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_PASSWORD); - g_message(_("Ignoring URI in auto-search as it is not local: %s"),uri_string); - g_free(uri_string); - } - uril_remove=uril; - uril=uril->next; - gnome_vfs_uri_unref(uri); - /* It is safe to be used during traversal this way: */ - uri_list=g_list_remove_link(uri_list,uril_remove); - /* Prevent auto-traversal to the next list item: */ - continue; - } - uril=uril->next; - } - return uri_list; -} - -GList * /* of (GnomeVFSURI *) */ mod_uri_list(void) -{ -GList *uri_list; - - uri_list=NULL; - - uri_list=g_list_concat(uri_list,mod_uri_mtab()); - uri_list=g_list_concat(uri_list,mod_uri_libntfs_proc_partitions()); - - uri_list=filter_non_local_uri(uri_list); - - return uri_list; -} diff --git a/src/install/acquire/diskscan.h b/src/install/acquire/diskscan.h deleted file mode 100644 index 067bed1..0000000 --- a/src/install/acquire/diskscan.h +++ /dev/null @@ -1,35 +0,0 @@ -/* $Id$ - * Include file for W32 disk modules finder for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_DISKSCAN_H -#define _CAPTIVE_INSTALL_ACQUIRE_DISKSCAN_H 1 - - -#include -#include - - -G_BEGIN_DECLS - -GList * /* of (GnomeVFSURI *) */ mod_uri_list(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_DISKSCAN_H */ diff --git a/src/install/acquire/final.c b/src/install/acquire/final.c deleted file mode 100644 index 508efd9..0000000 --- a/src/install/acquire/final.c +++ /dev/null @@ -1,81 +0,0 @@ -/* $Id$ - * Final result message of drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "final.h" /* self */ -#include -#include -#include -#include -#include - -#include - - -/* Config: */ -#define FILENAME_ETC_FSTAB "/etc/fstab" - - -gchar *final_text(gboolean all_modules_found) -{ -const gchar *base; -FILE *mntentfiler; -struct mntent *mntent; -GString *gstring; -gboolean any_dirs_found; - - if (!all_modules_found) - base=_( - "Although essential modules (\"ntoskrnl.exe\" and \"ntfs.sys\") are available " - "you may still want to get their better version and/or more modules. "); - else - base=_("All needed modules were found in their best preferred versions."); - gstring=g_string_new(base); - - any_dirs_found=FALSE; - /* FIXME: locking! */ - if (!(mntentfiler=setmntent(FILENAME_ETC_FSTAB,"r"))) - g_error(_("Cannot open \"%s\" for reading: %m"),FILENAME_ETC_FSTAB); - while ((mntent=getmntent(mntentfiler))) { - if (strcmp(mntent->mnt_type,"captive-ntfs")) - continue; - if (!any_dirs_found) { - gstring=g_string_append(gstring,captive_printf_alloca(_("\n" - "Found NTFS disk partitions are prepared in %s. " - "You can mount them by commands mount(8) or usermount(1) such as:\n" - "\tmount /mnt/captive-LABEL_C\n" - "Available captive-ntfs partitions:"),FILENAME_ETC_FSTAB)); - any_dirs_found=TRUE; - } - gstring=g_string_append(gstring,"\n\t"); - gstring=g_string_append(gstring,mntent->mnt_dir); - } - if (!any_dirs_found) - gstring=g_string_append(gstring,_("\n" - "Despite drivers were found no NTFS disk partitions were found on your computer. " - "You still can mount read/write NTFS partitions by using filesystem type 'captive-ntfs' such as:\n" - "\tmkdir /mnt/captive-LABEL_C\n" - "\tmount -t captive-ntfs /dev/hda1 /mnt/captive-LABEL_C")); - if (1!=endmntent(mntentfiler)) - g_warning(_("Cannot close \"%s\" after reading: %m"),FILENAME_ETC_FSTAB); - - return g_string_free(gstring, - FALSE); /* free_segment */ -} diff --git a/src/install/acquire/final.h b/src/install/acquire/final.h deleted file mode 100644 index 1cd9263..0000000 --- a/src/install/acquire/final.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $Id$ - * Include file for final result message of drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_FINAL_H -#define _CAPTIVE_INSTALL_ACQUIRE_FINAL_H 1 - - -#include - - -G_BEGIN_DECLS - -gchar *final_text(gboolean all_modules_found); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_FINAL_H */ diff --git a/src/install/acquire/main.c b/src/install/acquire/main.c deleted file mode 100644 index 23e9421..0000000 --- a/src/install/acquire/main.c +++ /dev/null @@ -1,296 +0,0 @@ -/* $Id$ - * Drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ui-line.h" -#include "microsoftcom.h" -#include -#include "diskscan.h" -#include "moduriload.h" -#include -#include -#include -#include "ui-gnome.h" - -#include -#include - - -int optarg_verbose; -int optarg_dry; -static int optarg_microsoft_com; -static int optarg_scan_disks; -static int optarg_scan_disks_quick; -static int optarg_text; -static char *optarg_modid_path=G_STRINGIFY(SYSCONFDIR) "/w32-mod-id.captivemodid.xml"; -static GList *optarg_scan_path_list; /* of (char *) */ - -static void acquire_popt_callback - (poptContext con,enum poptCallbackReason reason,const struct poptOption *opt,const char *arg,const void *data); - -static const struct poptOption popt_table[]={ - { argInfo:POPT_ARG_CALLBACK,arg:(void *)acquire_popt_callback }, - -#define BUG_ACQUIRE_POPT(shortname,longname,argInfoP,argP,valP,descripP,argDescripP) \ - { \ - longName: (longname), \ - shortName: (shortname), \ - argInfo: (argInfoP)|(!(valP) ? 0 : POPT_ARG_VAL), \ - arg: (void *)argP, \ - val: (valP), \ - descrip: (descripP), \ - argDescrip: (argDescripP), \ - } - - BUG_ACQUIRE_POPT(0 ,"text" ,POPT_ARG_NONE ,&optarg_text ,0, - N_("Disable Gnome UI; --text must be first argument"),NULL), - BUG_ACQUIRE_POPT('v',"verbose" ,POPT_ARG_NONE ,&optarg_verbose,0,N_("Display additional debug information"),NULL), - BUG_ACQUIRE_POPT('n',"dry" ,POPT_ARG_NONE ,&optarg_dry ,0,N_("No modifications, no files written"),NULL), - BUG_ACQUIRE_POPT(0 ,"modid-path" ,POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT,&optarg_modid_path,0, - N_("Path to .captivemodid.xml database"),N_("path")), - BUG_ACQUIRE_POPT(0 ,"scan-disks" ,POPT_ARG_NONE ,&optarg_scan_disks,0,N_("Scan all files on local disks"),NULL), - BUG_ACQUIRE_POPT(0 ,"scan-disks-quick",POPT_ARG_NONE ,&optarg_scan_disks_quick,0, - N_("Scan MS-Windows directories on local disks"),NULL), - BUG_ACQUIRE_POPT(0 ,"scan-path" ,POPT_ARG_STRING,NULL ,0, - N_("Scan specified disk path or web URL"),N_("path/URI")), - BUG_ACQUIRE_POPT(0 ,"microsoft-com" ,POPT_ARG_NONE ,&optarg_microsoft_com,0, - N_("Download from microsoft.com; Legal: You may need to have valid Microsoft Windows XP license."),NULL), - -#undef BUG_ACQUIRE_POPT - POPT_TABLEEND - }; - -static const struct poptOption popt_table_autohelp[]={ - { NULL,'\0',POPT_ARG_INCLUDE_TABLE,(struct poptOption *)&popt_table,0,PACKAGE }, - POPT_AUTOHELP - POPT_TABLEEND - }; - -/* poptCallbackType captive_popt_callback */ -static void acquire_popt_callback - (poptContext con,enum poptCallbackReason reason,const struct poptOption *opt,const char *arg,const void *data) -{ - g_return_if_fail(reason==POPT_CALLBACK_REASON_OPTION); - - if (opt->longName && !strcmp(opt->longName,"scan-path")) { - optarg_scan_path_list=g_list_append(optarg_scan_path_list,gnome_vfs_uri_new(arg)); - } -} - - -void (*ui_interactive)(void); - -static gboolean ui_progress_dummy(GnomeVFSURI *uri) -{ - /* 'uri' may be NULL */ - - return FALSE; /* not aborted */ -} - -gboolean (*ui_progress)(GnomeVFSURI *uri)=ui_progress_dummy; -void (*ui_progress_bar)(gint done,gint length); - -static GList *mod_uri_list_local; -static void mod_uri_list_local_init(void) -{ - if (mod_uri_list_local) - return; - mod_uri_list_local=mod_uri_list(); -} - -void scan_disks_quick(void) -{ -GList *mod_uri_list_quick_local,*mod_uri_l; - - mod_uri_list_local_init(); - mod_uri_list_quick_local=NULL; - for (mod_uri_l=mod_uri_list_local;mod_uri_l;mod_uri_l=mod_uri_l->next) { - mod_uri_list_quick_local=g_list_prepend(mod_uri_list_quick_local, - gnome_vfs_uri_append_path(mod_uri_l->data,"windows/system32")); - } - mod_uri_list_quick_local=g_list_reverse(mod_uri_list_quick_local); - g_list_foreach(mod_uri_list_quick_local,(GFunc)mod_uri_load,NULL); - gnome_vfs_uri_list_free(mod_uri_list_quick_local); -} - -void scan_disks(void) -{ - mod_uri_list_local_init(); - g_list_foreach(mod_uri_list_local,(GFunc)mod_uri_load,NULL); -} - -void microsoft_com(void) -{ - g_list_foreach(mod_uri_microsoftcom_list(),(GFunc)mod_uri_load_base_reporting,NULL); -} - -static void scan_batch(void) -{ - g_list_foreach(optarg_scan_path_list,(GFunc)mod_uri_load_base_reporting,NULL); - - if (optarg_scan_disks_quick) - scan_disks_quick(); - if (optarg_scan_disks) - scan_disks(); - if (optarg_microsoft_com) - microsoft_com(); -} - -static jmp_buf gnome_init_atexit_jmpbuf; -static gboolean gnome_init_atexit_disable; - -static void gnome_init_atexit_handler(void) -{ - if (gnome_init_atexit_disable) - return; - - longjmp(gnome_init_atexit_jmpbuf,1); - g_assert_not_reached(); - _exit(EXIT_FAILURE); -} - -gboolean gnome_init_g_log_handler_hit; -static void gnome_init_g_log_handler(const gchar *log_domain,GLogLevelFlags log_level,const gchar *message,gpointer user_data) -{ - gnome_init_g_log_handler_hit=TRUE; - g_log_default_handler(log_domain,log_level,message,user_data); -} - -int main(int argc,char **argv) -{ -poptContext context; -int errint; -gboolean is_interactive; -gboolean no_gnome; - -#if 0 - g_log_set_always_fatal(~(0 - |G_LOG_LEVEL_MESSAGE - |G_LOG_LEVEL_INFO - |G_LOG_LEVEL_DEBUG - )); -#endif - - captive_standalone_init(); - - if (!gnome_vfs_init()) - g_error(_("GnomeVFS failed to initialize")); - - if (argv[1] && !strcmp(argv[1],"--text")) - optarg_text=1; - - no_gnome=(optarg_text || !getenv("DISPLAY") || !*getenv("DISPLAY")); - - if (no_gnome) { - context=poptGetContext( - PACKAGE, /* name */ - argc,(/*en-const*/const char **)argv, /* argc,argv */ - popt_table_autohelp, /* options */ - POPT_CONTEXT_POSIXMEHARDER); /* flags; && !POPT_CONTEXT_KEEP_FIRST */ - if (context==NULL) { - g_assert_not_reached(); /* argument recognization args_error */ - return EXIT_FAILURE; - } - errint=poptReadDefaultConfig(context, - TRUE); /* useEnv */ - if (errint!=0) { - g_assert_not_reached(); /* argument recognization args_error */ - return EXIT_FAILURE; - } - errint=poptGetNextOpt(context); - if (errint!=-1) { - g_assert_not_reached(); /* some non-callbacked argument reached */ - return EXIT_FAILURE; - } - if (poptPeekArg(context)) { - g_error(_("No arguments expected")); - return EXIT_FAILURE; - } - } - else { -GnomeProgram *gnome_program; -guint handler_id; - - captive_standalone_gnome_init(); - gnome_init_atexit_disable=FALSE; - g_atexit(gnome_init_atexit_handler); - gnome_init_g_log_handler_hit=FALSE; - handler_id=g_log_set_handler( - "Gtk", /* log_domain */ - G_LOG_LEVEL_WARNING, /* log_levels */ - gnome_init_g_log_handler, /* log_func */ - NULL); /* user_data */ - if (!setjmp(gnome_init_atexit_jmpbuf)) - gnome_program=gnome_program_init(PACKAGE,VERSION,LIBGNOMEUI_MODULE,argc,argv, - GNOME_PARAM_POPT_TABLE,popt_table, - GNOME_PARAM_POPT_FLAGS,(int)POPT_CONTEXT_POSIXMEHARDER, - NULL); - else { - no_gnome=TRUE; - /* No message: (captive-install-acquire:3693): Gtk-WARNING **: cannot open display: - * was reported, probably only '--help' message was shown. - */ - if (!gnome_init_g_log_handler_hit) - exit(EXIT_SUCCESS); - } - gnome_init_atexit_disable=TRUE; - g_log_remove_handler( - "Gtk", /* log_domain */ - handler_id); /* handler_id */ - } - - is_interactive=(1 - && ! optarg_scan_path_list - && ! optarg_scan_disks_quick - && ! optarg_scan_disks - && ! optarg_microsoft_com); - - /* Initialize UI here to catch all GLog errors below. */ - if (is_interactive - && (no_gnome || !ui_gnome_init()) - && !ui_line_init()) - g_error(_("No UI interface could be initialized")); - - if (!captivemodid_load(optarg_modid_path) && !captivemodid_load("./w32-mod-id.captivemodid.xml")) - g_error(_("Unable to load modid database: %s"),optarg_modid_path); - - mod_uri_load_base_reporting(gnome_vfs_uri_new("file://" G_STRINGIFY(VARLIBCAPTIVEDIR))); - - if (!is_interactive) - scan_batch(); - else - (*ui_interactive)(); - - gnome_vfs_shutdown(); - - return EXIT_SUCCESS; -} diff --git a/src/install/acquire/main.h b/src/install/acquire/main.h deleted file mode 100644 index 7c11693..0000000 --- a/src/install/acquire/main.h +++ /dev/null @@ -1,43 +0,0 @@ -/* $Id$ - * Include file for drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_MAIN_H -#define _CAPTIVE_INSTALL_ACQUIRE_MAIN_H 1 - - -#include -#include - - -G_BEGIN_DECLS - -extern gboolean optarg_verbose; -extern gboolean optarg_dry; -extern void (*ui_interactive)(void); -extern gboolean (*ui_progress)(GnomeVFSURI *uri); -extern void (*ui_progress_bar)(gint done,gint length); - -void scan_disks_quick(void); -void scan_disks(void); -void microsoft_com(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_MAIN_H */ diff --git a/src/install/acquire/microsoftcom.c b/src/install/acquire/microsoftcom.c deleted file mode 100644 index 3b41a9d..0000000 --- a/src/install/acquire/microsoftcom.c +++ /dev/null @@ -1,85 +0,0 @@ -/* $Id$ - * W32 modules finder from microsoft.com Internet download - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "microsoftcom.h" /* self */ -#include -#include -#include -#include -#include - -#include - - -/* Config: */ -/* Do we really need to use indirection by the following 'base' URL? - * It appears to me as if some Microsoft Service Pack files URLs - * have changed in the past. - * Currently we use fixed MICROSOFTDOWNLOAD_URL as we would have to - * implement custom Gnome-VFS http timeouts as 'ACQUIRE_CABINET_READ_RAW_READ_TIMEOUT'. - */ -#if 0 -#define MICROSOFTCOM_URL "http://www.microsoft.com/downloads/details.aspx?familyid=7a4d8d12-9f5d-42bb-b31c-7b31657c869c" -#else -#define MICROSOFTDOWNLOAD_URL "http://download.microsoft.com/download/e/c/6/ec6e00ab-ec05-4673-b8db-0658cf65f043/WindowsXP-KB835935-SP2-DEBUG-ENU.exe" -#endif - - -GList * /* of (GnomeVFSURI *) */ mod_uri_microsoftcom_list(void) -{ -#ifdef MICROSOFTCOM_URL -int base_size; -char *base_contents,*href_end; -#endif -char *href; -GnomeVFSURI *uri; - -#ifdef MICROSOFTCOM_URL - base_contents=NULL; - if (GNOME_VFS_OK!=gnome_vfs_read_entire_file(MICROSOFTCOM_URL,&base_size,&base_contents) - || base_size<=0) { - g_warning(_("Cannot load base URL: %s"),MICROSOFTCOM_URL); - goto fail_free_base_contents; - } - base_contents[base_size-1]=0; /* string terminator */ - if (!(href=strstr(base_contents,"http://download.microsoft.com/")) || !(href_end=strchr(href,'"'))) { - g_warning(_("Destination file URL not found in base URL: %s"),MICROSOFTCOM_URL); - goto fail_free_base_contents; - } - *href_end=0; -#else - href=MICROSOFTDOWNLOAD_URL; -#endif - if (!(uri=gnome_vfs_uri_new(href))) { - g_warning(_("Found destination file URL not parsable: %s"),href); - goto fail_free_base_contents; - } -#ifdef MICROSOFTCOM_URL - g_free(base_contents); -#endif - return g_list_append(NULL,uri); - -fail_free_base_contents: -#ifdef MICROSOFTCOM_URL - g_free(base_contents); -#endif - return NULL; -} diff --git a/src/install/acquire/microsoftcom.h b/src/install/acquire/microsoftcom.h deleted file mode 100644 index 1017f98..0000000 --- a/src/install/acquire/microsoftcom.h +++ /dev/null @@ -1,35 +0,0 @@ -/* $Id$ - * Include file for W32 modules finder from microsoft.com Internet download - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_MICROSOFTCOM_H -#define _CAPTIVE_INSTALL_ACQUIRE_MICROSOFTCOM_H 1 - - -#include -#include - - -G_BEGIN_DECLS - -GList * /* of (GnomeVFSURI *) */ mod_uri_microsoftcom_list(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_MICROSOFTCOM_H */ diff --git a/src/install/acquire/moduriload.c b/src/install/acquire/moduriload.c deleted file mode 100644 index 2e83141..0000000 --- a/src/install/acquire/moduriload.c +++ /dev/null @@ -1,395 +0,0 @@ -/* $Id$ - * W32 disk modules finder for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "moduriload.h" /* self */ -#include -#include -#include -#include -#include -#include "../libcaptive-install/proc_partitions.h" -#include "main.h" -#include -#include "captivemodid.h" -#include "cabinet.h" -#include -#include -#include -#include - -#include - - -/* Config: */ -#define MAX_FILE_LOAD_LENGTH 5000000 /* Otherwise use cabextract-over-http. */ - - -/* map: (const xmlChar *)type -> (struct module_available *) */ -GHashTable *module_available_hash; - -static void module_available_hash_value_destroy_func(struct module_available *module_available) -{ - g_return_if_fail(module_available!=NULL); - - g_free(module_available->file_base); - g_free(module_available->uri_text); - g_free(module_available); -} - -static void module_available_hash_init(void) -{ - if (module_available_hash) - return; - module_available_hash=g_hash_table_new_full(g_str_hash,g_str_equal, - (GDestroyNotify)NULL, - (GDestroyNotify)module_available_hash_value_destroy_func); -} - - -void (*acquire_module_available_notify)(struct module_available *module_available); -void (*acquire_module_all_modules_found_notify)(void); - -static void mod_uri_load_module_from_memory - (struct captivemodid_module *module,gconstpointer file_base,size_t file_length,GnomeVFSURI *uri) -{ -struct module_available *module_available; -gint best_priority; -gboolean all_modules_found; - - g_return_if_fail(module!=NULL); - g_return_if_fail(file_base!=NULL); - g_return_if_fail(uri!=NULL); - g_return_if_fail((size_t)module->length==file_length); - - module_available_hash_init(); - if ((module_available=g_hash_table_lookup(module_available_hash,module->type))) { - if (module_available->module->priority>=module->priority) - return; - } - - captive_new(module_available); - module_available->module=module; - module_available->file_base=g_memdup(file_base,file_length); - module_available->uri_text=gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_PASSWORD); - /* It may possibly destroy the old 'module_available': */ - g_hash_table_insert(module_available_hash,(/* de-const */ xmlChar *)module->type,module_available); - - if (!optarg_dry) { -const gchar *dest_pathname; -int dest_fd; - - dest_pathname=captive_printf_alloca("%s/%s",G_STRINGIFY(VARLIBCAPTIVEDIR),module->type); - if (-1==(dest_fd=open(dest_pathname,O_CREAT|O_TRUNC|O_WRONLY,0644))) - g_warning(_("Cannot open target file \"%s\": %m"),dest_pathname); - else { - if ((ssize_t)file_length!=write(dest_fd,file_base,file_length)) - g_warning(_("Error writing target file \"%s\": %m"),dest_pathname); - if (close(dest_fd)) - g_warning(_("Error closing target file \"%s\": %m"),dest_pathname); - } - } - - all_modules_found=FALSE; - - best_priority=captivemodid_module_type_best_priority_lookup(module->type); - if (best_priority==G_MININT /* no longer seeking for such module */ - || module_available->module->priority==best_priority) { - if (captivemodid_module_type_best_priority_found(module->type)) { - /* Postpone (*acquire_module_all_modules_found_notify)() - * after (*acquire_module_available_notify)(). - */ - all_modules_found=TRUE; - } - } - - if (acquire_module_available_notify) - (*acquire_module_available_notify)(module_available); - if (all_modules_found) - if (acquire_module_all_modules_found_notify) - (*acquire_module_all_modules_found_notify)(); -} - -void mod_uri_load_file_from_memory(gconstpointer file_base,size_t file_length,GnomeVFSURI *uri) -{ -gchar *file_md5; -struct captivemodid_module *module; - - g_return_if_fail(file_base!=NULL); - g_return_if_fail(uri!=NULL); - - if ((*ui_progress)(uri)) - return; - - file_md5=calc_md5(file_base,file_length); - if (!(module=captivemodid_module_md5_lookup(file_md5))) - goto fail_free_file_md5; - - if (strcmp("cabinet",(const char *)module->type)) - mod_uri_load_module_from_memory(module,file_base,file_length,uri); - else { - struct acquire_cabinet *acquire_cabinet; - /* acquire_cabinet_load() will call mod_uri_load_module_from_memory(): */ - acquire_cabinet=acquire_cabinet_new_from_memory(file_base,file_length,uri,module->cabinet_used); - acquire_cabinet_load(acquire_cabinet); - acquire_cabinet_free(acquire_cabinet); - } - -fail_free_file_md5: - g_free(file_md5); -} - -static void mod_uri_load_file_handle_to_memory(GnomeVFSHandle *handle,GnomeVFSFileInfo *file_info,GnomeVFSURI *uri) -{ -guint8 *file_buffer,file_tail_check; -GnomeVFSFileSize bytes_read; -GnomeVFSResult errvfsresult; - - g_return_if_fail(handle!=NULL); - g_return_if_fail(file_info!=NULL); - g_return_if_fail(uri!=NULL); - - /* gnome_vfs_read_entire_file() reads the file by chunks although - * it does not need to know the file size. - */ - file_buffer=g_malloc(file_info->size); - - errvfsresult=gnome_vfs_read(handle,file_buffer,file_info->size,&bytes_read); - if (errvfsresult!=GNOME_VFS_OK || bytes_read!=file_info->size) - goto fail_free_file_buffer; - /* 'bytes_read' must be !=NULL for GnomeVFS-2.0.x! */ - errvfsresult=gnome_vfs_read(handle,&file_tail_check,1,&bytes_read); - if (!(errvfsresult==GNOME_VFS_ERROR_EOF - /* At least RedHat gnome-vfs2-2.0.2-5 - * and ntfsprogs-200309071734-1captive1 and ntfsprogs-gnomevfs-1.0.1-0 - * do not report GNOME_VFS_ERROR_EOF. - * FIXME: Check if it is a bug in ntfsprogs-gnomevfs-1.0.1-0. - */ - || (errvfsresult==GNOME_VFS_OK && bytes_read==0))) - goto fail_free_file_buffer; - mod_uri_load_file_from_memory(file_buffer,file_info->size,uri); - -fail_free_file_buffer: - g_free(file_buffer); -} - -static void mod_uri_load_file_handle_remote_cabinet - (GnomeVFSHandle **handlep,GnomeVFSFileInfo *file_info,GnomeVFSURI *uri,gint cabinet_used) -{ -struct acquire_cabinet *acquire_cabinet; - - g_return_if_fail(handlep!=NULL); - g_return_if_fail(*handlep!=NULL); - g_return_if_fail(file_info!=NULL); - g_return_if_fail(uri!=NULL); - - acquire_cabinet=acquire_cabinet_new_from_handle(handlep,file_info,uri,cabinet_used); - /* acquire_cabinet_load() will call mod_uri_load_module_from_memory(): */ - acquire_cabinet_load(acquire_cabinet); - if (optarg_verbose) { -gchar *uri_text; - - uri_text=gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_PASSWORD); - g_message("cabinet_used: %s - %d",uri_text,acquire_cabinet->cabinet_done); - g_free(uri_text); - } - acquire_cabinet_free(acquire_cabinet); -} - -static void mod_uri_load_file(GnomeVFSURI *uri) -{ -GnomeVFSResult errvfsresult; -GnomeVFSFileInfo file_info_local; -GnomeVFSHandle *handle; - - g_return_if_fail(uri!=NULL); - - if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_open_uri(&handle,uri,GNOME_VFS_OPEN_READ|GNOME_VFS_OPEN_RANDOM))) - goto fail; - CAPTIVE_MEMZERO(&file_info_local); - if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_get_file_info_from_handle(handle,&file_info_local,GNOME_VFS_FILE_INFO_DEFAULT))) - goto fail_close_handle; - if (1 - && file_info_local.type!=GNOME_VFS_FILE_TYPE_REGULAR - /* FC4 gnome-vfs2-2.10.0-5 "http" returns GNOME_VFS_FILE_TYPE_UNKNOWN - * on the original info query so we need to try directory first. - */ - && file_info_local.type!=GNOME_VFS_FILE_TYPE_UNKNOWN) { - errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT; - goto fail_file_info_local_clear; - } - if (!(file_info_local.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE)) { - errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT; - goto fail_file_info_local_clear; - } - if (!captivemodid_module_length_is_valid(file_info_local.size)) { - errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT; - goto fail_file_info_local_clear; - } - if (file_info_local.size<=MAX_FILE_LOAD_LENGTH) - mod_uri_load_file_handle_to_memory(handle,&file_info_local,uri); - else { -gint cabinet_used=captivemodid_cabinet_length_to_used(file_info_local.size); - - mod_uri_load_file_handle_remote_cabinet(&handle,&file_info_local,uri,cabinet_used); - } - errvfsresult=GNOME_VFS_OK; - /* PASSTHRU */ -fail_file_info_local_clear: - gnome_vfs_file_info_clear(&file_info_local); -fail_close_handle: - gnome_vfs_close(handle); -fail:; -} - -static gboolean mod_uri_load_directory_visit_func - (const gchar *rel_path,GnomeVFSFileInfo *info,gboolean recursing_will_loop,GnomeVFSURI *root_uri /* data */, - gboolean *recurse) -{ - g_return_val_if_fail(rel_path!=NULL,FALSE); - g_return_val_if_fail(info!=NULL,FALSE); - g_return_val_if_fail(root_uri!=NULL,FALSE); - g_return_val_if_fail(recurse!=NULL,FALSE); - - *recurse=FALSE; - - /* Do not: (*ui_progress)(root_uri); - * here as we are called with the same 'root_uri' for all of our 'rel_path's. - */ - (*ui_progress)(NULL); - - switch (info->type) { - case GNOME_VFS_FILE_TYPE_REGULAR: { -GnomeVFSURI *file_uri; - - file_uri=gnome_vfs_uri_append_path(root_uri,rel_path); - if ((*ui_progress)(file_uri)) { - gnome_vfs_uri_unref(file_uri); - return FALSE; /* abort traversal */ - } - mod_uri_load_file(file_uri); - gnome_vfs_uri_unref(file_uri); - } break; - case GNOME_VFS_FILE_TYPE_DIRECTORY: { -GnomeVFSURI *directory_uri; -GnomeVFSDirectoryHandle *directory_handle; - - /* Never set '*recurse' if it would cause 'Access denied' error - * as it would completely abort the upper gnome_vfs_directory_visit_uri(). - * Check the directory accessibility manually: - */ - directory_uri=gnome_vfs_uri_append_path(root_uri,rel_path); - if ((*ui_progress)(directory_uri)) { - gnome_vfs_uri_unref(directory_uri); - return FALSE; /* abort traversal */ - } - if (GNOME_VFS_OK==gnome_vfs_directory_open_from_uri(&directory_handle,directory_uri,GNOME_VFS_FILE_INFO_DEFAULT)) { - *recurse=TRUE; - gnome_vfs_directory_close(directory_handle); /* errors ignored */ - } - gnome_vfs_uri_unref(directory_uri); - } break; - default:; - } - - return TRUE; /* continue traversal */ -} - -static void mod_uri_load_directory(GnomeVFSURI *uri) -{ -GnomeVFSResult errvfsresult; - - g_return_if_fail(uri!=NULL); - - errvfsresult=gnome_vfs_directory_visit_uri(uri, - GNOME_VFS_FILE_INFO_DEFAULT, /* info_options */ - GNOME_VFS_DIRECTORY_VISIT_SAMEFS, /* visit_options; 'GNOME_VFS_DIRECTORY_VISIT_LOOPCHECK'? */ - (GnomeVFSDirectoryVisitFunc)mod_uri_load_directory_visit_func, - uri); /* data */ - /* FC4 gnome-vfs2-2.10.0-5 "http" returns GNOME_VFS_FILE_TYPE_UNKNOWN - * on the original info query so we need to try directory first. - */ - if (errvfsresult==GNOME_VFS_ERROR_NOT_A_DIRECTORY) { - mod_uri_load_file(uri); - return; - } - if (errvfsresult!=GNOME_VFS_OK) { -gchar *uri_text; - - uri_text=gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_PASSWORD); - g_warning(_("Error scanning sub-tree of \"%s\": %s"),uri_text,gnome_vfs_result_to_string(errvfsresult)); - g_free(uri_text); - } -} - -static void mod_uri_load_internal(GnomeVFSURI *uri,gboolean base_reporting) -{ -GnomeVFSFileInfo file_info_local; -GnomeVFSResult errvfsresult; - - g_return_if_fail(uri!=NULL); - - if (optarg_verbose) { -gchar *uri_text; - - uri_text=gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_PASSWORD); - g_message(_("Scanning...: %s"),uri_text); - g_free(uri_text); - } - - CAPTIVE_MEMZERO(&file_info_local); - file_info_local.type=GNOME_VFS_FILE_TYPE_UNKNOWN; - if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_get_file_info_uri(uri,&file_info_local,GNOME_VFS_FILE_INFO_DEFAULT))) { - if (base_reporting) { -gchar *uri_text; - - uri_text=gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_PASSWORD); - g_warning(_("Error loading \"%s\": %s"),uri_text,gnome_vfs_result_to_string(errvfsresult)); - g_free(uri_text); - } - return; - } - switch (file_info_local.type) { - case GNOME_VFS_FILE_TYPE_REGULAR: mod_uri_load_file(uri); break; - case GNOME_VFS_FILE_TYPE_DIRECTORY: mod_uri_load_directory(uri); break; - /* FC4 gnome-vfs2-2.10.0-5 "http" returns GNOME_VFS_FILE_TYPE_UNKNOWN - * on the original info query so we need to try directory first. - */ - case GNOME_VFS_FILE_TYPE_UNKNOWN: mod_uri_load_directory(uri); break; - default: /* GNOME_VFS_ERROR_WRONG_FORMAT */; - } - gnome_vfs_file_info_clear(&file_info_local); -} - -void mod_uri_load(GnomeVFSURI *uri) -{ - g_return_if_fail(uri!=NULL); - - mod_uri_load_internal(uri, - FALSE); /* base_reporting */ -} - -void mod_uri_load_base_reporting(GnomeVFSURI *uri) -{ - g_return_if_fail(uri!=NULL); - - mod_uri_load_internal(uri, - TRUE); /* base_reporting */ -} diff --git a/src/install/acquire/moduriload.h b/src/install/acquire/moduriload.h deleted file mode 100644 index e696cee..0000000 --- a/src/install/acquire/moduriload.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * Include file for W32 disk modules finder for acquiration installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_MODURILOAD_H -#define _CAPTIVE_INSTALL_ACQUIRE_MODURILOAD_H 1 - - -#include -#include -#include -#include "captivemodid.h" - - -G_BEGIN_DECLS - -struct module_available { - struct captivemodid_module *module; - gpointer file_base; /* of 'module->length' */ - gchar *uri_text; - }; - -/* map: (const xmlChar *)type -> (struct module_available *) */ -extern GHashTable *module_available_hash; - -extern void (*acquire_module_available_notify)(struct module_available *module_available); -extern void (*acquire_module_all_modules_found_notify)(void); - -void mod_uri_load_file_from_memory(gconstpointer file_base,size_t file_length,GnomeVFSURI *uri); -void mod_uri_load(GnomeVFSURI *uri); -void mod_uri_load_base_reporting(GnomeVFSURI *uri); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_MODURILOAD_H */ diff --git a/src/install/acquire/ui-gnome.c b/src/install/acquire/ui-gnome.c deleted file mode 100644 index eb52c09..0000000 --- a/src/install/acquire/ui-gnome.c +++ /dev/null @@ -1,809 +0,0 @@ -/* $Id$ - * Drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "ui-gnome.h" /* self */ -#include -#include "moduriload.h" -#include "main.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "final.h" -#include - -#include - - -/* Config: */ -#define PROGRESS_UPDATE_USEC 200000 -/* Although proper GTK+ locking is provided below there are some - * bugs with compatibility of GTK+/Gnome-VFS/GConf. - * The main thread executes gtk_main()->g_main_loop_run() - * while the working thread initializes Gnome-VFS by GConf and - * executes also g_main_loop_run() while sharing some poll() fds. - */ -/* #define UI_GNOME_THREADS 1 */ - - -static GnomeApp *App; -static GtkTreeStore *DriversTreeStore; -static GtkFrame *DriversFrame; -static GtkFrame *ProgressFrame; -static GtkEntry *ProgressEntry; -static GnomeDruid *Druid; -static GtkButton *DruidButtonSkip; -static GtkButton *DruidButtonOK; -static GtkTreeView *DriversTreeView; -static GnomeDruidPage *PageStart; -static GnomeDruidPage *ScanDiskPage; -static GnomeDruidPage *ScanPathPage; -static GnomeDruidPage *MicrosoftComPage; -static GnomeDruidPage *PageFinish; -static GtkEntry *ScanPathLocationComboEntry; -static GtkButton *MicrosoftComConfirmButton; -static GtkProgressBar *MicrosoftComProgress; -enum { - DRIVERS_TREE_STORE_COLUMN_TYPE, - DRIVERS_TREE_STORE_COLUMN_ID, - DRIVERS_TREE_STORE_COLUMN_NUM, /* total # */ - }; -#define DRIVERS_TREE_STORE_COLUMN_TYPE_LIST G_TYPE_STRING,G_TYPE_STRING - - -/* map: (gchar *)type-> (GtkTreeIter *) */ -static GHashTable *DriversTreeStore_Iter_hash; - -static void DriversTreeStore_Iter_hash_key_destroy_func(gchar *type) -{ - g_return_if_fail(type!=NULL); - - g_free(type); -} - -static void DriversTreeStore_Iter_hash_init(void) -{ - if (DriversTreeStore_Iter_hash) - return; - DriversTreeStore_Iter_hash=g_hash_table_new_full(g_str_hash,g_str_equal, - (GDestroyNotify)DriversTreeStore_Iter_hash_key_destroy_func, - NULL); /* value_destroy_func */ -} - -static GtkTreeIter *DriversTreeStore_Iter_hash_get_iter(const gchar *type) -{ -GtkTreeIter *r; - - g_return_val_if_fail(type!=NULL,NULL); - - DriversTreeStore_Iter_hash_init(); - if (!(r=g_hash_table_lookup(DriversTreeStore_Iter_hash,type))) { - captive_new(r); - gtk_tree_store_append(DriversTreeStore, - r, /* iter */ - NULL); /* parent */ - g_hash_table_insert(DriversTreeStore_Iter_hash,g_strdup(type),r); - } - - return r; -} - -static gboolean some_modules_found=FALSE; -static gboolean in_progress=FALSE; -static GnomeDruidPage *page_active; - -static void state_changed(void) -{ - /* Not yet initialized? */ - if (!App) - return; - - gtk_widget_set_sensitive(GTK_WIDGET(DruidButtonSkip), - (page_active!=PageStart && page_active!=PageFinish)); - gtk_widget_set_sensitive(GTK_WIDGET(DruidButtonOK),some_modules_found); - - if (in_progress) { - gtk_widget_set_sensitive(Druid->next,FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(DruidButtonOK),some_modules_found); - gtk_widget_set_sensitive(GTK_WIDGET(MicrosoftComConfirmButton),FALSE); - } - else { - /* It is checked by GTK+ whether the text changed: */ - gtk_entry_set_text(ProgressEntry,""); - gtk_widget_set_sensitive(Druid->next, - (page_active!=PageFinish && page_active!=MicrosoftComPage)); - gtk_widget_set_sensitive(GTK_WIDGET(MicrosoftComConfirmButton), - (page_active==MicrosoftComPage)); - gtk_progress_bar_set_fraction(MicrosoftComProgress,(gdouble)0); - gtk_progress_bar_set_text(MicrosoftComProgress,""); - } -} - -static void ui_gnome_module_best_priority_notify(const gchar *module_type) -{ -GtkTreeIter *iter; - - g_return_if_fail(module_type!=NULL); - - gdk_threads_enter(); - - iter=DriversTreeStore_Iter_hash_get_iter(module_type); - gtk_tree_store_set(DriversTreeStore,iter, - DRIVERS_TREE_STORE_COLUMN_TYPE,module_type, - DRIVERS_TREE_STORE_COLUMN_ID , - ((0 - || !strcmp(module_type,"ntoskrnl.exe") - || !strcmp(module_type,"ntfs.sys")) - ? _("NOT FOUND; essential module for NTFS disks access") - : _("not found; optional module")), - -1); - - gdk_flush(); - gdk_threads_leave(); -} - -static void ui_gnome_module_available_notify(struct module_available *module_available) -{ -GtkTreeIter *iter; -static gboolean some_module_ntoskrnl_exe_found=FALSE; -static gboolean some_module_ntfs_sys_found=FALSE; - - g_return_if_fail(module_available!=NULL); - g_return_if_fail(module_available->module!=NULL); - - gdk_threads_enter(); - - iter=DriversTreeStore_Iter_hash_get_iter((const gchar *)module_available->module->type); - gtk_tree_store_set(DriversTreeStore,iter, - DRIVERS_TREE_STORE_COLUMN_TYPE,module_available->module->type, - DRIVERS_TREE_STORE_COLUMN_ID ,module_available->module->id, - -1); - - if (!strcmp((const char *)module_available->module->type,"ntoskrnl.exe")) - some_module_ntoskrnl_exe_found=TRUE; - if (!strcmp((const char *)module_available->module->type,"ntfs.sys")) - some_module_ntfs_sys_found=TRUE; - - some_modules_found=some_module_ntoskrnl_exe_found && some_module_ntfs_sys_found; - state_changed(); - - gdk_flush(); - gdk_threads_leave(); -} - -static gboolean all_modules_found=FALSE; - -static void ui_gnome_all_modules_found_notify(void) -{ - gdk_threads_enter(); - - all_modules_found=TRUE; - state_changed(); - - gdk_flush(); - gdk_threads_leave(); -} - -static gboolean aborted=FALSE; -static gboolean aborted_back=FALSE; /* 'Back' button was clicked. */ -static struct timeval ProgressEntry_updated_timeval; -static struct timeval ProgressBar_updated_timeval; - -static void progress_start(void) -{ - in_progress=TRUE; - aborted=FALSE; - aborted_back=FALSE; - CAPTIVE_MEMZERO(&ProgressEntry_updated_timeval); - CAPTIVE_MEMZERO(&ProgressBar_updated_timeval); - state_changed(); -} - -static void progress_end(void) -{ - in_progress=FALSE; - state_changed(); -} - -static gboolean want_progress_update(struct timeval *timeval) -{ -struct timeval now_timeval; -struct timeval diff_timeval; - - g_return_val_if_fail(timeval!=NULL,FALSE); - - gettimeofday( /* FIXME: errors ignored */ - &now_timeval, /* tv */ - NULL); /* tz */ - timersub(&now_timeval,timeval,&diff_timeval); - if (!timeval->tv_sec || diff_timeval.tv_sec>0 || diff_timeval.tv_usec>=PROGRESS_UPDATE_USEC) { - *timeval=now_timeval; - return TRUE; - } - return FALSE; -} - -static gboolean ui_gnome_progress(GnomeVFSURI *uri) -{ -gboolean want_gdk_flush=FALSE; - - /* 'uri' may be NULL */ - - gdk_threads_enter(); - - if (ProgressEntry) { -static gchar *uri_text=NULL; - - /* Store 'uri' on each call (not just if 'diff_timeval' permits) - * as we may get into long cabinet extraction phase with 'uri==NULL' calls - * where we want to display the currently processed 'uri'. - */ - if (uri) { - g_free(uri_text); - uri_text=gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_PASSWORD); - } - - if (uri_text) { - if (want_progress_update(&ProgressEntry_updated_timeval)) { - gtk_entry_set_text(ProgressEntry, - uri_text+(strncmp(uri_text,"file://",strlen("file://")) ? 0 : strlen("file://"))); - want_gdk_flush=TRUE; - } - } - } - -#ifndef UI_GNOME_THREADS - while (g_main_context_pending(NULL)) - g_main_context_iteration( - NULL, /* context */ - FALSE); /* may_block */ -#endif /* UI_GNOME_THREADS */ - - if (want_gdk_flush) - gdk_flush(); - gdk_threads_leave(); - - /* Do not: g_thread_yield(); - * as it is TOO much expensive and we are multithreaded anyway. - */ - - if (aborted) - return TRUE; - if (all_modules_found) - return TRUE; - - return FALSE; -} - -static void ui_gnome_progress_bar(gint done,gint length) -{ - g_return_if_fail(done>=0); - g_return_if_fail(length>=0); - - if (!want_progress_update(&ProgressBar_updated_timeval)) - return; - - gdk_threads_enter(); - - if (!length) { - gtk_progress_bar_pulse(MicrosoftComProgress); - gtk_progress_bar_set_text(MicrosoftComProgress,""); - } - else { -gchar *length_display; - - /* Do not format 'done' by gnome_vfs_format_file_size_for_display() - * as the progress would not be visible for large 'done' sizes. - */ - gtk_progress_bar_set_fraction(MicrosoftComProgress,((gdouble)done)/length); - length_display=gnome_vfs_format_file_size_for_display(length); - gtk_progress_bar_set_text(MicrosoftComProgress, - captive_printf_alloca("%d B / %s",(int)done,length_display)); - g_free(length_display); - } - - gdk_flush(); - gdk_threads_leave(); -} - -/* FIXME: Change it to "prepare" signal. */ -void on_Page_map(GtkWidget *vbox_widget,GtkWidget *page_widget) -{ - /* Handle non-object (NULL) signal with reversed parameters? */ - if (GNOME_IS_DRUID_PAGE(vbox_widget) && page_widget==NULL) { - page_widget=vbox_widget; - vbox_widget=NULL; - } - g_return_if_fail(vbox_widget==NULL || GTK_IS_VBOX(vbox_widget)); - g_return_if_fail(GNOME_IS_DRUID_PAGE(page_widget)); - - page_active=GNOME_DRUID_PAGE(page_widget); - if (page_active==PageFinish) { - gnome_druid_set_show_finish(Druid,FALSE); /* set it each time */ - /**/ if (!some_modules_found) - gnome_druid_page_edge_set_text(GNOME_DRUID_PAGE_EDGE(PageFinish),_( - "We need at least some version of drivers essential for this project:" - " ntoskrnl.exe and ntfs.sys. Please click 'Back' button to obtain them" - " by several methods offered by this installer.")); - else { -gchar *text; - - text=final_text(all_modules_found); - gnome_druid_page_edge_set_text(GNOME_DRUID_PAGE_EDGE(PageFinish),text); - g_free(text); - } - } - if (page_active==ScanPathPage) - gtk_widget_grab_focus(GTK_WIDGET(ScanPathLocationComboEntry)); - state_changed(); - - if (!vbox_widget) - return; - - /* FIXME: 'freeze' apparently does not help 'repositioning' of - * 'DriversTreeView' during first 'map' of each 'Page'. - */ - gtk_widget_freeze_child_notify(vbox_widget); - - gtk_widget_reparent(GTK_WIDGET(DriversFrame),vbox_widget); - gtk_widget_reparent(GTK_WIDGET(ProgressFrame),vbox_widget); - - gtk_box_reorder_child(GTK_BOX(vbox_widget),GTK_WIDGET(DriversFrame), - 0); /* position */ - - gtk_box_set_child_packing(GTK_BOX(vbox_widget),GTK_WIDGET(DriversFrame), - FALSE, /* expand */ - TRUE, /* fill */ - 0, /* padding */ - GTK_PACK_START); - gtk_box_set_child_packing(GTK_BOX(vbox_widget),GTK_WIDGET(ProgressFrame), - FALSE, /* expand */ - TRUE, /* fill */ - 0, /* padding */ - GTK_PACK_START); - - /* FIXME: Needed to fix (0,0)-position inside parent GdkWindow. */ - gtk_widget_queue_resize(GTK_WIDGET(DriversTreeView)); - gtk_widget_queue_resize(GTK_WIDGET(ProgressEntry)); - - gtk_widget_thaw_child_notify(vbox_widget); -} - -typedef void (*process_t)(void); - -#ifdef UI_GNOME_THREADS -/* 'GThreadFunc' type. */ -gpointer execute_process_func(process_t process /* data */) -{ - (*process)(); - - gdk_threads_enter(); - - gtk_main_quit(); /* Abort gtk_main() of execute_process(). */ - - gdk_flush(); - gdk_threads_leave(); - - return NULL; -} -#endif /* UI_GNOME_THREADS */ - -/* We are called inside gdk_threads_enter(). */ -static void execute_process(process_t process) -{ -#ifdef UI_GNOME_THREADS -GThread *gthread; -#endif /* UI_GNOME_THREADS */ - - progress_start(); -#ifdef UI_GNOME_THREADS - gthread=g_thread_create_full( - (GThreadFunc)execute_process_func, /* func */ - process, /* data */ - 0, /* stack_size; 0 means the default size */ - TRUE, /* joinable */ - TRUE, /* bound; use system thread */ - G_THREAD_PRIORITY_LOW, /* priority; G_THREAD_PRIORITY_LOW is the lowest one */ - NULL); /* error */ - gtk_main(); /* We are already called inside gdk_threads_enter(). */ - /* I hope some other gtk_main_quit() did not occur as we would - * locked if the 'process' func did not finish yet. - */ - g_thread_join(gthread); -#else /* UI_GNOME_THREADS */ - (*process)(); -#endif /* UI_GNOME_THREADS */ - progress_end(); -} - -/* 'process_t' typed. */ -static void process_scan_disk(void) -{ - scan_disks_quick(); - scan_disks(); -} - -static GnomeVFSURI *process_scan_path_scan_path_uri; - -/* 'process_t' typed. */ -static void process_scan_path(void) -{ - mod_uri_load_base_reporting(process_scan_path_scan_path_uri); -} - -/* 'process_t' typed. */ -static void process_microsoft_com(void) -{ - microsoft_com(); -} - -gboolean on_Page_next(GnomeDruidPage *gnomedruidpage,GtkWidget *widget,gpointer user_data /* unused */) -{ - g_return_val_if_fail(GNOME_IS_DRUID_PAGE(gnomedruidpage),FALSE); - - if (in_progress) /* bogus callback - we should be non-sensitive */ - return TRUE; /* ignore button press */ - - /**/ if (page_active==PageStart) { - if (all_modules_found) { - gnome_druid_set_page(Druid,PageFinish); - return TRUE; /* ignore button press */ - } - } - else if (page_active==ScanDiskPage) { - execute_process(process_scan_disk); - if (aborted_back) { - gnome_druid_set_page(Druid,PageStart); - return TRUE; /* ignore button press */ - } - if (all_modules_found) { - gnome_druid_set_page(Druid,PageFinish); - return TRUE; /* ignore button press */ - } - return FALSE; /* proceed to next page */ - } - else if (page_active==ScanPathPage) { -const gchar *scan_path_uri_text=gtk_entry_get_text(ScanPathLocationComboEntry); - - if (scan_path_uri_text && *scan_path_uri_text) { -GnomeVFSURI *scan_path_uri; - - if ((scan_path_uri=gnome_vfs_uri_new(scan_path_uri_text))) { - process_scan_path_scan_path_uri=scan_path_uri; - execute_process(process_scan_path); - gnome_vfs_uri_unref(scan_path_uri); - if (aborted_back) { - gnome_druid_set_page(Druid,(all_modules_found ? PageStart : ScanDiskPage)); - return TRUE; /* ignore button press */ - } - if (all_modules_found) { - gnome_druid_set_page(Druid,PageFinish); - return TRUE; /* ignore button press */ - } - gtk_entry_set_text(ScanPathLocationComboEntry,""); - } - else - g_warning(_("Invalid URI: %s"),scan_path_uri_text); - gtk_widget_grab_focus(GTK_WIDGET(ScanPathLocationComboEntry)); - return TRUE; /* ignore button press; we cleared the URI entry */ - } - return FALSE; /* proceed to next page */ - } - - return FALSE; /* proceed to next page */ -} - -void on_MicrosoftComConfirmButton_clicked(GtkButton *button,gpointer user_data) -{ - g_return_if_fail(GTK_IS_BUTTON(button)); - - if (in_progress) /* bogus callback */ - return; - if (page_active!=MicrosoftComPage) /* bogus callback */ - return; - - execute_process(process_microsoft_com); - if (aborted_back) { - gnome_druid_set_page(Druid,(all_modules_found ? PageStart : ScanPathPage)); - return; - } - if (all_modules_found) { - gnome_druid_set_page(Druid,PageFinish); - return; - } - - gnome_druid_set_page(Druid,PageFinish); -} - -void on_DruidButtonSkip_clicked(GtkButton *button,gpointer user_data /* unused */) -{ - g_return_if_fail(GTK_IS_BUTTON(button)); - - if (in_progress) { - aborted=TRUE; - state_changed(); - return; - } - if (all_modules_found) - gnome_druid_set_page(Druid,PageFinish); - else if (page_active==ScanDiskPage) - gnome_druid_set_page(Druid,ScanPathPage); - else if (page_active==ScanPathPage) - gnome_druid_set_page(Druid,MicrosoftComPage); - else if (page_active==MicrosoftComPage) - gnome_druid_set_page(Druid,PageFinish); -} - -gboolean on_Page_back(GnomeDruidPage *gnomedruidpage,GtkWidget *widget,gpointer user_data) -{ - g_return_val_if_fail(GNOME_IS_DRUID_PAGE(gnomedruidpage),FALSE); - - if (!in_progress) { - if (all_modules_found) { - gnome_druid_set_page(Druid,PageStart); - return TRUE; /* ignore button press */ - } - return FALSE; /* proceed to previous page */ - } - - aborted=TRUE; - aborted_back=TRUE; - state_changed(); - - return TRUE; /* ignore button press now; we will respect 'aborted_back' */ -} - -void on_Druid_cancel(GnomeDruid *gnomedruid,gpointer user_data /* unused */) -{ - g_return_if_fail(GNOME_IS_DRUID(gnomedruid)); - - /* gtk_main_quit() would not abort the current operation. */ - exit(EXIT_SUCCESS); -} - -static void on_DruidButtonOK_clicked_dialog_callback(gint reply,gint *replyp /* data */) -{ - g_return_if_fail(reply>=0); - g_return_if_fail(replyp!=NULL); - - *replyp=reply; -} - -void on_DruidButtonOK_clicked(GtkButton *button,gpointer user_data /* unused */) -{ -GtkWidget *dialog; -gint reply; - - g_return_if_fail(GTK_IS_BUTTON(button)); - - if (all_modules_found) - exit(EXIT_SUCCESS); - - /* TODO: Avoid dialog if already on Finish page. */ - reply=-1; - dialog=gnome_app_ok_cancel_modal(App,_( - "Although essential modules (\"ntoskrnl.exe\" and \"ntfs.sys\") are available " - "you may still want to get their better version and/or more modules. " - "Really quit?"), - (GnomeReplyCallback)on_DruidButtonOK_clicked_dialog_callback, - &reply); /* data */ - g_signal_connect((gpointer)dialog,"close",G_CALLBACK(gtk_main_quit),NULL); - /* Never call gtk_main() from other thread than the initial one. - * We would have to switch GTK+ context (g_main_context()?). - */ - gtk_main(); - /* 'dialog' gets destroyed automatically */ - if (reply==0) /* 0 for 'OK', 1 for 'Cancel', left -1 for dialog close. */ - exit(EXIT_SUCCESS); -} - -static void button_stock_set_label(GtkWidget *widget,const gchar *label_text_new /* callback_data */) -{ - g_return_if_fail(GTK_IS_WIDGET(widget)); - g_return_if_fail(label_text_new!=NULL); - - /**/ if (GTK_IS_CONTAINER(widget)) - gtk_container_foreach(GTK_CONTAINER(widget), - (GtkCallback)button_stock_set_label, /* callback */ - (/* de-conts */ gchar *)label_text_new); /* callback_data */ - else if (GTK_IS_LABEL(widget)) - gtk_label_set_text_with_mnemonic(GTK_LABEL(widget),label_text_new); -} - -static void PageFinish_set_label_attr(GtkWidget *widget,gpointer callback_data /* unused */) -{ - g_return_if_fail(GTK_IS_WIDGET(widget)); - - /**/ if (GTK_IS_CONTAINER(widget)) - gtk_container_foreach(GTK_CONTAINER(widget), - (GtkCallback)PageFinish_set_label_attr, /* callback */ - callback_data); /* callback_data; unused */ - else if (GTK_IS_LABEL(widget) && gtk_label_get_line_wrap(GTK_LABEL(widget))) - gtk_label_set_selectable(GTK_LABEL(widget),TRUE); -} - -/* of "ui-gnome-interface.h": */ -GtkWidget *create_App(void); -/* of "ui-gnome-support.h": */ -GtkWidget *lookup_widget(GtkWidget *widget,const gchar *widget_name); - -static void App_init(void) -{ -GtkTreeViewColumn *column; -GtkCellRenderer *cell; -GtkBox *druid_button_box; - - gdk_threads_enter(); - - App=GNOME_APP(create_App()); - - DriversTreeView=GTK_TREE_VIEW(lookup_widget(GTK_WIDGET(App),"DriversTreeView")); - DriversFrame=GTK_FRAME(lookup_widget(GTK_WIDGET(App),"DriversFrame")); - ProgressFrame=GTK_FRAME(lookup_widget(GTK_WIDGET(App),"ProgressFrame")); - Druid=GNOME_DRUID(lookup_widget(GTK_WIDGET(App),"Druid")); - PageStart=GNOME_DRUID_PAGE(lookup_widget(GTK_WIDGET(App),"PageStart")); - ScanDiskPage=GNOME_DRUID_PAGE(lookup_widget(GTK_WIDGET(App),"ScanDiskPage")); - ScanPathPage=GNOME_DRUID_PAGE(lookup_widget(GTK_WIDGET(App),"ScanPathPage")); - MicrosoftComPage=GNOME_DRUID_PAGE(lookup_widget(GTK_WIDGET(App),"MicrosoftComPage")); - PageFinish=GNOME_DRUID_PAGE(lookup_widget(GTK_WIDGET(App),"PageFinish")); - ScanPathLocationComboEntry=GTK_ENTRY(lookup_widget(GTK_WIDGET(App),"ScanPathLocationComboEntry")); - MicrosoftComConfirmButton=GTK_BUTTON(lookup_widget(GTK_WIDGET(App),"MicrosoftComConfirmButton")); - MicrosoftComProgress=GTK_PROGRESS_BAR(lookup_widget(GTK_WIDGET(App),"MicrosoftComProgress")); - ProgressEntry=GTK_ENTRY(lookup_widget(GTK_WIDGET(App),"ProgressEntry")); - - druid_button_box=GTK_BOX(gtk_widget_get_parent(Druid->next)); - - DriversTreeStore=gtk_tree_store_new(DRIVERS_TREE_STORE_COLUMN_NUM,DRIVERS_TREE_STORE_COLUMN_TYPE_LIST); - gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(DriversTreeStore), - DRIVERS_TREE_STORE_COLUMN_TYPE,GTK_SORT_ASCENDING); - gtk_tree_view_set_model(DriversTreeView,GTK_TREE_MODEL(DriversTreeStore)); - - column=gtk_tree_view_column_new(); - cell=gtk_cell_renderer_text_new(); - gtk_tree_view_column_pack_start(column,cell, - TRUE); /* expand */ - gtk_tree_view_column_set_attributes(column,cell, - "text",DRIVERS_TREE_STORE_COLUMN_TYPE, - NULL); - gtk_tree_view_append_column(DriversTreeView,column); - - column=gtk_tree_view_column_new(); - cell=gtk_cell_renderer_text_new(); - gtk_tree_view_column_pack_start(column,cell, - TRUE); /* expand */ - gtk_tree_view_column_set_attributes(column,cell, - "text",DRIVERS_TREE_STORE_COLUMN_ID, - NULL); - gtk_tree_view_append_column(DriversTreeView,column); - - /* gnome_druid_set_show_finish() just replaces Next<->Finish buttons displayed. */ - gtk_widget_hide(GTK_WIDGET(Druid->finish)); - - DruidButtonSkip=GTK_BUTTON(gtk_button_new_from_stock(GTK_STOCK_REDO)); - button_stock_set_label( - GTK_WIDGET(DruidButtonSkip), /* widget */ - _("_Skip")); /* label_text_new */ - gtk_box_pack_end(druid_button_box,GTK_WIDGET(DruidButtonSkip),FALSE,TRUE,0); - gtk_widget_show(GTK_WIDGET(DruidButtonSkip)); - g_signal_connect((gpointer)DruidButtonSkip,"clicked",G_CALLBACK(on_DruidButtonSkip_clicked),NULL); - - DruidButtonOK=GTK_BUTTON(gtk_button_new_from_stock(GTK_STOCK_OK)); - gtk_box_pack_end(druid_button_box,GTK_WIDGET(DruidButtonOK),FALSE,TRUE,0); - gtk_widget_show(GTK_WIDGET(DruidButtonOK)); - g_signal_connect((gpointer)DruidButtonOK,"clicked",G_CALLBACK(on_DruidButtonOK_clicked),NULL); - - PageFinish_set_label_attr( - GTK_WIDGET(PageFinish), /* widget */ - NULL); /* callback_data; unused */ - - state_changed(); - - gdk_threads_leave(); -} - -static void ui_gnome_g_log_handler(const gchar *log_domain,GLogLevelFlags log_level,const gchar *message,gpointer user_data) -{ -GtkWidget *dialog; - - /* Ignore arrors by cabextract during its abortion. */ - if (in_progress && aborted) - return; - - gdk_threads_enter(); - - /**/ if (log_level & G_LOG_LEVEL_ERROR) - dialog=gnome_app_error(App,message); - else if (log_level & (G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_WARNING)) - dialog=gnome_app_warning(App,message); - else - dialog=gnome_app_message(App,message); - - gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); - g_signal_connect((gpointer)dialog,"close",G_CALLBACK(gtk_main_quit),NULL); - gtk_main(); - /* 'dialog' gets destroyed automatically */ - - gdk_flush(); - gdk_threads_leave(); -} - -static void ui_gnome_interactive(void) -{ - gdk_threads_enter(); - - /* Postpone gtk_widget_show_all() from App_init() here - * to have already passed all ui_gnome_module_available_notify(). - */ - gnome_druid_set_page(Druid,MicrosoftComPage); - gtk_widget_show_all(GTK_WIDGET(App)); -#if 0 - /* gnome_druid_set_page(Druid,PageStart); */ - gnome_druid_set_page(Druid,ScanDiskPage); - gnome_druid_set_page(Druid,ScanPathPage); - /* gnome_druid_set_page(Druid,MicrosoftComPage); */ - gnome_druid_set_page(Druid,PageFinish); -#endif - gnome_druid_set_page(Druid,PageStart); - - gtk_main(); - - gdk_threads_leave(); - - exit(EXIT_SUCCESS); -} - -gboolean ui_gnome_init(void) -{ - acquire_module_available_notify=ui_gnome_module_available_notify; - acquire_module_all_modules_found_notify=ui_gnome_all_modules_found_notify; - ui_progress=ui_gnome_progress; - ui_progress_bar=ui_gnome_progress_bar; - ui_interactive=ui_gnome_interactive; - captivemodid_module_best_priority_notify=ui_gnome_module_best_priority_notify; - -#ifdef UI_GNOME_THREADS - /* gdk_threads_init() must be called before gtk_init()! - * gtk_init() gets called by create_App() here. - */ - if (!g_thread_supported()) - g_thread_init(NULL); - if (!gdk_threads_mutex) - gdk_threads_init(); -#endif /* UI_GNOME_THREADS */ - - /* Graphic widgets will all be hidden yet. */ - App_init(); - /* ui_gnome_g_log_handler() needs 'App'. */ - g_log_set_handler( - G_LOG_DOMAIN, /* log_domain; "Captive" */ - G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL, /* log_levels */ - ui_gnome_g_log_handler, /* log_func */ - NULL); /* user_data */ - - return TRUE; -} diff --git a/src/install/acquire/ui-gnome.glade b/src/install/acquire/ui-gnome.glade deleted file mode 100644 index d8f55c2..0000000 --- a/src/install/acquire/ui-gnome.glade +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - - True - Captive Microsoft Windows Drivers Acquire - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - False - - - - - True - False - - - - 4 - True - False - - - - - True - GNOME_EDGE_START - Captive Microsoft Windows Drivers Acquire - Program allows safe read/write mount of NTFS disk drives. -It uses original Microsoft Windows driver files to access the disks. As these files are licensed by Microsoft we will acquire them now for your installation. - - - - - - - - True - Local Disks Drivers Scan - - - - - - - 16 - True - False - 6 - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - True - False - False - False - False - - - - - - True - Currently found drivers - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - False - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - GTK_SHADOW_NONE - - - - True - We will scan your local hard drives to find any existing drivers usable for this project. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - - - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - True - False - True - 0 - - False - * - False - - - - - - True - Scanned File... - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - False - True - - - - - - - - - - True - Custom Drivers Location - - - - - - - 16 - True - False - 6 - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - GTK_SHADOW_NONE - - - - True - Here you can specify custom path to the drivers. Besides regular disk path you can also specify www URL such as: http://machine/path/name -Detection of language localized MS-Windows drivers is missing. You may need to copy localized ntfs.sys and ntoskrnl.exe to /var/lib/captive/ by cp(1) command; contact me for their proper identification, please. -If you have no idea simply go Forward. - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - - - - - - - 0 - True - True - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - 10 - False - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - - - True - Specify location - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - - - label_item - - - - - 0 - False - False - - - - - - - - - - True - Download from microsoft.com - - - - - - - 16 - True - False - 6 - - - - True - 0 - 0.5 - GTK_SHADOW_IN - - - - True - GTK_SHADOW_NONE - - - - True - True - You can download the best available version of needed drivers from Microsoft. They can be found in Microsoft Windows XP Service Pack 2 Checked Build. -URL: http://msdn.microsoft.com/security/productinfo/xpsp2 -Legal: In some countries you need to have valid Microsoft Windows XP license to use it. -It is needed to download approx 61MB of data right now out of the 307MB file size. You can also download the file separately and load it in the previous screen if some problems occur. - False - False - GTK_JUSTIFY_LEFT - True - True - 0.5 - 0.5 - 0 - 0 - - - - - - - 0 - True - True - - - - - - True - False - 0 - - - - True - Are you legally entitled to download Microsoft Windows XP Service Pack? - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - - - 0 - True - True - - - - - - True - True - Yes, start the download. - True - GTK_RELIEF_NORMAL - - - - 0 - False - False - - - - - 0 - False - True - - - - - - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.1 - - - - 0 - False - True - - - - - - - - - - True - GNOME_EDGE_FINISH - Microsoft Windows Drivers Captivated - - - - - - - - - - 0 - True - True - - - - - diff --git a/src/install/acquire/ui-gnome.gladep b/src/install/acquire/ui-gnome.gladep deleted file mode 100644 index b374c46..0000000 --- a/src/install/acquire/ui-gnome.gladep +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ui-gnome - captive-install-acquire - . - TRUE - FALSE - FALSE - FALSE - ui-gnome-interface.c - ui-gnome-interface.h - ui-gnome-callbacks.c - ui-gnome-callbacks.h - ui-gnome-support.c - ui-gnome-support.h - diff --git a/src/install/acquire/ui-gnome.h b/src/install/acquire/ui-gnome.h deleted file mode 100644 index 84d67af..0000000 --- a/src/install/acquire/ui-gnome.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $Id$ - * Include file for drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_UI_GNOME_H -#define _CAPTIVE_INSTALL_ACQUIRE_UI_GNOME_H 1 - - -#include - - -G_BEGIN_DECLS - -gboolean ui_gnome_init(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_UI_GNOME_H */ diff --git a/src/install/acquire/ui-line.c b/src/install/acquire/ui-line.c deleted file mode 100644 index fdd3f9a..0000000 --- a/src/install/acquire/ui-line.c +++ /dev/null @@ -1,301 +0,0 @@ -/* $Id$ - * Drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "ui-line.h" /* self */ -#include -#include "moduriload.h" -#include "main.h" -#include -#include -#include "final.h" - -#ifdef HAVE_LIBREADLINE -#include -#ifdef HAVE_READLINE_HISTORY_H -#include -#endif /* HAVE_READLINE_HISTORY_H */ -#endif /* HAVE_LIBREADLINE */ - -#include - -static void print_ui_line_module_available(struct module_available *module_available) -{ -gint priority_best; - - g_return_if_fail(module_available!=NULL); - g_return_if_fail(module_available->module!=NULL); - - if (G_MININT==(priority_best=captivemodid_module_type_best_priority_lookup(module_available->module->type))) - printf(_("Found best available \"%s\": %s\n"),module_available->module->type,module_available->module->id); - else - printf(_("Found although not best \"%s\" (pri=%d; best=%d): %s\n"), - module_available->module->type,module_available->module->priority,priority_best, - module_available->module->id); -} - -static void ui_line_module_available_notify(struct module_available *module_available) -{ - g_return_if_fail(module_available!=NULL); - - print_ui_line_module_available(module_available); - printf(_("at URI: %s\n"),module_available->uri_text); -} - -static gboolean all_modules_found=FALSE; - -static void ui_line_all_modules_found_notify(void) -{ - puts(_("All modules found in their best known versions.")); - all_modules_found=TRUE; -} - -static gboolean aborted=FALSE; -static time_t search_start_time; -static gboolean abort_msg_printed=FALSE; - -static gboolean ui_line_progress(GnomeVFSURI *uri) -{ -fd_set readfds; -struct timeval timeval; -static int stdin_isatty=-1; - - /* 'uri' may be NULL */ - - if (aborted) - return TRUE; - if (all_modules_found) - return TRUE; - - if (!search_start_time) - search_start_time=time(NULL); - if (!abort_msg_printed && time(NULL)>=search_start_time+2) { - puts(_("Searching... Hit ENTER to abort.")); - abort_msg_printed=TRUE; - } - - if (stdin_isatty==-1) - stdin_isatty=isatty(0); - if (stdin_isatty>0) { - FD_ZERO(&readfds); - FD_SET(0,&readfds); - timeval.tv_sec=0; - timeval.tv_usec=0; - if (1==select(1,&readfds,NULL,NULL,&timeval)) { - aborted=TRUE; - getchar(); - puts(_("*** OPERATION ABORTED ***")); - return TRUE; - } - } - - return FALSE; -} - -static void ui_line_progress_reset(void) -{ - aborted=FALSE; - search_start_time=0; - abort_msg_printed=FALSE; -} - -static char *line_read(const gchar *prompt) -{ -#ifdef HAVE_LIBREADLINE -char *line; -#else /* HAVE_LIBREADLINE */ -char line[1024],*s; -#endif /* HAVE_LIBREADLINE */ - - g_return_val_if_fail(prompt!=NULL,NULL); - - ui_line_progress_reset(); - -#ifdef HAVE_LIBREADLINE - line=readline(prompt); -#ifdef HAVE_ADD_HISTORY - if (line && *line) - add_history(line); -#endif /* HAVE_ADD_HISTORY */ -#else /* HAVE_LIBREADLINE */ - fputs(prompt,stdout); fflush(stdout); - line=fgets(line,sizeof(line),stdin); -#endif /* HAVE_LIBREADLINE */ - if (!line) - return NULL; -#ifndef HAVE_LIBREADLINE - if (line && (s=strchr(line,'\n'))) - *s='\0'; -#endif /* HAVE_LIBREADLINE */ - - return line; -} - -/* FIXME: HACK: Encode module essentiality to '.captivemodid.xml'. */ -struct print_modules_available_foreach_param { - gboolean do_print; - gboolean ntoskrnl_exe_found; - gboolean ntfs_sys_found; - }; - -static void print_modules_available_foreach - (const xmlChar *type /* key */,struct module_available *module_available /* value */, - struct print_modules_available_foreach_param *param /* user_data */) -{ - g_return_if_fail(type!=NULL); - g_return_if_fail(module_available!=NULL); - g_return_if_fail(module_available->module!=NULL); - g_return_if_fail(!strcmp((const char *)type,(const char *)module_available->module->type)); - g_return_if_fail(param!=NULL); - - if (param->do_print) - print_ui_line_module_available(module_available); - - /**/ if (!strcmp((const char *)type,"ntoskrnl.exe")) - param->ntoskrnl_exe_found=TRUE; - else if (!strcmp((const char *)type,"ntfs.sys")) - param->ntfs_sys_found=TRUE; -} - -/* Returns: TRUE if essential modules were found at any priority. */ -static gboolean print_modules_available(void) -{ -struct print_modules_available_foreach_param param; -gboolean r; -static gboolean first_time=TRUE; - - putchar('\n'); - param.do_print=!first_time; - param.ntoskrnl_exe_found=FALSE; - param.ntfs_sys_found=FALSE; - if (module_available_hash) - g_hash_table_foreach(module_available_hash,(GHFunc)print_modules_available_foreach,¶m); - r=param.ntoskrnl_exe_found && param.ntfs_sys_found; - - if (!param.ntoskrnl_exe_found) - printf(_("Still needed essential module: %s\n"),"ntoskrnl.exe"); - if (!param.ntfs_sys_found) - printf(_("Still needed essential module: %s\n"),"ntfs.sys"); - if (r) - puts(_( - "Essential modules (\"ntoskrnl.exe\" and \"ntfs.sys\") are available.\n" - "You may still want to get their better version and/or more modules.")); - putchar('\n'); - - first_time=FALSE; - - return r; -} - -static gboolean ui_line_interactive_ask(const gchar *prompt) -{ -char *line; -gboolean essentials_available; - - if (all_modules_found) - return FALSE; - - essentials_available=print_modules_available(); - puts(prompt); - for (;;) { - line=line_read(captive_printf_alloca(_("Enter 'y' for YES, 'n' to NO%s [hit ENTER for YES]: "), - (!essentials_available ? "" : _(", 'd' if DONE")))); - if (!line) - return FALSE; - if (!strncasecmp(line,_("yes"),strlen(line))) { - free(line); - return TRUE; - } - if (!strncasecmp(line,_("no"),strlen(line))) { - free(line); - return FALSE; - } - if (!strncasecmp(line,_("done"),strlen(line))) { - putchar('\n'); - puts(final_text(all_modules_found)); - exit(EXIT_SUCCESS); - } - free(line); - } - /* NOTREACHED */ -} - -static void ui_line_interactive(void) -{ -#ifndef HAVE_LIBREADLINE - puts(_("Line editing not available, please recompile with readline library installed")); -#endif /* HAVE_LIBREADLINE */ - - if (ui_line_interactive_ask(_("Quickly scan your local disks to find needed drivers?"))) - scan_disks_quick(); - while (!all_modules_found) { -char *line; - - if (ui_line_interactive_ask(_( - "Detection of language localized MS-Windows drivers is missing." - " You may need to copy localized ntfs.sys and ntoskrnl.exe to /var/lib/captive/ by cp(1) command;" - " contact me for their proper identification, please.\n" - "Fully scan all directories of your local disks?"))) - scan_disks(); - - if (!all_modules_found) - do { - print_modules_available(); - puts(_("Do you want to enter your custom search path and/or files? You can also enter web URL.")); - line=line_read(_("Enter pathname or URL [hit ENTER to skip it]: ")); - if (line && *line) { -GnomeVFSURI *uri; - - if (!(uri=gnome_vfs_uri_new(line))) - printf(_("Error paring URI: %s"),line); - else { - mod_uri_load_base_reporting(uri); - gnome_vfs_uri_unref(uri); - } - free(line); - } - else { - free(line); - line=NULL; - } - } while (!all_modules_found && line); - - if (ui_line_interactive_ask(_( - "You can download the best available version of needed drivers from Microsoft. They can be found in Microsoft Windows XP Service Pack 2 Checked Build.\n" - "URL: http://msdn.microsoft.com/security/productinfo/xpsp2\n" - "Legal: In some countries you need to have valid Microsoft Windows XP license to use it.\n" - "It is needed to download approx 61MB of data right now out of the 307MB file size. You can also download the file separately and load it in the previous screen if some problems occur.\n"))) - microsoft_com(); - if (!all_modules_found) - puts(_("\nWe tried all available drivers acquiration methods - the options will start again.")); - } - putchar('\n'); - puts(final_text(all_modules_found)); -} - -gboolean ui_line_init(void) -{ - acquire_module_available_notify=ui_line_module_available_notify; - acquire_module_all_modules_found_notify=ui_line_all_modules_found_notify; - ui_progress=ui_line_progress; - ui_interactive=ui_line_interactive; - /* 'captivemodid_module_best_priority_notify' left NULL. */ - return TRUE; -} diff --git a/src/install/acquire/ui-line.h b/src/install/acquire/ui-line.h deleted file mode 100644 index 32db441..0000000 --- a/src/install/acquire/ui-line.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $Id$ - * Include file for drivers acquiring installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_INSTALL_ACQUIRE_UI_LINE_H -#define _CAPTIVE_INSTALL_ACQUIRE_UI_LINE_H 1 - - -#include - - -G_BEGIN_DECLS - -gboolean ui_line_init(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_INSTALL_ACQUIRE_UI_LINE_H */ diff --git a/src/install/acquire/w32-mod-id.captivemodid.xml b/src/install/acquire/w32-mod-id.captivemodid.xml deleted file mode 100644 index 3e8b9eb..0000000 --- a/src/install/acquire/w32-mod-id.captivemodid.xml +++ /dev/null @@ -1,6699 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/install/fstab/Makefile.am b/src/install/fstab/Makefile.am deleted file mode 100644 index fc08688..0000000 --- a/src/install/fstab/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# $Id$ -# automake source for /etc/fstab installation Makefile -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -captive_install_fstab_SOURCES= \ - main.c -captive_install_fstab_LDADD=../libcaptive-install/libcaptive-install.a -captive_install_fstab_LDADD+=$(LIBNTFS_LIBS) $(POPT_LIBS) $(captive_library) - -if ENABLE_INSTALL_PKG -captive_install_fstab_cond=captive-install-fstab -endif -sbin_PROGRAMS+=$(captive_install_fstab_cond) - -EXTRA_DIST+=captive-install-fstab.pod.pl.in -CLEANFILES+=captive-install-fstab.pod captive-install-fstab.1 -if ENABLE_MAN_PAGES -if ENABLE_INSTALL_PKG -captive_install_fstab_man_cond=captive-install-fstab.1 -endif -endif -man_MANS=$(captive_install_fstab_man_cond) diff --git a/src/install/fstab/captive-install-fstab.pod.pl.in b/src/install/fstab/captive-install-fstab.pod.pl.in deleted file mode 100644 index 1057f13..0000000 --- a/src/install/fstab/captive-install-fstab.pod.pl.in +++ /dev/null @@ -1,93 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for captive-install-fstab(1) man page -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -print <<'POD_EOF'; -=head1 NAME - -@PACKAGE@-install-fstab - Manage B<@PACKAGE@-ntfs> B entries - - -=head1 SYNOPSIS - -=for man -\fB@PACKAGE@-install-fstab\fP [\fB-v\fP|\fB--verbose\fP] [\fB-n\fP|\fB--dry\fP] -{\fB--add\fP|\fB--remove\fP} - - -=head1 DESCRIPTION - -Program will scan your local disk drive partitions (from B) -and it will add/remove appropriate file-system type B entries -in B. - -Destination directory is chosen automatically as BLABEL_NAME -where B is the label used for the B partition. Directory -B may be used if no volume label is set. Different (numbered) -directory name is used if multiple disks have the same volume label set. - - -=head1 OPTIONS - -=over - -=item B<-v>|B<--verbose> - -Display additional information during disks scanning. - - -=item B<-n>|B<--dry> - -Perform all the operations but do not modify anything (file B). -You will probably use this option together with [B<-v>|B<--verbose>]. - - -=item B<--add> - -Add all the found B disk drive partitions to B. -Any previous B entries will be deleted as described in -B<--remove> option. - - -=item B<--remove> - -Remove all lines of filesystem type B<@PACKAGE@-ntfs> and device name in -B directory. - - -=back - - -=head1 SEE ALSO - -B<@PACKAGE@-install-acquire>(1), B<@PACKAGE@>(7), B(7) - - -=head1 AUTHOR - -Jan Kratochvil >, - I -POD_EOF -1; diff --git a/src/install/fstab/main.c b/src/install/fstab/main.c deleted file mode 100644 index 1739a44..0000000 --- a/src/install/fstab/main.c +++ /dev/null @@ -1,331 +0,0 @@ -/* $Id$ - * /etc/fstab installation utility - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#define _GNU_SOURCE 1 /* for memrchr() */ - -#include "config.h" - -#undef FALSE -#undef TRUE -#include /* for 'FALSE'/'TRUE' libntfs definition */ -#define FALSE FALSE -#define TRUE TRUE - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "../libcaptive-install/proc_partitions.h" -#include - -#include -#include - -#include - - -/* Config: */ -#define FILENAME_PROC_PARTITIONS "/proc/partitions" -#define FILENAME_ETC_FSTAB "/etc/fstab" -#define FILENAME_ETC_FSTAB_BACKUP FILENAME_ETC_FSTAB ".pre-captive" -#define FILENAME_ETC_FSTAB_TMP FILENAME_ETC_FSTAB ".tmp" - - -static int optarg_verbose; -static int optarg_dry; -enum optarg_mode { - OPTARG_MODE_UNDEF =0, - OPTARG_MODE_ADD =1, - OPTARG_MODE_REMOVE=2, - }; -static int /* Do not use 'enum optarg_mode' as 'poptOption.arg' is '(int *)'. */ - optarg_mode=OPTARG_MODE_UNDEF; - -static const struct poptOption popt_table[]={ -#define BUG_FSTAB_POPT(shortname,longname,argInfoP,argP,valP,descripP,argDescripP) \ - { \ - longName: (longname), \ - shortName: (shortname), \ - argInfo: (argInfoP)|(!(valP) ? 0 : POPT_ARG_VAL), \ - arg: (void *)argP, \ - val: (valP), \ - descrip: (descripP), \ - argDescrip: (argDescripP), \ - } - - BUG_FSTAB_POPT('v',"verbose",POPT_ARG_NONE,&optarg_verbose,0,N_("Display additional debug information"),NULL), - BUG_FSTAB_POPT('n',"dry" ,POPT_ARG_NONE,&optarg_dry ,0,N_("No real modifications - simulate only"),NULL), - BUG_FSTAB_POPT(0 ,"add" ,POPT_ARG_NONE,&optarg_mode ,OPTARG_MODE_ADD ,N_("Add entries to /etc/fstab"),NULL), - BUG_FSTAB_POPT(0 ,"remove" ,POPT_ARG_NONE,&optarg_mode ,OPTARG_MODE_REMOVE,N_("Remove entries from /etc/fstab"),NULL), - -#undef BUG_FSTAB_POPT - POPT_AUTOHELP - POPT_TABLEEND - }; - - -/* map: (gchar *)dir -> (gpointer)!NULL */ -static GHashTable *dirs_used_hash; - -static void dirs_used_hash_key_destroy_func(gchar *dir) -{ - g_return_if_fail(dir!=NULL); - - g_free(dir); -} - - -static void mntent_add_proc_partitions_ntfs_hash_entry - (const gchar *device,const gchar *vol_name,FILE *mntentfilew /* user_data */) -{ -struct mntent mntent_local; -gint dir_count; -gchar *s; - - g_return_if_fail(device!=NULL); - g_return_if_fail(vol_name!=NULL); - g_return_if_fail(mntentfilew!=NULL); - - vol_name=captive_strdup_alloca(vol_name); - for (s=(/* de-const */ gchar *)vol_name;*s;s++) { - if (!isalnum(*s)) - *s='_'; - else - *s=tolower(*s); - } - if (!*vol_name) - vol_name="noname"; - - CAPTIVE_MEMZERO(&mntent_local); - mntent_local.mnt_fsname=(/* de-const */ gchar *)device; - mntent_local.mnt_dir=(/* de-const */ gchar *)captive_printf_alloca("/mnt/captive-%s",vol_name); - dir_count=1; - while (g_hash_table_lookup(dirs_used_hash,mntent_local.mnt_dir)) { - dir_count++; - mntent_local.mnt_dir=(/* de-const */ gchar *)captive_printf_alloca("/mnt/captive-%s%d",vol_name,dir_count); - } - if (optarg_dry || !mkdir("/mnt",0755)) { - if (optarg_verbose) - g_message(_("Created base mount directory: %s"),"/mnt"); - } - else if (errno!=EEXIST) - g_warning(_("Error creating base mount directory \"%s\" for device \"%s\": %m"), - "/mnt",mntent_local.mnt_fsname); - if (optarg_dry || !mkdir(mntent_local.mnt_dir,0755)) { - if (optarg_verbose) - g_message(_("Created mount directory for device \"%s\": %s"), - mntent_local.mnt_fsname,mntent_local.mnt_dir); - } - else if (errno!=EEXIST) - g_warning(_("Error creating mount directory \"%s\" for device \"%s\": %m"), - mntent_local.mnt_dir,mntent_local.mnt_fsname); - mntent_local.mnt_type="captive-ntfs"; - mntent_local.mnt_opts="defaults,noauto"; /* 'mntent_local.mnt_opts' must be != NULL ! */ - if (optarg_verbose) - g_message(_("Creating captive-ntfs mntent: %s -> %s"),mntent_local.mnt_fsname,mntent_local.mnt_dir); - if (addmntent(mntentfilew,&mntent_local)) - g_warning(_("Error appending mntent for device \"%s\": %m"),mntent_local.mnt_fsname); - g_hash_table_insert(dirs_used_hash,g_strdup(mntent_local.mnt_dir),dirs_used_hash); -} - - -int main(int argc,char **argv) -{ -poptContext context; -int errint; -FILE *mntentfiler,*mntentfilew; -gboolean modified=FALSE; -GHashTable *proc_partitions_ntfs_hash; -struct mntent *mntent; -gchar *mntent_mem=NULL; -size_t mntent_mem_alloc=0; - - captive_standalone_init(); - - context=poptGetContext( - PACKAGE, /* name */ - argc,(/*en-const*/const char **)argv, /* argc,argv */ - popt_table, /* options */ - POPT_CONTEXT_POSIXMEHARDER); /* flags; && !POPT_CONTEXT_KEEP_FIRST */ - if (context==NULL) { - g_assert_not_reached(); /* argument recognization args_error */ - return EXIT_FAILURE; - } - errint=poptReadDefaultConfig(context, - TRUE); /* useEnv */ - if (errint!=0) { - g_assert_not_reached(); /* argument recognization args_error */ - return EXIT_FAILURE; - } - errint=poptGetNextOpt(context); - if (errint!=-1) { - g_assert_not_reached(); /* some non-callbacked argument reached */ - return EXIT_FAILURE; - } - if (poptPeekArg(context)) { - g_error(_("No arguments expected")); - return EXIT_FAILURE; - } - if (optarg_mode==OPTARG_MODE_UNDEF) - g_error(_("No run mode specified")); - - dirs_used_hash=g_hash_table_new_full(g_str_hash,g_str_equal, - (GDestroyNotify)dirs_used_hash_key_destroy_func, - (GDestroyNotify)NULL); - - /* FIXME: locking! */ - if (!(mntentfiler=setmntent(FILENAME_ETC_FSTAB,"r"))) - g_error(_("Cannot open \"%s\" for reading: %m"),FILENAME_ETC_FSTAB); - if (!(mntentfilew=setmntent((optarg_dry ? "/dev/null" : FILENAME_ETC_FSTAB_TMP),"w"))) - g_error(_("Cannot open \"%s\" for writing: %m"),FILENAME_ETC_FSTAB_TMP); - - proc_partitions_ntfs_hash=proc_partitions_ntfs_hash_get(optarg_verbose); - do { -long mntent_offset_start,mntent_offset_end; -gchar *mntent_mem_last_line; -size_t mntent_mem_len, mntent_mem_last_line_len; - - mntent_offset_start=ftell(mntentfiler); - mntent=getmntent(mntentfiler); - mntent_offset_end=ftell(mntentfiler); - g_assert(mntent_offset_end>=mntent_offset_start); - mntent_mem_len=mntent_offset_end-mntent_offset_start; - if (mntent_mem_len>mntent_mem_alloc) { - g_free(mntent_mem); - mntent_mem_alloc=2*mntent_mem_len; - mntent_mem=g_malloc(mntent_mem_alloc); - } - if (fseek(mntentfiler,mntent_offset_start,SEEK_SET)) - g_warning(_("Error seeking in \"%s\": %m"),FILENAME_ETC_FSTAB); - if (mntent_mem_len!=fread(mntent_mem,1,mntent_mem_len,mntentfiler)) - g_warning(_("Error reading \"%s\": %m"),FILENAME_ETC_FSTAB); - mntent_mem_last_line=NULL; - if (mntent_offset_end!=ftell(mntentfiler)) - g_warning(_("Invalid position in \"%s\" after fread(3): %m"),FILENAME_ETC_FSTAB); - if (mntent_mem_len) { -size_t comments_len; - - if (mntent_mem[mntent_mem_len-1]!='\n') - g_warning(_("mntent memory block not newline-terminated from \"%s\""),FILENAME_ETC_FSTAB); - if ((mntent_mem_last_line=memrchr(mntent_mem,'\n',mntent_mem_len-1))) { - mntent_mem_last_line++; - comments_len=mntent_mem_last_line-mntent_mem; - mntent_mem_last_line_len=mntent_mem_len-comments_len; - if (comments_len!=fwrite(mntent_mem,1,comments_len,mntentfilew)) - g_error(_("Error copying comments before device \"%s\" to \"%s\": %m"), - (!mntent ? "" : mntent->mnt_fsname),FILENAME_ETC_FSTAB_TMP); - } - } - if (!mntent_mem_last_line) { - mntent_mem_last_line=mntent_mem; - mntent_mem_last_line_len=mntent_mem_len; - } - if (mntent - && !strcmp(mntent->mnt_type,"captive-ntfs") - && !strncmp(mntent->mnt_fsname,"/dev/",strlen("/dev/"))) { - switch (optarg_mode) { - - case OPTARG_MODE_REMOVE: - if (optarg_verbose) - g_message(_("Dropping captive mntent: %s"),mntent->mnt_fsname); - if (optarg_dry || !rmdir(mntent->mnt_dir)) { - if (optarg_verbose) - g_message(_("Deleted mount directory for device \"%s\": %s"), - mntent->mnt_fsname,mntent->mnt_dir); - } - else if (errno!=EEXIST) - g_warning(_("Error removing mount directory \"%s\" of device \"%s\": %m"), - mntent->mnt_dir,mntent->mnt_fsname); - modified=TRUE; - continue; - /* NOTREACHED */ - - case OPTARG_MODE_ADD: - if (!g_hash_table_lookup(proc_partitions_ntfs_hash,mntent->mnt_fsname)) - g_warning(_("Dropping no-longer valid captive filesystem mntent from \"%s\" of device: %s"), - FILENAME_ETC_FSTAB,mntent->mnt_fsname); - else { - /* Original mntent is dropped to be replaced by new one. */ - if (optarg_verbose) - g_message(_("Dropping captive mntent to be replaced by new one: %s"),mntent->mnt_fsname); - } - modified=TRUE; - continue; - /* NOTREACHED */ - - default: g_assert_not_reached(); - } - } - if (mntent_mem_last_line_len!=fwrite(mntent_mem_last_line,1,mntent_mem_last_line_len,mntentfilew)) - g_error(_("Error copying mntent for device \"%s\" to \"%s\": %m"),mntent->mnt_fsname,FILENAME_ETC_FSTAB_TMP); - if (mntent) - g_hash_table_insert(dirs_used_hash,g_strdup(mntent->mnt_dir),dirs_used_hash); - } while (mntent); - g_free(mntent_mem); - if (optarg_mode==OPTARG_MODE_ADD) { - if (g_hash_table_size(proc_partitions_ntfs_hash)) - modified=TRUE; - g_hash_table_foreach(proc_partitions_ntfs_hash, - (GHFunc)mntent_add_proc_partitions_ntfs_hash_entry, /* func */ - mntentfilew); /* user_data */ - } - g_hash_table_destroy(proc_partitions_ntfs_hash); - - if (optarg_verbose) - g_message(_("Modified status: %s"),(modified ? _("YES") : _("NO"))); - if (1!=endmntent(mntentfiler)) - g_error(_("Cannot close \"%s\" after reading: %m"),FILENAME_ETC_FSTAB); - if (!optarg_dry) { - if (fchmod(fileno(mntentfilew),0644)) - g_error(_("Cannot set permissions for \"%s\" after writing: %m"),FILENAME_ETC_FSTAB_TMP); - } - if (1!=endmntent(mntentfilew)) - g_error(_("Cannot close \"%s\" after writing: %m"),FILENAME_ETC_FSTAB_TMP); - if (!optarg_dry) { - if (modified) { - if (!access(FILENAME_ETC_FSTAB_BACKUP,F_OK)) { - if (optarg_verbose) - g_message(_("Backup file exists - keeping it intact: %s"),FILENAME_ETC_FSTAB_BACKUP); - } - else if (errno==ENOENT) { - if (optarg_verbose) - g_message(_("File \"%s\" backed up to: %s"),FILENAME_ETC_FSTAB,FILENAME_ETC_FSTAB_BACKUP); - if (rename(FILENAME_ETC_FSTAB,FILENAME_ETC_FSTAB_BACKUP)) - g_warning(_("Cannot backup \"%s\" to \"%s\": %m"),FILENAME_ETC_FSTAB,FILENAME_ETC_FSTAB_BACKUP); - } - else - g_warning(_("Backup file \"%s\" state unknown: %m"),FILENAME_ETC_FSTAB_BACKUP); - if (rename(FILENAME_ETC_FSTAB_TMP,FILENAME_ETC_FSTAB)) - g_error(_("Cannot move new \"%s\" over old \"%s\": %m"),FILENAME_ETC_FSTAB_TMP,FILENAME_ETC_FSTAB); - } - else { - if (unlink(FILENAME_ETC_FSTAB_TMP)) - g_error(_("Cannot remove new unmodified \"%s\": %m"),FILENAME_ETC_FSTAB_TMP); - } - } - - return EXIT_SUCCESS; -} diff --git a/src/install/libcaptive-install/Makefile.am b/src/install/libcaptive-install/Makefile.am deleted file mode 100644 index acd98e5..0000000 --- a/src/install/libcaptive-install/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# $Id$ -# automake source for the libcaptive-install Makefile -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -libcaptive_install_a_SOURCES= \ - proc_partitions.c \ - proc_partitions.h - -if ENABLE_INSTALL_PKG -libcaptive_install_a_cond=libcaptive-install.a -endif -noinst_LIBRARIES=$(libcaptive_install_a_cond) diff --git a/src/install/libcaptive-install/proc_partitions.c b/src/install/libcaptive-install/proc_partitions.c deleted file mode 100644 index 0c7d7b1..0000000 --- a/src/install/libcaptive-install/proc_partitions.c +++ /dev/null @@ -1,115 +0,0 @@ -/* $Id$ - * /proc/partitions file reader for installers of captive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#undef FALSE -#undef TRUE -#include /* for 'FALSE'/'TRUE' libntfs definition */ -#define FALSE FALSE -#define TRUE TRUE - -#include "proc_partitions.h" /* self */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - - -/* Config: */ -#define FILENAME_PROC_PARTITIONS "/proc/partitions" - - -static void proc_partitions_ntfs_hash_key_destroy_func(gchar *device) -{ - g_return_if_fail(device!=NULL); - - g_free(device); -} - -static void proc_partitions_ntfs_hash_value_destroy_func(gchar *vol_name) -{ - g_return_if_fail(vol_name!=NULL); - - g_free(vol_name); -} - - -GHashTable *proc_partitions_ntfs_hash_get(gboolean msg_verbose) -{ -FILE *fpartitions; -gchar line[LINE_MAX]; -gint lineno; -/* map: (gchar *)device -> (gchar *)vol_name */ -GHashTable *proc_partitions_ntfs_hash; - - proc_partitions_ntfs_hash=g_hash_table_new_full(g_str_hash,g_str_equal, - (GDestroyNotify)proc_partitions_ntfs_hash_key_destroy_func, - (GDestroyNotify)proc_partitions_ntfs_hash_value_destroy_func); - - if (!(fpartitions=fopen(FILENAME_PROC_PARTITIONS,"r"))) - g_error(_("Cannot open \"%s\": %m"),FILENAME_PROC_PARTITIONS); - lineno=0; - while (fgets(line,sizeof(line),fpartitions)) { -unsigned major,minor; -unsigned long long blocks; -char device[strlen("/dev/")+100]; -ntfs_volume *volume; - - lineno++; - if (lineno<=2) - continue; - if (!*line || *line=='\n') { - /* At least RedHat Linux kernel 2.4.18-18.8.0 sometimes appends - * bogus empty line at the end of file. - */ - continue; - } - if (4!=sscanf(line,"%u%u%llu%100s",&major,&minor,&blocks,device+strlen("/dev/"))) { - g_warning(_("Error parsing line of \"%s\" (Linux kernel bug): %s"),FILENAME_PROC_PARTITIONS,line); - continue; - } - memcpy(device,"/dev/",strlen("/dev/")); - if (!(volume=ntfs_mount(device,MS_RDONLY))) { - if (msg_verbose) - g_message(_("not ntfs: %s"),device); - continue; - } - if (msg_verbose) - g_message(_("FOUND ntfs: %s\t%s"),device,volume->vol_name); - g_hash_table_insert(proc_partitions_ntfs_hash,g_strdup(device),g_strdup(volume->vol_name)); - if (ntfs_umount(volume, - TRUE)) /* force; close even if it would mean data loss */ - g_warning(_("Error unmounting volume: %s"),device); - } - if (fclose(fpartitions)) - g_warning(_("Cannot close \"%s\": %m"),FILENAME_PROC_PARTITIONS); - return proc_partitions_ntfs_hash; -} diff --git a/src/install/libcaptive-install/proc_partitions.h b/src/install/libcaptive-install/proc_partitions.h deleted file mode 100644 index 63e1daf..0000000 --- a/src/install/libcaptive-install/proc_partitions.h +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id$ - * Include file for /proc/partitions file reader for installers of captive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_PROC_PARTITIONS_USECOUNT_H -#define _CAPTIVE_PROC_PARTITIONS_USECOUNT_H 1 - - -#include -#include - - -G_BEGIN_DECLS - -/* map: (gchar *)device -> (gchar *)vol_name */ -GHashTable *proc_partitions_ntfs_hash_get(gboolean msg_verbose); - -G_END_DECLS - - -#endif /* _CAPTIVE_PROC_PARTITIONS_USECOUNT_H */ diff --git a/src/libcaptive/Makefile-libcaptive.am b/src/libcaptive/Makefile-libcaptive.am deleted file mode 100644 index 7230646..0000000 --- a/src/libcaptive/Makefile-libcaptive.am +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ -# automake source include for compilations inside libcaptive -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -INCLUDES+=-DLIBCAPTIVE - -# Please see the comment above $(INCLUDES) in $(top_srcdir)/Makefile-head.am . -# Keep $(top_srcdir)/src/libcaptive/reactos/include as first to permit include files override. -INCLUDES+=-I$(top_srcdir)/src/libcaptive/reactos/include -INCLUDES+=-I$(top_srcdir)/reactos/include -I$(top_srcdir)/reactos/ntoskrnl/include diff --git a/src/libcaptive/Makefile.am b/src/libcaptive/Makefile.am deleted file mode 100644 index 56a0aea..0000000 --- a/src/libcaptive/Makefile.am +++ /dev/null @@ -1,67 +0,0 @@ -# $Id$ -# automake source for the toplibcaptivesrclevel Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -# FIXME: Dependency: storage -> sandbox -SUBDIRS=include reactos halcaptive cc cm ex fs io kd ke ldr mm nt ob po ps rtl se sandbox client storage - -EXTRA_DIST+= \ - Makefile-libcaptive.am - -lib_LTLIBRARIES+=libcaptive.la -libcaptive_la_LIBADD= \ - reactos/libreactos.la \ - halcaptive/libhalcaptive.la \ - cc/libcc.la \ - cm/libcm.la \ - ex/libex.la \ - fs/libfs.la \ - io/libio.la \ - kd/libkd.la \ - ke/libke.la \ - ldr/libldr.la \ - mm/libmm.la \ - nt/libnt.la \ - ob/libob.la \ - po/libpo.la \ - ps/libps.la \ - rtl/librtl.la \ - se/libse.la \ - storage/libstorage.la \ - sandbox/libsandbox.la \ - client/libclient.la -libcaptive_la_LDFLAGS=-release $(VERSION) -libcaptive_la_SOURCES= - -EXTRA_DIST+=captive.pod.pl.in -CLEANFILES+=captive.pod captive.7 -if ENABLE_MAN_PAGES -captive_man_cond=captive.7 -endif -man_MANS=$(captive_man_cond) - -install-exec-hook: - if test `id -u` -eq 0 -a -z "$(DESTDIR)";then \ - if test x$(libdir) != x/lib -a x$(libdir) != x/usr/lib && ! grep -q '^$(libdir)$$' /etc/ld.so.conf;then \ - echo -n "WARNING: Add '$(libdir)' to your '/etc/ld.so.conf' and run ldconfig(8)! Press ENTER...";read; \ - fi; \ - ldconfig || echo -n "WARNING: Failed to run ldconfig(8) - run manually! Press ENTER...";read; \ - fi - diff --git a/src/libcaptive/captive.pod.pl.in b/src/libcaptive/captive.pod.pl.in deleted file mode 100644 index 5830f5c..0000000 --- a/src/libcaptive/captive.pod.pl.in +++ /dev/null @@ -1,57 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for captive(7) man page -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -print <<'POD_EOF'; -=head1 NAME - -@PACKAGE@ - Microsoft Windows NT kernel emulation for NTFS disk access - - -=head1 DESCRIPTION - -B<@PACKAGE@>(7) library allows applications running under the B -operating system to access B drives. File system driver compatibility -with B, B and B is also provided. - -This man page B<@PACKAGE@>(7) show the common options of all B<@PACKAGE@> -clients. You will always use a specific client such as -B(8) or B<@PACKAGE@-cmdline>(1). - - -POD_EOF -require "./client/options.pod.pl"; -print <<'POD_EOF'; -=head1 SEE ALSO - -B(8), B<@PACKAGE@-cmdline>(1), B<@PACKAGE@-install-acquire>(1) - - -=head1 AUTHOR - -Jan Kratochvil >, - I -POD_EOF -1; diff --git a/src/libcaptive/cc/Makefile.am b/src/libcaptive/cc/Makefile.am deleted file mode 100644 index bf9f84d..0000000 --- a/src/libcaptive/cc/Makefile.am +++ /dev/null @@ -1,63 +0,0 @@ -# $Id$ -# automake source for the reactos's cc/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libcc.la -libcc_la_SOURCES= \ - bcbmap.c \ - bcbowner.c \ - bcbpin.c \ - bcbrepin.c \ - bcbunpin.c \ - cache.c \ - copy.c \ - dirtypages.c \ - init.c \ - io.c \ - io.h \ - loghandle.c \ - misc.c \ - mm.c \ - privatebcb-priv.h \ - privatebcb.c \ - privatebcb.h \ - privatebcbmap.c \ - privatebcbmap.h \ - privatebcbpin.c \ - privatebcbpin.h \ - sharedcachemap-priv.h \ - sharedcachemap.c \ - sharedcachemap.h \ - $(MARSHALLERS) - -marshallers.h: marshallers.list - $(GLIB_GENMARSHAL) --prefix=captive_cc $< --header >$@ - -marshallers.c: marshallers.list - $(GLIB_GENMARSHAL) --prefix=captive_cc $< --body >$@ - -EXTRA_DIST+= \ - marshallers.list -MARSHALLERS= \ - marshallers.c \ - marshallers.h -# 'BUILT_SOURCES' will force its building before any other compilation. -BUILT_SOURCES+=$(MARSHALLERS) -CLEANFILES+=$(MARSHALLERS) diff --git a/src/libcaptive/cc/bcbmap.c b/src/libcaptive/cc/bcbmap.c deleted file mode 100644 index cde1cdd..0000000 --- a/src/libcaptive/cc/bcbmap.c +++ /dev/null @@ -1,152 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) map Bcb handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbmap.h" -#include "reactos/ntos/types.h" -#include "reactos/ddk/iotypes.h" -#include "reactos/ddk/cctypes.h" -#include "reactos/ddk/ccfuncs.h" -#include "sharedcachemap.h" -#include "privatebcb.h" - - -/** - * CcMapData: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @FileOffset: The @FileObject file offset from where to map the region from. - * Negative value is forbidden. - * @Length: Requested length of the region to map from @FileObject. - * FIXME: Value %0 is currently forbidden by libcaptive; it should be allowed. - * @Flags: %MAP_WAIT means whether disk waiting is permitted for this function. - * Value without %MAP_WAIT is currently forbidden by libcaptive as we have no on-demand loading implemented. - * %MAP_NO_READ will leave the pages unread (libcaptive: unread pages zeroed, - * already mapped pages shared with existing content) - needed by ntfs.sys of NT-5.1sp1 - * as during file write it will %MAP_NO_READ and consequently push the data there; - * any request for the same file range read in the meantime will destroy the prepared data! - * @Bcb: Returns initialized #PUBLIC_BCB to refer to the mapped region. - * The memory region can be larger than requested as it is %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * @Buffer: Returns the mapped memory region start address. - * This address may not be %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * - * Maps the specified region of @FileObject to automatically chosen address space. - * FIXME: No on-demand loading implemented yet - the whole region is read at the time of this function call. - * - * WARNING: If you modify the data in the returned @Buffer you must call some CcPinMappedData() - * or CcPinRead() afterwards. W32 docs say you should never modify the data in any way from this function - * but W32 filesystems apparently do not conform to it. If you do not take care of the - * modified data by some dirty-marking facility such data will be carelessly dropped without - * their commit to the disk. - * - * This call does not set the buffer as dirty - such buffer will not be flushed automatically. - * - * Every call to this function must be matched by a one corresponding CcUnpinData() call. - * - * We can be called as full CcMapData() (e.g. CcPinRead() from fastfat.sys) - * even if such mapping for such file already exists. - * We should probably create a new #Bcb for the same space, - * at least ntfs.sys of NT-5.1sp1 appears to expect it. Bleech. - * - * Returns: %TRUE if the region was successfuly mapped. - * @Bcb with the initialized new memory region. - * @Buffer with the address of the exact byte specified by @FileOffset. - */ -BOOLEAN CcMapData(IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset,IN ULONG Length,IN ULONG Flags,OUT PVOID *Bcb,OUT PVOID *Buffer) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -CaptivePrivateBcbMapObject *captive_private_bcb_map_object; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcMapData: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Flags=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Flags); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - g_return_val_if_fail(FileOffset!=NULL,FALSE); - g_return_val_if_fail(FileOffset->QuadPart>=0,FALSE); - g_return_val_if_fail(Length>0,FALSE); /* FIXME: not handled below; 0 should be allowed */ - g_return_val_if_fail(Flags==MAP_WAIT,FALSE); /* FIXME */ - g_return_val_if_fail(Bcb!=NULL,FALSE); - g_return_val_if_fail(Buffer!=NULL,FALSE); - - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - captive_private_bcb_map_object=captive_private_bcb_map_object_get_ref(SharedCacheMap); - - captive_shared_cache_map_data_validate_read(SharedCacheMap,FileObject,FileOffset->QuadPart,FileOffset->QuadPart+Length); - - *Bcb=captive_private_bcb_object_get_PublicBcb(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_map_object)); - *Buffer=captive_shared_cache_map_get_buffer(SharedCacheMap)+FileOffset->QuadPart; - r=TRUE; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcMapData: r=%d,Bcb=0x%lX,Buffer=0x%lX", - r,(!Bcb ? -1 : (long)*Bcb),(!Buffer ? -1 : (long)*Buffer)); - - return r; -} - - -/** - * CcRemapBcb: - * @Bcb: Initialized #PUBLIC_BCB structure. - * %NULL value is forbidden. - * - * Create a copy of @Bcb for the exactly same file contents as is @Bcb. - * The returned copy has the same attributes as the result of CcMapData() - * notwithstanding the current state of input @Bcb, therefore it is only - * for read/only access etc. - * - * libcaptive calls CcMapData() internally with @Bcb parameters. - * - * This function is called only by ntfs.sys of NT-5.1sp1 and it will perform - * these operations with the resulting #PUBLIC_BCB: - * CcRemapBcb(), CcSetDirtyPinnedData(), CcUnpinData() - * - * Untested: This call does not set the buffer as dirty - such buffer will not be flushed automatically. - * - * Returns: Copy of @Bcb. This _pointer_ never equals to @Bcb. - * It should be some different - * #PUBLIC_BCB structure according to W32 doc. - */ -PVOID CcRemapBcb(IN PVOID Bcb) -{ -CaptivePrivateBcbObject *captive_private_bcb_object; -CaptiveSharedCacheMapObject *SharedCacheMap; -CaptivePrivateBcbMapObject *captive_private_bcb_map_object; -PUBLIC_BCB *PublicBcb; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcRemapBcb: Bcb=0x%lX",(long)Bcb); - - g_return_val_if_fail(Bcb!=NULL,NULL); - - captive_private_bcb_object=captive_PublicBcb_to_PrivateBcbObject(Bcb); - SharedCacheMap=captive_private_bcb_object_get_SharedCacheMap(captive_private_bcb_object); - - /* 'Bcb' may even belong to SharedCacheMap without any existing map Bcb (just pin Bcbs). */ - captive_private_bcb_map_object=captive_private_bcb_map_object_get_ref(SharedCacheMap); - - PublicBcb=captive_private_bcb_object_get_PublicBcb(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_map_object)); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcRemapBcb: r=0x%lX",(long)PublicBcb); - - return PublicBcb; -} diff --git a/src/libcaptive/cc/bcbowner.c b/src/libcaptive/cc/bcbowner.c deleted file mode 100644 index 1773c0d..0000000 --- a/src/libcaptive/cc/bcbowner.c +++ /dev/null @@ -1,87 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) owner handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbpin.h" -#include "privatebcb.h" - - -/** - * CcSetBcbOwnerPointer: - * @Bcb: Initialized #PUBLIC_BCB structure. - * %NULL value is forbidden. - * @Owner: Thread-specific pointer (FIXME: Is it KeGetCurrentThread()?). - * %NULL value is forbidden (FIXME: Is it W32 compliant?). - * - * Set thread-specific pointer for a pinned @Bcb. Use CcUnpinDataForThread() - * when @Bcb is no longer needed. CcUnpinDataForThread() is NOT a reverse - * operation for this single call CcSetBcbOwnerPointer(), see CcUnpinDataForThread(). - * - * libcaptive implements this function as no-operation as it does not yet - * support any threading. - */ -VOID CcSetBcbOwnerPointer(IN PVOID Bcb,IN PVOID Owner) -{ -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcSetBcbOwnerPointer: Bcb=0x%lX,OwnerPointer=0x%lX", - (long)Bcb,(long)Owner); - - g_return_if_fail(Bcb!=NULL); - g_return_if_fail(Owner!=NULL); - - captive_private_bcb_pin_object=CAPTIVE_PRIVATE_BCB_PIN_OBJECT(captive_PublicBcb_to_PrivateBcbObject(Bcb)); - - captive_private_bcb_pin_object_detach_pin(captive_private_bcb_pin_object); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcSetBcbOwnerPointer"); -} - - -/** - * CcUnpinDataForThread: - * @Bcb: Initialized #PUBLIC_BCB structure. - * %NULL value is forbidden. - * @ResourceThreadId: Thread-specific pointer (FIXME: Is it KeGetCurrentThread()?). - * This pointer had to be passed to CcSetBcbOwnerPointer() #Owner parameter previously. - * %NULL value is forbidden (FIXME: is it W32 compliant?). - * - * CcUnpinData() for a thread specified by @ResourceThreadId. - * Reverse operation for a pair of CcMapData() and CcSetBcbOwnerPointer(). - * - * libcaptive implements this function as a simple pass to CcUnpinData() as it does not yet - * support any threading. - */ -VOID CcUnpinDataForThread(IN PVOID Bcb,IN ERESOURCE_THREAD ResourceThreadId) -{ -CaptivePrivateBcbObject *captive_private_bcb_object; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcUnpinDataForThread: Bcb=0x%lX,ResourceThreadId=0x%lX", - (long)Bcb,(long)ResourceThreadId); - - g_return_if_fail(Bcb!=NULL); - g_return_if_fail(ResourceThreadId!=0); - - captive_private_bcb_object=captive_PublicBcb_to_PrivateBcbObject(Bcb); - - g_object_unref(captive_private_bcb_object); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcUnpinDataForThread"); -} diff --git a/src/libcaptive/cc/bcbpin.c b/src/libcaptive/cc/bcbpin.c deleted file mode 100644 index c9420dc..0000000 --- a/src/libcaptive/cc/bcbpin.c +++ /dev/null @@ -1,294 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) pin Bcb handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbpin.h" -#include "reactos/ddk/ccfuncs.h" -#include "privatebcb.h" -#include "captive/macros.h" - - -/** - * CcPinMappedData: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @MappedFileOffset: The @FileObject file offset from where to map the region from. - * Negative value is forbidden. - * @MappedLength: Requested length of the region to map from @FileObject. - * FIXME: Value %0 is currently forbidden by libcaptive; it should be allowed. - * @Wait: Whether disk waiting is permitted for this function. - * Value currently ignored by libcaptive as the data must have been mapped by CcMapData() already anyway. - * @Flags: %PIN_WAIT means whether disk waiting is permitted for this function. - * Value without %PIN_WAIT is currently permtted by libcaptive as the data must have been mapped by CcMapData() already anyway. - * %PIN_NO_READ is the same as %MAP_NO_READ - see CcMapData(). - * FIXME: %PIN_EXCLUSIVE for exclusive @Bcb access is now ignored by libcaptive. - * %PIN_IF_BCB if @Bcb should never be created; function is successful only if @Bcb already exists. - * @Bcb: Returns initialized #PUBLIC_BCB to refer to the mapped region. - * The memory region can be larger than requested as it is %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * @Buffer: Returns the mapped memory region start address. - * This address may not be %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * - * This function will allow you to modify the data mapped by CcMapData(). - * libcaptive does not differentiate this function with CcMapData(). - * - * This call does not set the buffer as dirty - such buffer will not be flushed automatically. - * - * NEVER re-read any memory from FileObject here! - * at least fastfat.sys directory create relies on the fact of CcPinRead() - * with already modified buffers to be left intact. - * - * This call will proceed as CcPinRead() if such #Bcb does not yet exist. - * This is IMO just a bug workaround for a peruse by fastfat.sys FatLocateVolumeLabel(). - * - * Every call to this function must be matched by a one corresponding CcUnpinData() call. - * - * Returns: %TRUE if the region was successfuly mapped. - * @Bcb with the initialized new memory region. - * @Buffer with the address of the exact byte specified by @FileOffset. - */ -BOOLEAN CcPinMappedData - (IN PFILE_OBJECT FileObject,IN PLARGE_INTEGER FileOffset,IN ULONG Length,IN ULONG Flags,OUT PVOID *Bcb) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcPinMappedData: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Flags=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Flags); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - g_return_val_if_fail(FileOffset!=NULL,FALSE); - g_return_val_if_fail(FileOffset->QuadPart>=0,FALSE); - g_return_val_if_fail(Length>0,FALSE); /* FIXME: not handled below; 0 should be allowed */ - g_return_val_if_fail(Flags==PIN_WAIT,FALSE); /* FIXME */ - g_return_val_if_fail(Bcb!=NULL,FALSE); - - g_assert(Length<=PAGE_SIZE); - /* Check PAGE_SIZE crossing */ - g_assert((FileOffset->QuadPart&~(PAGE_SIZE-1))==((FileOffset->QuadPart+Length-1)&~(PAGE_SIZE-1))); - - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - /* Do not invalide 'map'ped data otherwise ntfs.sys of NT-5.1sp1 mount crashes. - */ - captive_private_bcb_pin_object=captive_private_bcb_pin_object_get_ref(SharedCacheMap, - CAPTIVE_ROUND_DOWN64(FileOffset->QuadPart,PAGE_SIZE), - FALSE); /* invalidate_new */ - - captive_shared_cache_map_data_validate_noread(SharedCacheMap,FileOffset->QuadPart,FileOffset->QuadPart+Length); - - *Bcb=captive_private_bcb_object_get_PublicBcb(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)); - r=TRUE; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcPinMappedData: r=%d,Bcb=0x%lX", - r,(!Bcb ? -1 : (long)*Bcb)); - - return r; -} - - -/** - * CcPinRead: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @FileOffset: The @FileObject file offset from where to map the region from. - * Negative value is forbidden. - * @Length: Requested length of the region to map from @FileObject. - * FIXME: Value %0 is currently forbidden by libcaptive; it should be allowed. - * @Flags: %PIN_WAIT means whether disk waiting is permitted for this function. - * Value without %PIN_WAIT is currently permtted by libcaptive as the data must have been mapped by CcMapData() already anyway. - * %PIN_NO_READ is the same as %MAP_NO_READ - see CcMapData(). - * FIXME: %PIN_EXCLUSIVE for exclusive @Bcb access is now ignored by libcaptive. - * %PIN_IF_BCB if @Bcb should never be created; function is successful only if @Bcb already exists. - * @Bcb: Returns initialized #PUBLIC_BCB to refer to the mapped region. - * The memory region can be larger than requested as it is %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * @Buffer: Returns the mapped memory region start address. - * This address may not be %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * - * Merely a shortcut call for CcMapData() and CcPinMappedData() afterwards. - * See these two functions for the details. It has a difference to subsequent - * calling of CcMapData() and CcPinMappedData() instead as this call counts - * only as one function for a corresponding CcUnpinData() call. - * - * This call does not set the buffer as dirty - such buffer will not be flushed automatically. - * - * Every call to this function must be matched by a one corresponding CcUnpinData() call. - * - * Returns: %TRUE if the region was successfuly mapped. - * @Bcb with the initialized new memory region. - * @Buffer with the address of the exact byte specified by @FileOffset. - */ -BOOLEAN CcPinRead(IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset,IN ULONG Length,IN ULONG Flags,OUT PVOID *Bcb,OUT PVOID *Buffer) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcPinRead: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Flags=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Flags); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - g_return_val_if_fail(FileOffset!=NULL,FALSE); - g_return_val_if_fail(FileOffset->QuadPart>=0,FALSE); - g_return_val_if_fail(Length>0,FALSE); /* FIXME: not handled below; 0 should be allowed */ - g_return_val_if_fail((Flags&~PIN_IF_BCB)==PIN_WAIT,FALSE); /* FIXME */ - g_return_val_if_fail(Bcb!=NULL,FALSE); - g_return_val_if_fail(Buffer!=NULL,FALSE); - - g_assert(Length<=PAGE_SIZE); - /* Check PAGE_SIZE crossing */ - g_assert((FileOffset->QuadPart&~(PAGE_SIZE-1))==((FileOffset->QuadPart+Length-1)&~(PAGE_SIZE-1))); - - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - - if (Flags&PIN_IF_BCB) { - if ((captive_private_bcb_pin_object=captive_private_bcb_pin_object_get(SharedCacheMap, - CAPTIVE_ROUND_DOWN64(FileOffset->QuadPart,PAGE_SIZE)))) - g_object_ref(captive_private_bcb_pin_object); - } - else { - /* Invalide possibly only 'map'ped data as we need to re-read them on CcPinRead(). - * Otherwise any file written by fastfat.sys of NT-5.1sp1 will corrupt - * the code+55AA of DOS boot sector (disk offset 0x0). - */ - captive_private_bcb_pin_object=captive_private_bcb_pin_object_get_ref(SharedCacheMap, - CAPTIVE_ROUND_DOWN64(FileOffset->QuadPart,PAGE_SIZE), - TRUE); /* invalidate_new */ - } - - if (captive_private_bcb_pin_object) { - captive_shared_cache_map_data_validate_read(SharedCacheMap,FileObject,FileOffset->QuadPart,FileOffset->QuadPart+Length); - - *Bcb=captive_private_bcb_object_get_PublicBcb(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)); - } - *Buffer=captive_shared_cache_map_get_buffer(SharedCacheMap)+FileOffset->QuadPart; - r=!!captive_private_bcb_pin_object; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcPinRead: r=%d,Bcb=0x%lX,Buffer=0x%lX", - r,(!Bcb ? -1 : (long)*Bcb),(!Buffer ? -1 : (long)*Buffer)); - - return r; -} - - -/** - * CcSetDirtyPinnedData: - * @Bcb: #PUBLIB_BCB to be unpinned from CcRepinBcb(). - * %NULL value is forbidden. - * @Lsn: Optional LSN (Linear Sequence Number) to assign to @Bcb. - * %NULL pointer is permitted. - * - * This call will set the buffer as dirty - such buffer will be flushed automatically. - * - * You should call it only on CcPin*() buffers - not just CcMapData() buffers - * although libcaptive does not differentiate it. - */ -VOID CcSetDirtyPinnedData(IN PVOID Bcb,IN PLARGE_INTEGER Lsn OPTIONAL) -{ -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcSetDirtyPinnedData: BcbVoid=0x%lX,Lsn=0x%lX", - (long)Bcb,(!Lsn ? -1 : (long)Lsn->QuadPart)); - - g_return_if_fail(Bcb!=NULL); - - captive_private_bcb_pin_object=CAPTIVE_PRIVATE_BCB_PIN_OBJECT(captive_PublicBcb_to_PrivateBcbObject(Bcb)); - - captive_private_bcb_pin_object_set_dirty(captive_private_bcb_pin_object); - if (Lsn) - captive_private_bcb_pin_object_set_lsn(captive_private_bcb_pin_object,Lsn->QuadPart); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcSetDirtyPinnedData"); -} - - -/** - * CcPreparePinWrite: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @FileOffset: The @FileObject file offset from where to map the region from. - * Negative value is forbidden. - * @Length: Requested length of the region to map from @FileObject. - * FIXME: Value %0 is currently forbidden by libcaptive; it should be allowed. - * @Zero: %TRUE if the area of @FileOffset...@FileOffset+@Length should be cleared. - * @Flags: %PIN_WAIT means whether disk waiting is permitted for this function. - * Value without %PIN_WAIT is currently permtted by libcaptive as the data must have been mapped by CcMapData() already anyway. - * %PIN_NO_READ is the same as %MAP_NO_READ - see CcMapData(). - * FIXME: %PIN_EXCLUSIVE for exclusive @Bcb access is now ignored by libcaptive. - * %PIN_IF_BCB if @Bcb should never be created; function is successful only if @Bcb already exists. - * @Bcb: Returns initialized #PUBLIC_BCB to refer to the mapped region. - * The memory region can be larger than requested as it is %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * @Buffer: Returns the mapped memory region start address. - * This address may not be %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * - * Wrapper for a pair of CcPinRead() and CcSetDirtyPinnedData(). - * The mapped range can be also optionally cleared if @Zero is specified. - * See CcPinRead() for a more detailed documentation. - * - * This call will set the buffer as dirty - such buffer will be flushed automatically. - * - * Returns: %TRUE if the mapping was successful. - */ -BOOLEAN CcPreparePinWrite(IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset,IN ULONG Length,IN BOOLEAN Zero,IN ULONG Flags,OUT PVOID *Bcb,OUT PVOID *Buffer) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcPreparePinWrite: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Zero=%d,Flags=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Zero,Flags); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - g_return_val_if_fail(FileOffset!=NULL,FALSE); - g_return_val_if_fail(FileOffset->QuadPart>=0,FALSE); - g_return_val_if_fail(Length>0,FALSE); /* FIXME: not handled below; 0 should be allowed */ - g_return_val_if_fail(Flags==PIN_WAIT,FALSE); /* FIXME */ - g_return_val_if_fail(Bcb!=NULL,FALSE); - g_return_val_if_fail(Buffer!=NULL,FALSE); - - g_assert(0==CAPTIVE_ROUND_DOWN_EXCEEDING64(FileOffset->QuadPart,PAGE_SIZE)); /* NOT YET IMPLEMENTED */ - g_assert(Length==PAGE_SIZE); /* NOT YET IMPLEMENTED */ - - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - captive_private_bcb_pin_object=captive_private_bcb_pin_object_get_ref(SharedCacheMap, - CAPTIVE_ROUND_DOWN64(FileOffset->QuadPart,PAGE_SIZE), - FALSE); /* invalidate_new: FIXME: Is it compatible? */ - - captive_shared_cache_map_set_data_valid(SharedCacheMap,FileOffset->QuadPart,FileOffset->QuadPart+Length); - if (Zero) - memset(captive_shared_cache_map_get_buffer(SharedCacheMap)+FileOffset->QuadPart,0,Length); - captive_shared_cache_map_set_dirty(SharedCacheMap,FileOffset->QuadPart,FileOffset->QuadPart+Length); - - *Bcb=captive_private_bcb_object_get_PublicBcb(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)); - *Buffer=captive_shared_cache_map_get_buffer(SharedCacheMap)+FileOffset->QuadPart; - r=TRUE; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcPreparePinWrite: r=%d,Bcb=0x%lX,Buffer=0x%lX", - r,(!Bcb ? -1 : (long)*Bcb),(!Buffer ? -1 : (long)*Buffer)); - - return r; -} diff --git a/src/libcaptive/cc/bcbrepin.c b/src/libcaptive/cc/bcbrepin.c deleted file mode 100644 index 6462f79..0000000 --- a/src/libcaptive/cc/bcbrepin.c +++ /dev/null @@ -1,100 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) map/pin Bcb CcRepin*() handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcb.h" -#include "reactos/ddk/status.h" -#include "privatebcbpin.h" - - -/** - * CcRepinBcb: - * @Bcb: #PUBLIB_BCB to be repinned. - * %NULL value is forbidden. - * - * Increases usecount on @Bcb. You must call CcUnpinRepinnedBcb() for such @Bcb - * afterwards before returning from the #IRP handling. - * - * libcaptive does not differentiate between CcUnpinData() and CcUnpinRepinnedBcb(). - * W32 differentiates. - * - * This call does not set the buffer as dirty - such buffer will not be flushed automatically. - * - */ -VOID CcRepinBcb(IN PVOID Bcb) -{ -CaptivePrivateBcbObject *captive_private_bcb_object; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcRepinBcb: Bcb=0x%lX",(long)Bcb); - - g_return_if_fail(Bcb!=NULL); - - captive_private_bcb_object=captive_PublicBcb_to_PrivateBcbObject(Bcb); - - g_object_ref(captive_private_bcb_object); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcRepinBcb"); -} - - -/** - * CcUnpinRepinnedBcb: - * @Bcb: #PUBLIB_BCB to be unpinned from CcRepinBcb(). - * %NULL value is forbidden. - * @WriteThrough: %TRUE if the buffer should be flushed before finishing this function. - * @IoStatus: #PIO_STATUS_BLOCK to return status of this operation. - * %NULL value is forbidden. libcaptive always returns %STATUS_SUCCESS here. - * - * Dereferencing of @Bcb after application of CcRepinBcb(). - * - * This call does not set the buffer as dirty although it will flush the buffers - * already set as dirty. Any flushes will be postponed after return from #IRP - * handling by the filesystem driver if not requested to be synchronous by @WriteThrough. - */ -VOID CcUnpinRepinnedBcb(IN PVOID Bcb,IN BOOLEAN WriteThrough,IN PIO_STATUS_BLOCK IoStatus) -{ -CaptivePrivateBcbObject *captive_private_bcb_object; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcUnpinRepinnedBcb: Bcb=0x%lX,WriteThrough=%d", - (long)Bcb,WriteThrough); - - g_return_if_fail(Bcb!=NULL); - g_return_if_fail(IoStatus!=NULL); - - captive_private_bcb_object=captive_PublicBcb_to_PrivateBcbObject(Bcb); - - IoStatus->Status=STATUS_SUCCESS; - IoStatus->Information=0; - - if (WriteThrough) { /* FIXME: WriteThrough even if we do not do the last unref? */ -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; - - captive_private_bcb_pin_object=CAPTIVE_PRIVATE_BCB_PIN_OBJECT(captive_private_bcb_object); - if (captive_private_bcb_pin_object_is_dirty(captive_private_bcb_pin_object)) { - captive_private_bcb_pin_object_flush(captive_private_bcb_pin_object); - IoStatus->Information=PAGE_SIZE; - } - } - - g_object_unref(captive_private_bcb_object); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcUnpinRepinnedBcb: IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - (!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); -} diff --git a/src/libcaptive/cc/bcbunpin.c b/src/libcaptive/cc/bcbunpin.c deleted file mode 100644 index aaa7e9a..0000000 --- a/src/libcaptive/cc/bcbunpin.c +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) map/pin Bcb CcUnpinData() handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcb.h" - - -/** - * CcUnpinData: - * @Bcb: Initialized #PUBLIC_BCB structure. - * %NULL value is forbidden. - * - * Dereferences @Bcb with the possible cleanup operations if you were the last owner. - * - * This call does not set the buffer as dirty although it will flush the buffers - * already set as dirty. Any flushes will be postponed after return from #IRP - * handling by the filesystem driver. - */ -VOID CcUnpinData(IN PVOID Bcb) -{ -CaptivePrivateBcbObject *captive_private_bcb_object; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcUnpinData: Bcb=0x%lX",(long)Bcb); - - g_return_if_fail(Bcb!=NULL); - - captive_private_bcb_object=captive_PublicBcb_to_PrivateBcbObject(Bcb); - - g_object_unref(captive_private_bcb_object); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcUnpinData"); -} diff --git a/src/libcaptive/cc/cache.c b/src/libcaptive/cc/cache.c deleted file mode 100644 index 8debdc0..0000000 --- a/src/libcaptive/cc/cache.c +++ /dev/null @@ -1,142 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) cache handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbpin.h" -#include "reactos/ddk/status.h" - - -/** - * CcPurgeCacheSection: - * @SectionObjectPointer: Pointer specifying file to purge; - * %NULL value is forbidden. - * libcaptive interprets only #SharedCacheMap field as #PUBLIC_BCB pointer. - * Field #SharedCacheMap value %NULL is permitted; libcaptive does a NOP with %TRUE return code in such case. - * @FileOffset: Starting offset of the ranger to purge. - * %NULL pointer is permitted and it means to purge the whole whole. - * FIXME: Non %NULL pointer is NOT IMPLEMENTED YET by libcaptive. - * @Length: Length of the range to purge. Ignored if @FileOffset==NULL. - * @UninitializeCacheMaps: Purge also private cache maps (FIXME: ???). - * - * Drop any caching for shrunken file which is not being deleted. - * libcaptive will no longer consider such #BCB as dirty. - * - * Undocumented: It is required during %FSCTL_LOCK_VOLUME by ntfs.sys of NT-5.1sp1 - * to return %TRUE value if #SharedCacheMap value is %NULL. - * - * Returns: %TRUE if the range was purged successfuly. - */ -BOOLEAN CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, - IN PLARGE_INTEGER FileOffset OPTIONAL,IN ULONG Length,IN BOOLEAN UninitializeCacheMaps) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcPurgeCacheSection: SectionObjectPointer=0x%lX,->SharedCacheMap=0x%lX,FileOffset=0x%lX,Length=0x%lX," - "UninitializeCacheMaps=%d", - (long)SectionObjectPointer, - (!SectionObjectPointer ? -1 : (long)SectionObjectPointer->SharedCacheMap), - (!FileOffset ? -1 : (long)FileOffset->QuadPart),Length, - UninitializeCacheMaps); - - g_return_val_if_fail(SectionObjectPointer!=NULL,FALSE); - g_return_val_if_fail(FileOffset==NULL,FALSE); /* NOT IMPLEMENTED YET */ - g_return_val_if_fail(UninitializeCacheMaps==0,FALSE); /* NOT IMPLEMENTED YET */ - - if (SectionObjectPointer->SharedCacheMap) { - SharedCacheMap=captive_SectionObjectPointers_to_SharedCacheMap(SectionObjectPointer); - captive_shared_cache_map_purge(SharedCacheMap); - } - - r=TRUE; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcPurgeCacheSection: r=%d",r); - - return r; -} - - -/** - * CcFlushCache: - * @SectionObjectPointer: Pointer specifying file to flush; - * %NULL value is forbidden. - * libcaptive interprets only #SharedCacheMap field as #PUBLIC_BCB pointer. - * Field #SharedCacheMap value %NULL is permitted; libcaptive does a NOP in such case. - * @FileOffset: Optional starting point of the range to flush. - * %NULL value is permitted. - * @Length: Length of the range to flush. Ignored if @FileOffset is %NULL. - * @IoStatus: Optionally returns the resulting operation status. - * #Information field will contain the number of bytes flushed. - * %NULL value is permitted. - * - * Flushes out any pending dirty data in cache manager BCB mapping. - * FIXME: libcaptive currently always flushes the full file ignoring any @FileOffset or @Length. - * - * VERIFIED: Ranged flushes. - * VERIFIED: Synchronous write. - */ -VOID CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, - IN PLARGE_INTEGER FileOffset OPTIONAL,IN ULONG Length,OUT PIO_STATUS_BLOCK IoStatus OPTIONAL) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -guint64 flushed; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcFlushCache: SectionObjectPointer=0x%lX,->SharedCacheMap=0x%lX,FileOffset=0x%lX,Length=0x%lX", - (long)SectionObjectPointer, - (!SectionObjectPointer ? -1 : (long)SectionObjectPointer->SharedCacheMap), - (!FileOffset ? -1 : (long)FileOffset->QuadPart),Length); - - g_return_if_fail(SectionObjectPointer!=NULL); - - if (SectionObjectPointer->SharedCacheMap) { - SharedCacheMap=captive_SectionObjectPointers_to_SharedCacheMap(SectionObjectPointer); - - if (FileOffset) - flushed=captive_shared_cache_map_flush(SharedCacheMap,FileOffset->QuadPart,FileOffset->QuadPart+Length); - else - flushed=captive_shared_cache_map_flush(SharedCacheMap,0,G_MAXUINT64-1); /* '-1' for overflow safety */ - } - else - flushed=0; - - if (IoStatus) { - IoStatus->Status=STATUS_SUCCESS; - IoStatus->Information=flushed; - } - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcFlushCache: IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - (!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); -} - - -BOOLEAN CcIsThereDirtyData(IN PVPB Vpb) -{ -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcIsThereDirtyData: Vpb=0x%lX",(long)Vpb); - - g_return_val_if_fail(Vpb!=NULL,FALSE); /* We have just one volume mounted anyway. */ - - r=captive_shared_cache_map_is_any_dirty(); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcIsThereDirtyData: r=%d",r); - - return r; -} diff --git a/src/libcaptive/cc/copy.c b/src/libcaptive/cc/copy.c deleted file mode 100644 index 4d0a46d..0000000 --- a/src/libcaptive/cc/copy.c +++ /dev/null @@ -1,191 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) CcCopy*() handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbpin.h" -#include "reactos/ddk/status.h" -#include "captive/macros.h" - - -/** - * CcCopyRead: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @FileOffset: The @FileObject file offset from where to map the region from. - * Negative value is forbidden. - * @Length: Requested length of the region to map from @FileObject. - * Value %0 is permitted (no effect of this function call). - * @Wait: Whether disk waiting is permitted for this function. - * Value %FALSE is currently forbidden by libcaptive as we have no on-demand loading implemented. - * @Buffer: Address of memory region with already allocated memory of size @Length. - * This address may not be %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * @IoStatus: #PIO_STATUS_BLOCK to return status of this operation. - * %NULL pointer is forbidden. - * - * Reads the specified region of @FileObject to the given @Buffer. - * No on-demand loading is in effect. - * - * Returns: %TRUE if the region was successfuly filled with @Length bytes. - * @IoStatus.Status initialized by %STATUS_SUCCESS if successful. - * @IoStatus.Information initialized by @Length if successful. - */ -BOOLEAN CcCopyRead(IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset,IN ULONG Length,IN BOOLEAN Wait,OUT PVOID Buffer,OUT PIO_STATUS_BLOCK IoStatus) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcCopyRead: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Wait=%d,Buffer=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Wait,(long)Buffer); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - g_return_val_if_fail(FileOffset!=NULL,FALSE); - g_return_val_if_fail(Wait==TRUE,FALSE); - g_return_val_if_fail(Buffer!=NULL,FALSE); - g_return_val_if_fail(IoStatus!=NULL,FALSE); - - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - - captive_shared_cache_map_data_validate_read(SharedCacheMap,FileObject,FileOffset->QuadPart,FileOffset->QuadPart+Length); - memcpy(Buffer,captive_shared_cache_map_get_buffer(SharedCacheMap)+FileOffset->QuadPart,Length); - - IoStatus->Status=STATUS_SUCCESS; - IoStatus->Information=Length; - r=TRUE; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcCopyRead: r=%d,IoStatus->Status=0x%lX,IoStatus->Information=0x%lX", - r,(!IoStatus ? -1 : (long)IoStatus->Status),(!IoStatus ? -1 : (long)IoStatus->Information)); - - return r; -} - - -/** - * CcCopyWrite: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @FileOffset: The @FileObject file offset from where to map the region from. - * Negative value is forbidden. - * @Length: Requested length of the region to map from @FileObject. - * Value %0 is permitted (no effect of this function call). - * @Wait: Whether disk waiting is permitted for this function. - * Value %FALSE is currently forbidden by libcaptive as we have no on-demand loading implemented. - * @Buffer: Address of memory region with already allocated memory of size @Length. - * This address may not be %PAGE_SIZE aligned. - * %NULL pointer is forbidden. - * - * Writes the specified region of the given @Buffer to @FileObject. - * - * Returns: %TRUE if the region was successfuly written with @Length bytes. - */ -BOOLEAN CcCopyWrite(IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER FileOffset,IN ULONG Length,IN BOOLEAN Wait,IN PVOID Buffer) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcCopyWrite: FileObject=0x%lX,FileOffset=0x%lX,Length=0x%lX,Wait=%d,Buffer=0x%lX", - (long)FileObject,(!FileOffset ? -1 : (long)FileOffset->QuadPart),Length,Wait,(long)Buffer); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - g_return_val_if_fail(FileOffset!=NULL,FALSE); - g_return_val_if_fail(Wait==TRUE,FALSE); - g_return_val_if_fail(Buffer!=NULL,FALSE); - - /* 'FileOffset' may not be PAGE_SIZE aligned */ - /* 'Length' may not be PAGE_SIZE aligned */ - - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - - captive_shared_cache_map_set_data_valid(SharedCacheMap,FileOffset->QuadPart,FileOffset->QuadPart+Length); - captive_shared_cache_map_data_validate_read(SharedCacheMap,FileObject,FileOffset->QuadPart,FileOffset->QuadPart+Length); - memcpy(captive_shared_cache_map_get_buffer(SharedCacheMap)+FileOffset->QuadPart,Buffer,Length); - captive_shared_cache_map_set_dirty(SharedCacheMap,FileOffset->QuadPart,FileOffset->QuadPart+Length); - r=TRUE; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcCopyWrite: r=%d",r); - - return r; -} - - -BOOLEAN CcZeroData(IN PFILE_OBJECT FileObject,IN PLARGE_INTEGER StartOffset,IN PLARGE_INTEGER EndOffset,IN BOOLEAN Wait) -{ -CaptiveSharedCacheMapObject *SharedCacheMap,*SharedCacheMap_orig; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcZeroData: FileObject=0x%lX,StartOffset=0x%lX,EndOffset=0x%lX,Wait=%d", - (long)FileObject, - (!StartOffset ? -1 : (long)StartOffset->QuadPart), - (!EndOffset ? -1 : (long)EndOffset->QuadPart), - Wait); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - g_return_val_if_fail(StartOffset!=NULL,FALSE); - g_return_val_if_fail(EndOffset!=NULL,FALSE); - g_return_val_if_fail(StartOffset->QuadPart<=EndOffset->QuadPart,FALSE); - g_return_val_if_fail((EndOffset->QuadPart-StartOffset->QuadPart) - ==(size_t)(EndOffset->QuadPart-StartOffset->QuadPart),FALSE); - /* 'Wait' may be FALSE; used by ext2fsd.sys-v0.10a. */ - - /* 'StartOffset' may not be PAGE_SIZE aligned */ - /* 'EndOffset' may not be PAGE_SIZE aligned */ - - g_assert(FileObject->SectionObjectPointer); - if ((SharedCacheMap_orig=FileObject->SectionObjectPointer->SharedCacheMap)) - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - else { -CC_FILE_SIZES FileSizes; -static const CACHE_MANAGER_CALLBACKS CallBacks; - - /* ext2fsd.sys-v0.10a calls us on non-SharedCacheMapped object: */ - FileSizes.AllocationSize=*EndOffset; - FileSizes.FileSize=*EndOffset; - FileSizes.ValidDataLength=*EndOffset; - SharedCacheMap=captive_shared_cache_map_get_ref( - FileObject, /* FileObject */ - &FileSizes, /* FileSizes */ - FALSE, /* PinAccess */ - &CallBacks, /* CallBacks */ - NULL); /* LazyWriterContext */ - } - - captive_shared_cache_map_set_data_valid(SharedCacheMap,StartOffset->QuadPart,EndOffset->QuadPart); - if (Wait) - captive_shared_cache_map_data_validate_read(SharedCacheMap,FileObject,StartOffset->QuadPart,EndOffset->QuadPart); - else { - captive_shared_cache_map_data_validate_noread(SharedCacheMap,StartOffset->QuadPart,EndOffset->QuadPart); - } - memset(captive_shared_cache_map_get_buffer(SharedCacheMap)+StartOffset->QuadPart,0,EndOffset->QuadPart-StartOffset->QuadPart); - captive_shared_cache_map_set_dirty(SharedCacheMap,StartOffset->QuadPart,EndOffset->QuadPart); - r=TRUE; - - if (!SharedCacheMap_orig) { - captive_shared_cache_map_flush(SharedCacheMap,StartOffset->QuadPart,EndOffset->QuadPart); - g_object_unref(SharedCacheMap); - /* FIXME: Undo captive_shared_cache_map_get_ref:'Currently we never close it.' */ - g_object_unref(SharedCacheMap); - } - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcZeroData: r=%d",r); - - return r; -} diff --git a/src/libcaptive/cc/dirtypages.c b/src/libcaptive/cc/dirtypages.c deleted file mode 100644 index c9f5b1d..0000000 --- a/src/libcaptive/cc/dirtypages.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) cache handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbpin.h" - - -/** - * CcGetDirtyPages: - * @LogHandle: Arbitrary pointer to match with value passed to CcSetLogHandleForFile(). - * %NULL value is permitted (considered as regular matching value by libcaptive). - * @DirtyPageRoutine: #PDIRTY_PAGE_ROUTINE type to call on each dirty page(s). - * %NULL value is forbidden. - * @Context1: User data to pass to @DirtyPageRoutine. - * %NULL value is permitted. - * @Context2: User data to pass to @DirtyPageRoutine. - * - * Searches through the list of dirty #PUBLIC_BCB s of files assigned to @LogHandle - * by CcSetLogHandleForFile(). Any clean #PUBLIC_BCB s are ignored - * by this function. Function will scan through all #PUBLIC_BCB mapping of each such page - * and it will detect its oldest and newest LSN (Logical Sequence Number). Unset - * LSN is considered as value 0. Value 0 is returned only if no other LSN is valid - * for such case, otherwise such void value 0 is ignored (and oldest and newest LSN - * returned are being equal in the case only single LSN was found). - * - * Found pages are coalesced as much as possible during calls of @DirtyPageRoutine. - * Coalescable ranges must have the same detected both oldest and newest LSNs. - * - * Returns: Oldest LSN across all the #FileObject s found for the given @LogHandle. - * Function returns value %0 if no appropriate LSN was found. - * libcaptive must return #gint64 instead of the official #LARGE_INTEGER - * as W32 expects it as value in EAX:EDX but GCC returns the structure address in EAX. - * - * VERIFIED: func called in runs for each FileObject, FileOffset sorted desc. - */ -gint64 /* instead of LARGE_INTEGER */ CcGetDirtyPages(IN PVOID LogHandle, - IN PDIRTY_PAGE_ROUTINE DirtyPageRoutine,IN PVOID Context1,IN PVOID Context2) -{ -gint64 r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcGetDirtyPages: LogHandle=0x%lX,DirtyPageRoutine=0x%lX,Context1=0x%lX,Context2=0x%lX", - (long)LogHandle,(long)DirtyPageRoutine,(long)Context1,(long)Context2); - - /* 'LogHandle' may be NULL */ - g_return_val_if_fail(DirtyPageRoutine!=NULL,0); - - /* W32 undocumented: What does mean LogHandle==NULL? - * It is expected to clear the 'LogHandle' settings. - * Otherwise it would cause multiple active 'LogHandle's for some NT4 NTFS drives - * as reported by Nerijus Baliunas in: <20040106005157.7E5C060BE@mx.ktv.lt> - */ - - captive_shared_cache_map_set_LogHandle(NULL,LogHandle); - - r=captive_shared_cache_map_CcGetDirtyPages(DirtyPageRoutine,Context1,Context2); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcGetDirtyPages: r=0x%lX",(long)r); - - return r; -} diff --git a/src/libcaptive/cc/init.c b/src/libcaptive/cc/init.c deleted file mode 100644 index 9352971..0000000 --- a/src/libcaptive/cc/init.c +++ /dev/null @@ -1,167 +0,0 @@ -/* $Id$ - * reactos Cache Manager initialization functions of libcaptive - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include "reactos/ntos/types.h" -#include "reactos/ddk/iotypes.h" -#include "reactos/ddk/cctypes.h" -#include "sharedcachemap.h" -#include "reactos/ddk/kefuncs.h" - - -/** - * CcInitializeCacheMap: - * @FileObject: Existing file to set callbacks for. Ignored by libcaptive. - * %NULL value is forbidden. - * @FileSizes: Some file sizes suggestions. Ignored by libcaptive. - * %NULL value is forbidden. - * @PinAccess: CcPin*() functions will be used with @FileObject? Ignored by libcaptive. - * @CallBacks: Provided callback functions for readahead/writebehind. Ignored by libcaptive. - * %NULL value is forbidden. - * @LazyWriterContext: Value passed to functions of @CallBacks to bind with @FileObject. - * %NULL value is permitted. - * - * Provides support of readahead/writebehind in W32. Function should be called - * by W32 filesystem to offer its functions to W32 kernel. These functions - * are never called by libcaptive, this call is a NOP in libcaptive. - * - * VERIFIED: Double CcInitializeCacheMap() without CcUninitializeCacheMap(). - */ -VOID CcInitializeCacheMap(IN PFILE_OBJECT FileObject, - IN PCC_FILE_SIZES FileSizes,IN BOOLEAN PinAccess,IN PCACHE_MANAGER_CALLBACKS CallBacks,IN PVOID LazyWriterContext) -{ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcInitializeCacheMap: FileObject=0x%lX," - "FileSizes,->AllocationSize=0x%lX,->FileSize=0x%lX,->ValidDataLength=0x%lX," - "PinAccess=%d,Callbacks,LazyWriteContext", - (long)FileObject, - (!FileSizes ? -1 : (long)FileSizes->AllocationSize.QuadPart), - (!FileSizes ? -1 : (long)FileSizes->FileSize.QuadPart), - (!FileSizes ? -1 : (long)FileSizes->ValidDataLength.QuadPart), - PinAccess); - - g_return_if_fail(FileObject!=NULL); - g_return_if_fail(FileSizes!=NULL); - g_return_if_fail(CallBacks!=NULL); - - /* VERIFIED: CcInitializeCacheMap() has already 'SectionObjectPointers' allocated. */ - g_return_if_fail(FileObject->SectionObjectPointer!=NULL); - - captive_shared_cache_map_get_ref(FileObject,FileSizes,PinAccess,CallBacks,LazyWriterContext); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcInitializeCacheMap"); -} - - -/** - * CcUninitializeCacheMap: - * @FileObject: File to close caching for. - * %NULL value is forbidden. - * @TruncateSize: Current file size if @FileObject was truncated to it in the meantime. - * @UninitializeCompleteEvent: Optional event to signal after physical write to disk. - * %NULL value is permitted. - * - * Close the cachine facilities from CcInitializeCacheMap(). - * It is valid to pass @FileObject without being registered by CcInitializeCacheMap(). - * - * FIXME; What to do with files with dirty blocks? Currently we fail assertion on them - * although I think W32 would drop such buffers (purge them - not flush them). - * - * Returns: %TRUE if the caching was closed successfuly. - * %FALSE if @FileObject was not registered by CcInitializeCacheMap() - * or if its #SharedCacheMap is still in use (such as by other #FileObject reference of - * the same #FCB instance). - */ -BOOLEAN CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, - IN PLARGE_INTEGER TruncateSize OPTIONAL,IN PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent OPTIONAL) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcUninitializeCacheMap: FileObject=0x%lX,TruncateSize=0x%lX,UninitializeCompleteEvent=0x%lX", - (long)FileObject,(!TruncateSize ? -1 : (long)TruncateSize->QuadPart),(long)UninitializeCompleteEvent); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - /* assert current size ==*TruncateSize if TruncateSize */ - - if (FileObject->SectionObjectPointer && !FileObject->SectionObjectPointer->SharedCacheMap) - r=FALSE; - else { - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - - /* We may be called without preceding CcInitializeCacheMap(). */ - if (!captive_shared_cache_map_query_w32_ref(SharedCacheMap)) - r=FALSE; - else { - captive_shared_cache_map_w32_unref(SharedCacheMap); - r=(FileObject->SectionObjectPointer->SharedCacheMap==NULL); - } - - /* FIXME: should we do KePulseEvent? Are we allowed to signal from inside CcUninitializeCacheMap() ? */ - if (UninitializeCompleteEvent) - KeSetEvent( - &UninitializeCompleteEvent->Event, /* Event */ - IO_NO_INCREMENT, /* Increment */ - FALSE); /* Wait */ - } - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcUninitializeCacheMap: r=%d",r); - - return r; -} - - -/** - * CcSetFileSizes: - * @FileObject: Initialized open #FileObject to update file sizes of. - * %NULL value is forbidden. - * @FileSizes: New file sizes to update cache to. - * %NULL value is forbidden. - * - * Update cache properties after file sizes were updated. - * Probably only the exceeding pages need to be unmapped and BCBs updated - * if FileSizes->AllocationSize gets shrunk. - * - * #AllocationSize must not change if any map or pin Bcbs exist. - */ -VOID CcSetFileSizes(IN PFILE_OBJECT FileObject,IN PCC_FILE_SIZES FileSizes) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcSetFileSizes: FileObject=0x%lX," - "FileSizes,->AllocationSize=0x%lX,->FileSize=0x%lX,->ValidDataLength=0x%lX", - (long)FileObject, - (!FileSizes ? -1 : (long)FileSizes->AllocationSize.QuadPart), - (!FileSizes ? -1 : (long)FileSizes->FileSize.QuadPart), - (!FileSizes ? -1 : (long)FileSizes->ValidDataLength.QuadPart)); - - g_return_if_fail(FileObject!=NULL); - g_return_if_fail(FileSizes!=NULL); - - /* Needed by ext2fsd.sys-v0.10a: */ - if (1 - && FileObject->SectionObjectPointer - && FileObject->SectionObjectPointer->SharedCacheMap) { - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - captive_shared_cache_map_FileSizes_set(SharedCacheMap,FileSizes); - } - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcSetFileSizes"); -} diff --git a/src/libcaptive/cc/io.c b/src/libcaptive/cc/io.c deleted file mode 100644 index a3fd996..0000000 --- a/src/libcaptive/cc/io.c +++ /dev/null @@ -1,102 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) I/O W32 interface of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "io.h" /* self */ -#include -#include "reactos/ddk/mmfuncs.h" -#include "reactos/ddk/kefuncs.h" -#include "reactos/ddk/iofuncs.h" - - -ULONG captive_Cc_IoPageRead(FILE_OBJECT *FileObject,gpointer address,ULONG length,LARGE_INTEGER *FileOffset) -{ -MDL *Mdl; -KEVENT Event; -IO_STATUS_BLOCK IoStatus; -NTSTATUS err; - - g_return_val_if_fail(FileObject!=NULL,0); - g_return_val_if_fail(address!=0,0); - g_return_val_if_fail(length!=0,0); - g_return_val_if_fail(FileOffset!=NULL,0); - - /* VolumeRead on ext2fsd.sys will return IoStatus.Information==0 although it - * successfuly read the data. Workaround it - preclear (not postclear) the - * buffer and do not make any other assumptions about the data read. - */ - memset(address,0,length); /* pre-clear the buffer */ - Mdl=MmCreateMdl(NULL,address,length); /* FIXME: Deprecated in favor of IoAllocateMdl() */ - g_assert(Mdl!=NULL); - MmBuildMdlForNonPagedPool(Mdl); - KeInitializeEvent(&Event,NotificationEvent,FALSE); - IoStatus.Information=0; /* preventive pre-clear for buggy filesystems */ - err=IoPageRead(FileObject,Mdl,FileOffset,&Event,&IoStatus); - g_assert(NT_SUCCESS(err)); - g_assert(NT_SUCCESS(IoStatus.Status)); - /* It is not == as the file may be shorter than requested */ - g_assert(IoStatus.Information<=length); - IoFreeMdl(Mdl); - - /* Forbidden, see the comment above about ext2fsd.sys. - * memset(((char *)address)+IoStatus.Information,0,(length-IoStatus.Information)); - */ - - return IoStatus.Information; /* may be shorter than real! */ -} - - -void captive_Cc_IoPageWrite(FILE_OBJECT *FileObject,gpointer address,ULONG length,LARGE_INTEGER *FileOffset) -{ -MDL *Mdl; -KEVENT Event; -IO_STATUS_BLOCK IoStatus; -NTSTATUS err; - - /* We can get 0=='FileObject->DeviceObject->SectorSize' during mount of ext2fsd.sys. - * We are unable to find the correct sectorsize for a filesystem as - * even the 'CommonFcb' below contains invalid information. - * As we need to have sectorsize <=filesystem_blocksize at least for ext2fsd.sys - * we choose PAGE_SIZE - the maximum libcaptive can with its design and also the maximum - * size ever needed for ext2fsd.sys (PAGE_SIZE is the maximum ext2 block size). - */ - - Mdl=MmCreateMdl(NULL,address,length); - g_assert(Mdl!=NULL); - MmBuildMdlForNonPagedPool(Mdl); - - KeInitializeEvent(&Event,NotificationEvent,FALSE); - - /* Use rather IoSynchronousPageWrite() than IoPageWrite() to prevent STATUS_PENDING. */ - err=IoSynchronousPageWrite(FileObject,Mdl,FileOffset,&Event,&IoStatus); - g_assert(NT_SUCCESS(err)); - g_assert(NT_SUCCESS(IoStatus.Status)); - - /* Also we can get just value 0 if the write is considered 'not dirty' - * during FAT write by fastfat.sys. - * We can also get just value 8 during write of PAGE_SIZE aligned block - * of MappedLength 512 during flush of LSNed buffer on captive_leave(), - * probably no assumptions can be made about the returned value at all. - */ -#if 0 - g_assert(IoStatus.Information==0 || IoStatus.Information>=CAPTIVE_ROUND_DOWN_EXCEEDING(address,PAGE_SIZE)+length); -#endif - g_assert(IoStatus.Information<=length); -} diff --git a/src/libcaptive/cc/io.h b/src/libcaptive/cc/io.h deleted file mode 100644 index 8a46edd..0000000 --- a/src/libcaptive/cc/io.h +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ - * Include file for reactos Cache Manager (Cc*) I/O W32 interface of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CC_IO_H -#define _CAPTIVE_CC_IO_H 1 - - -#include -#include "reactos/ntos/types.h" -#include "reactos/ddk/iotypes.h" - - -G_BEGIN_DECLS - -ULONG captive_Cc_IoPageRead(FILE_OBJECT *FileObject,gpointer address,ULONG length,LARGE_INTEGER *FileOffset); -void captive_Cc_IoPageWrite(FILE_OBJECT *FileObject,gpointer address,ULONG length,LARGE_INTEGER *FileOffset); - -G_END_DECLS - - -#endif /* _CAPTIVE_CC_IO_H */ diff --git a/src/libcaptive/cc/loghandle.c b/src/libcaptive/cc/loghandle.c deleted file mode 100644 index dd2280f..0000000 --- a/src/libcaptive/cc/loghandle.c +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) LogHandle handling of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbpin.h" - - -/** - * CcSetLogHandleForFile: - * - * VERIFIED: LogHandle may be NULL, FlushToLsnRoutine is never called with LogHandle==NULL. - * VERIFIED: Only one !=NULL LogHandle and one FlushToLsnRoutine used in one session. - */ -VOID CcSetLogHandleForFile(IN PFILE_OBJECT FileObject,IN PVOID LogHandle,IN PFLUSH_TO_LSN FlushToLsnRoutine) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcSetLogHandleForFile: FileObject=0x%lX,LogHandle=0x%lX,FlushToLsnRoutine=0x%lX", - (long)FileObject,(long)LogHandle,(long)FlushToLsnRoutine); - - g_return_if_fail(FileObject!=NULL); - /* 'LogHandle' may be NULL */ - g_return_if_fail(FlushToLsnRoutine!=NULL); - - SharedCacheMap=captive_FileObject_to_SharedCacheMap(FileObject); - - captive_shared_cache_map_set_LogHandle(SharedCacheMap,LogHandle); - captive_shared_cache_map_set_FlushToLsnRoutine(SharedCacheMap,FlushToLsnRoutine); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcSetLogHandleForFile"); -} diff --git a/src/libcaptive/cc/marshallers.list b/src/libcaptive/cc/marshallers.list deleted file mode 100644 index a9aadd0..0000000 --- a/src/libcaptive/cc/marshallers.list +++ /dev/null @@ -1,20 +0,0 @@ -# $Id$ -# Mashallers for GObject based Cache Manager mapper emulation of libcaptive -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -VOID:UINT64,UINT64,UINT64 -VOID:VOID diff --git a/src/libcaptive/cc/misc.c b/src/libcaptive/cc/misc.c deleted file mode 100644 index 2800020..0000000 --- a/src/libcaptive/cc/misc.c +++ /dev/null @@ -1,134 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) misc of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include "reactos/ddk/status.h" -#include "reactos/ddk/iotypes.h" -#include "sharedcachemap.h" - - -/** - * CcCanIWrite: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @BytesToWrite: Amount of data to be asked whether it will be accepted. - * Value %0 is permitted. - * @Wait: Whether disk waiting would be permitted during the forthcoming write call. - * @Retrying: Use %TRUE iff calling this function for the second and further times for one request. - * - * Asks cache manager if it would currently accept write request to @FileObject - * of @BytesToWrite bytes with @Wait condition. - * libcaptive will always accept any writes. This function is a NOP. - * - * Returns: libcaptive always returns %TRUE. - */ -BOOLEAN CcCanIWrite(IN PFILE_OBJECT FileObject,IN ULONG BytesToWrite,IN BOOLEAN Wait,IN BOOLEAN Retrying) -{ -BOOLEAN r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcCanIWrite: FileObject=0x%lX,BytesToWrite=0x%lX,Wait=%d,Retrying=%d", - (long)FileObject,BytesToWrite,Wait,Retrying); - - g_return_val_if_fail(FileObject!=NULL,FALSE); - g_return_val_if_fail(Wait==TRUE || Wait==FALSE,FALSE); /* Prevent 'Wait' upgrade to 'Flags'. */ - g_return_val_if_fail(Retrying==TRUE || Retrying==FALSE,FALSE); - - /* sanity check */ - g_assert(FileObject->SectionObjectPointer!=NULL); - /* 'FileObject->SectionObjectPointer->SharedCacheMap' may be NULL */ - - r=TRUE; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcCanIWrite: r=%d",r); - - return r; -} - - -/** - * CcSetReadAheadGranularity: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @Granularity: Suggested size of the cache element. - * Value must be larger or requal to %PAGE_SIZE and it must be even power of two. - * - * libcaptive does not implement any caching and therefore this function - * is a NOP there. - */ -VOID CcSetReadAheadGranularity(IN PFILE_OBJECT FileObject,IN ULONG Granularity) -{ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcSetReadAheadGranularity: FileObject=0x%lX,Granularity=0x%lX", - (long)FileObject,Granularity); - - g_return_if_fail(FileObject!=NULL); - g_return_if_fail(Granularity>=PAGE_SIZE); - g_return_if_fail((Granularity&(Granularity-1))==0); /* Power of two */ - - /* NOP; no caching by libcaptive */ - - /* sanity check */ - captive_FileObject_to_SharedCacheMap(FileObject); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcSetReadAheadGranularity"); -} - - -/** - * CcSetAdditionalCacheAttributes: - * @FileObject: Initialized open #FileObject to map. - * %NULL value is forbidden. - * @DisableReadAhead: Read-ahead should not be done by Cache Manager. - * @DisableWriteBehind: Write-behind should not be done by Cache Manager. - * - * libcaptive does not implement any caching and therefore this function - * is a NOP there. - */ -VOID CcSetAdditionalCacheAttributes(IN PFILE_OBJECT FileObject,IN BOOLEAN DisableReadAhead,IN BOOLEAN DisableWriteBehind) -{ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcSetAdditionalCacheAttributes: FileObject=0x%lX,DisableReadAhead=%d,DisableWriteBehind=%d", - (long)FileObject,DisableReadAhead,DisableWriteBehind); - - g_return_if_fail(FileObject!=NULL); - - /* NOP; no caching by libcaptive */ - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcSetAdditionalCacheAttributes"); -} - - -VOID FsRtlIncrementCcFastReadNoWait(VOID) -{ - /* FIXME: {{%fs:[0]}+0x4E0}:LONG++ */ -} - - -NTSTATUS CcWaitForCurrentLazyWriterActivity(VOID) -{ -NTSTATUS r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"enter: CcWaitForCurrentLazyWriterActivity"); - - r=STATUS_SUCCESS; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"leave: CcWaitForCurrentLazyWriterActivity: r=0x%lX",(long)r); - - return r; -} diff --git a/src/libcaptive/cc/mm.c b/src/libcaptive/cc/mm.c deleted file mode 100644 index c73a2e1..0000000 --- a/src/libcaptive/cc/mm.c +++ /dev/null @@ -1,45 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) memory management interaction of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/mmfuncs.h" /* self */ -#include "sharedcachemap.h" - - -/** - * MmSetAddressRangeModified: - * @Address: Start of the memory block. - * %NULL value is forbidden. - * FIXME: Must be the value %PAGE_SIZE aligned? libcaptive does not require it now. - * @Length: Length of the memory block. - * Value may not be %PAGE_SIZE aligned. - * - * Set the specified memory range as modified. - * - * Returns: %TRUE if any pages in the range were set as modified. - * FIXME: libcaptive currently returns %TRUE even if they were already set as modified. - * Is it W32 compliant? - */ -BOOLEAN MmSetAddressRangeModified(IN PVOID Address,IN SIZE_T Length) -{ - g_return_val_if_fail(Address!=NULL,FALSE); - - return !!captive_shared_cache_map_memory_range_set_dirty(Address,Address+Length); -} diff --git a/src/libcaptive/cc/privatebcb-priv.h b/src/libcaptive/cc/privatebcb-priv.h deleted file mode 100644 index e01d0c2..0000000 --- a/src/libcaptive/cc/privatebcb-priv.h +++ /dev/null @@ -1,45 +0,0 @@ -/* $Id$ - * Object-private include file for reactos Cache Manager (Cc*) PrivateBcb structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CC_PRIVATE_BCB_PRIV_H -#define _CAPTIVE_CC_PRIVATE_BCB_PRIV_H 1 - - -#include -#include -#include "sharedcachemap.h" -#include "reactos/ddk/cctypes.h" - - -G_BEGIN_DECLS - -struct _CaptivePrivateBcbObject { - GObject parent_instance; - - CaptiveSharedCacheMapObject *SharedCacheMap; - PUBLIC_BCB *PublicBcb; /* content is not used by W32 code anyway */ - }; -struct _CaptivePrivateBcbObjectClass { - GObjectClass parent_class; - }; - -G_END_DECLS - - -#endif /* _CAPTIVE_CC_PRIVATE_BCB_PRIV_H */ diff --git a/src/libcaptive/cc/privatebcb.c b/src/libcaptive/cc/privatebcb.c deleted file mode 100644 index b27cb51..0000000 --- a/src/libcaptive/cc/privatebcb.c +++ /dev/null @@ -1,150 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) PrivateBcb structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcb.h" /* self */ -#include "privatebcb-priv.h" /* self */ -#include -#include "captive/macros.h" -#include - - -/* CONFIG: */ - -#define CAPTIVE_PUBLIC_BCB_NODETYPECODE 0xDE45 /* FIXME: W32 undocumented */ - - -static GHashTable *CaptivePrivateBcbObject_hash; - -static void CaptivePrivateBcbObject_hash_init(void) -{ - if (CaptivePrivateBcbObject_hash) - return; - CaptivePrivateBcbObject_hash=g_hash_table_new( - g_direct_hash, /* hash_func */ - g_direct_equal); /* key_equal_func */ -} - -static gpointer captive_private_bcb_object_parent_class=NULL; - - -static void captive_private_bcb_object_finalize(CaptivePrivateBcbObject *captive_private_bcb_object) -{ - g_return_if_fail(captive_private_bcb_object!=NULL); - - if (captive_private_bcb_object->SharedCacheMap) { - g_object_unref(captive_private_bcb_object->SharedCacheMap); - captive_private_bcb_object->SharedCacheMap=NULL; - } - if (captive_private_bcb_object->PublicBcb) { - g_free(captive_private_bcb_object->PublicBcb); - captive_private_bcb_object->PublicBcb=NULL; - } - - G_OBJECT_CLASS(captive_private_bcb_object_parent_class)->finalize((GObject *)captive_private_bcb_object); -} - - -static void captive_private_bcb_object_class_init(CaptivePrivateBcbObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); - - captive_private_bcb_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_private_bcb_object_finalize; -} - - -static void captive_private_bcb_object_init(CaptivePrivateBcbObject *captive_private_bcb_object) -{ -PUBLIC_BCB *PublicBcb; - - captive_new(PublicBcb); - PublicBcb->NodeTypeCode=CAPTIVE_PUBLIC_BCB_NODETYPECODE; - PublicBcb->NodeByteSize=sizeof(*PublicBcb); /* we have no extensions there */ - PublicBcb->MappedLength=0; - PublicBcb->MappedFileOffset.QuadPart=0; - captive_private_bcb_object->PublicBcb=PublicBcb; - CaptivePrivateBcbObject_hash_init(); - g_hash_table_insert(CaptivePrivateBcbObject_hash,PublicBcb,captive_private_bcb_object); -} - - -GType captive_private_bcb_object_get_type(void) -{ -static GType captive_private_bcb_object_type=0; - - if (!captive_private_bcb_object_type) { -static const GTypeInfo captive_private_bcb_object_info={ - sizeof(CaptivePrivateBcbObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_private_bcb_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptivePrivateBcbObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_private_bcb_object_init, - }; - - captive_private_bcb_object_type=g_type_register_static(G_TYPE_OBJECT, - "CaptivePrivateBcbObject",&captive_private_bcb_object_info,G_TYPE_FLAG_ABSTRACT); - } - - return captive_private_bcb_object_type; -} - -void _captive_private_bcb_object_connect_SharedCacheMap - (CaptivePrivateBcbObject *captive_private_bcb_object,CaptiveSharedCacheMapObject *SharedCacheMap) -{ - g_return_if_fail(CAPTIVE_PRIVATE_BCB_IS_OBJECT(captive_private_bcb_object)); - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(SharedCacheMap)); - g_return_if_fail(captive_private_bcb_object->SharedCacheMap==NULL); - - g_object_ref(SharedCacheMap); - captive_private_bcb_object->SharedCacheMap=SharedCacheMap; -} - -PUBLIC_BCB *captive_private_bcb_object_get_PublicBcb(CaptivePrivateBcbObject *captive_private_bcb_object) -{ - g_return_val_if_fail(CAPTIVE_PRIVATE_BCB_IS_OBJECT(captive_private_bcb_object),NULL); - - return captive_private_bcb_object->PublicBcb; -} - -CaptiveSharedCacheMapObject *captive_private_bcb_object_get_SharedCacheMap(CaptivePrivateBcbObject *captive_private_bcb_object) -{ - g_return_val_if_fail(CAPTIVE_PRIVATE_BCB_IS_OBJECT(captive_private_bcb_object),NULL); - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_private_bcb_object->SharedCacheMap),NULL); - - return captive_private_bcb_object->SharedCacheMap; -} - -CaptivePrivateBcbObject *captive_PublicBcb_to_PrivateBcbObject(const PUBLIC_BCB *PublicBcb) -{ -CaptivePrivateBcbObject *captive_private_bcb_object; - - g_return_val_if_fail(PublicBcb!=NULL,NULL); - - CaptivePrivateBcbObject_hash_init(); - captive_private_bcb_object=g_hash_table_lookup(CaptivePrivateBcbObject_hash,PublicBcb); - g_return_val_if_fail(CAPTIVE_PRIVATE_BCB_IS_OBJECT(captive_private_bcb_object),NULL); - - return captive_private_bcb_object; -} diff --git a/src/libcaptive/cc/privatebcb.h b/src/libcaptive/cc/privatebcb.h deleted file mode 100644 index f7e2a35..0000000 --- a/src/libcaptive/cc/privatebcb.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $Id$ - * Include file for reactos Cache Manager (Cc*) PrivateBcb structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CC_PRIVATE_BCB_H -#define _CAPTIVE_CC_PRIVATE_BCB_H 1 - - -#include -#include -#include "sharedcachemap.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_PRIVATE_BCB_TYPE_OBJECT (captive_private_bcb_object_get_type()) -#define CAPTIVE_PRIVATE_BCB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_PRIVATE_BCB_TYPE_OBJECT,CaptivePrivateBcbObject)) -#define CAPTIVE_PRIVATE_BCB_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_PRIVATE_BCB_TYPE_OBJECT,CaptivePrivateBcbObjectClass)) -#define CAPTIVE_PRIVATE_BCB_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_PRIVATE_BCB_TYPE_OBJECT)) -#define CAPTIVE_PRIVATE_BCB_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_PRIVATE_BCB_TYPE_OBJECT)) -#define CAPTIVE_PRIVATE_BCB_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_PRIVATE_BCB_TYPE_OBJECT,CaptivePrivateBcbObjectClass)) -typedef struct _CaptivePrivateBcbObject CaptivePrivateBcbObject; -typedef struct _CaptivePrivateBcbObjectClass CaptivePrivateBcbObjectClass; - - -GType captive_private_bcb_object_get_type(void); - -void _captive_private_bcb_object_connect_SharedCacheMap - (CaptivePrivateBcbObject *captive_private_bcb_object,CaptiveSharedCacheMapObject *SharedCacheMap); -PUBLIC_BCB *captive_private_bcb_object_get_PublicBcb(CaptivePrivateBcbObject *captive_private_bcb_object); -CaptiveSharedCacheMapObject *captive_private_bcb_object_get_SharedCacheMap(CaptivePrivateBcbObject *captive_private_bcb_object); -CaptivePrivateBcbObject *captive_PublicBcb_to_PrivateBcbObject(const PUBLIC_BCB *PublicBcb); - -G_END_DECLS - - -#endif /* _CAPTIVE_CC_PRIVATE_BCB_H */ diff --git a/src/libcaptive/cc/privatebcbmap.c b/src/libcaptive/cc/privatebcbmap.c deleted file mode 100644 index 26544e3..0000000 --- a/src/libcaptive/cc/privatebcbmap.c +++ /dev/null @@ -1,127 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) PrivateBcb Map type structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbmap.h" /* self */ -#include "privatebcb.h" -#include "privatebcb-priv.h" -#include "sharedcachemap-priv.h" -#include - - -struct _CaptivePrivateBcbMapObject { - CaptivePrivateBcbObject parent_instance; - }; -struct _CaptivePrivateBcbMapObjectClass { - CaptivePrivateBcbObjectClass parent_class; - }; - - -static gpointer captive_private_bcb_map_object_parent_class=NULL; - - -static void captive_private_bcb_map_object_finalize(CaptivePrivateBcbMapObject *captive_private_bcb_map_object) -{ -CaptivePrivateBcbObject *captive_private_bcb_object; -CaptiveSharedCacheMapObject *captive_shared_cache_map_object; - - g_return_if_fail(captive_private_bcb_map_object!=NULL); - - captive_private_bcb_object=CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_map_object); - - if ((captive_shared_cache_map_object=captive_private_bcb_object->SharedCacheMap)) { - g_assert(captive_shared_cache_map_object->map==captive_private_bcb_map_object); - captive_shared_cache_map_object->map=NULL; - g_object_unref(captive_shared_cache_map_object); /* 'map' disconnected. */ - } - - G_OBJECT_CLASS(captive_private_bcb_map_object_parent_class)->finalize((GObject *)captive_private_bcb_map_object); -} - - -static void captive_private_bcb_map_object_class_init(CaptivePrivateBcbMapObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); - - captive_private_bcb_map_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_private_bcb_map_object_finalize; -} - - -static void captive_private_bcb_map_object_init(CaptivePrivateBcbMapObject *captive_private_bcb_map_object) -{ -} - - -GType captive_private_bcb_map_object_get_type(void) -{ -static GType captive_private_bcb_map_object_type=0; - - if (!captive_private_bcb_map_object_type) { -static const GTypeInfo captive_private_bcb_map_object_info={ - sizeof(CaptivePrivateBcbMapObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_private_bcb_map_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptivePrivateBcbMapObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_private_bcb_map_object_init, - }; - - captive_private_bcb_map_object_type=g_type_register_static(CAPTIVE_PRIVATE_BCB_TYPE_OBJECT, - "CaptivePrivateBcbMapObject",&captive_private_bcb_map_object_info,0); - } - - return captive_private_bcb_map_object_type; -} - -CaptivePrivateBcbMapObject *captive_private_bcb_map_object_new(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ -CaptivePrivateBcbMapObject *captive_private_bcb_map_object; - - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),NULL); - - captive_private_bcb_map_object=g_object_new( - CAPTIVE_PRIVATE_BCB_MAP_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - - _captive_private_bcb_object_connect_SharedCacheMap(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_map_object), - captive_shared_cache_map_object); - - g_assert(captive_shared_cache_map_object->map==NULL); - captive_shared_cache_map_object->map=captive_private_bcb_map_object; - g_object_ref(captive_shared_cache_map_object); /* 'map' connected. */ - - return captive_private_bcb_map_object; -} - -CaptivePrivateBcbMapObject *captive_private_bcb_map_object_get_ref - (CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),NULL); - - if (captive_shared_cache_map_object->map) { - g_object_ref(captive_shared_cache_map_object->map); - return captive_shared_cache_map_object->map; - } - return captive_private_bcb_map_object_new(captive_shared_cache_map_object); -} diff --git a/src/libcaptive/cc/privatebcbmap.h b/src/libcaptive/cc/privatebcbmap.h deleted file mode 100644 index 04ee805..0000000 --- a/src/libcaptive/cc/privatebcbmap.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ - * Include file for reactos Cache Manager (Cc*) PrivateBcbMap structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CC_PRIVATE_BCB_MAP_H -#define _CAPTIVE_CC_PRIVATE_BCB_MAP_H 1 - - -#include -#include -#include "sharedcachemap.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_PRIVATE_BCB_MAP_TYPE_OBJECT (captive_private_bcb_map_object_get_type()) -#define CAPTIVE_PRIVATE_BCB_MAP_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_PRIVATE_BCB_MAP_TYPE_OBJECT,CaptivePrivateBcbMapObject)) -#define CAPTIVE_PRIVATE_BCB_MAP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_PRIVATE_BCB_MAP_TYPE_OBJECT,CaptivePrivateBcbMapObjectClass)) -#define CAPTIVE_PRIVATE_BCB_MAP_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_PRIVATE_BCB_MAP_TYPE_OBJECT)) -#define CAPTIVE_PRIVATE_BCB_MAP_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_PRIVATE_BCB_MAP_TYPE_OBJECT)) -#define CAPTIVE_PRIVATE_BCB_MAP_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_PRIVATE_BCB_MAP_TYPE_OBJECT,CaptivePrivateBcbMapObjectClass)) -typedef struct _CaptivePrivateBcbMapObject CaptivePrivateBcbMapObject; -typedef struct _CaptivePrivateBcbMapObjectClass CaptivePrivateBcbMapObjectClass; - - -GType captive_private_bcb_map_object_get_type(void); - -CaptivePrivateBcbMapObject *captive_private_bcb_map_object_new(CaptiveSharedCacheMapObject *captive_shared_cache_map_object); -CaptivePrivateBcbMapObject *captive_private_bcb_map_object_get_ref - (CaptiveSharedCacheMapObject *captive_shared_cache_map_object); - -G_END_DECLS - - -#endif /* _CAPTIVE_CC_PRIVATE_BCB_MAP_H */ diff --git a/src/libcaptive/cc/privatebcbpin.c b/src/libcaptive/cc/privatebcbpin.c deleted file mode 100644 index c51c641..0000000 --- a/src/libcaptive/cc/privatebcbpin.c +++ /dev/null @@ -1,371 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) PrivateBcb Map type structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "privatebcbpin.h" /* self */ -#include "privatebcb.h" -#include "privatebcb-priv.h" -#include "sharedcachemap-priv.h" -#include -#include "captive/macros.h" - - -struct _CaptivePrivateBcbPinObject { - CaptivePrivateBcbObject parent_instance; - - gulong FileSizes_changed_handler_id; - gulong FileSizes_changed_after_handler_id; - gulong purge_handler_id; - guint64 offset; - }; -struct _CaptivePrivateBcbPinObjectClass { - CaptivePrivateBcbObjectClass parent_class; - }; - - -static gpointer captive_private_bcb_pin_object_parent_class=NULL; - - -static void captive_private_bcb_pin_object_finalize(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object) -{ -CaptivePrivateBcbObject *captive_private_bcb_object; -CaptiveSharedCacheMapObject *SharedCacheMap; -GHashTable *pin_hash; - - g_return_if_fail(captive_private_bcb_pin_object!=NULL); - - captive_private_bcb_object=CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object); - - if (captive_private_bcb_pin_object->FileSizes_changed_handler_id) { - g_assert(captive_private_bcb_object->SharedCacheMap!=NULL); - g_signal_handler_disconnect( - captive_private_bcb_object->SharedCacheMap, /* instance */ - captive_private_bcb_pin_object->FileSizes_changed_handler_id); - captive_private_bcb_pin_object->FileSizes_changed_handler_id=0; - } - if (captive_private_bcb_pin_object->FileSizes_changed_after_handler_id) { - g_assert(captive_private_bcb_object->SharedCacheMap!=NULL); - g_signal_handler_disconnect( - captive_private_bcb_object->SharedCacheMap, /* instance */ - captive_private_bcb_pin_object->FileSizes_changed_after_handler_id); - captive_private_bcb_pin_object->FileSizes_changed_after_handler_id=0; - } - if (captive_private_bcb_pin_object->purge_handler_id) { - g_assert(captive_private_bcb_object->SharedCacheMap!=NULL); - g_signal_handler_disconnect( - captive_private_bcb_object->SharedCacheMap, /* instance */ - captive_private_bcb_pin_object->purge_handler_id); - captive_private_bcb_pin_object->purge_handler_id=0; - } - if ((SharedCacheMap=captive_private_bcb_object->SharedCacheMap)) { - if ((pin_hash=SharedCacheMap->pin_hash)) { - /* Do not: g_assert(g_hash_table_lookup(pin_hash,&captive_private_bcb_object->offset)); - * as we may be captive_private_bcb_pin_object_detach_pin()ed. - */ - if (captive_private_bcb_object==g_hash_table_lookup(pin_hash,&captive_private_bcb_pin_object->offset)) - g_hash_table_remove(pin_hash,&captive_private_bcb_pin_object->offset); - } - } - - G_OBJECT_CLASS(captive_private_bcb_pin_object_parent_class)->finalize((GObject *)captive_private_bcb_pin_object); -} - - -static void captive_private_bcb_pin_object_class_init(CaptivePrivateBcbPinObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); - - captive_private_bcb_pin_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_private_bcb_pin_object_finalize; -} - -static void captive_private_bcb_pin_object_init(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object) -{ -} - -GType captive_private_bcb_pin_object_get_type(void) -{ -static GType captive_private_bcb_pin_object_type=0; - - if (!captive_private_bcb_pin_object_type) { -static const GTypeInfo captive_private_bcb_pin_object_info={ - sizeof(CaptivePrivateBcbPinObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_private_bcb_pin_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptivePrivateBcbPinObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_private_bcb_pin_object_init, - }; - - captive_private_bcb_pin_object_type=g_type_register_static(CAPTIVE_PRIVATE_BCB_TYPE_OBJECT, - "CaptivePrivateBcbPinObject",&captive_private_bcb_pin_object_info,0); - } - - return captive_private_bcb_pin_object_type; -} - - -static guint captive_private_bcb_pin_object_hash_new_hash_func(const guint64 *offsetp) -{ - return (*offsetp)^((*offsetp)>>32); -} - -static gboolean captive_private_bcb_pin_object_hash_new_key_compare_func(const guint64 *offset_ap,const guint64 *offset_bp) -{ - return (*offset_ap)==(*offset_bp); -} - -GHashTable *captive_private_bcb_pin_object_hash_new(void) -{ - return g_hash_table_new( - (GHashFunc)captive_private_bcb_pin_object_hash_new_hash_func, - (GEqualFunc)captive_private_bcb_pin_object_hash_new_key_compare_func); -} - -void captive_private_bcb_pin_object_hash_destroy(GHashTable *pin_hash) -{ - g_return_if_fail(pin_hash!=NULL); - - g_hash_table_destroy(pin_hash); -} - -static void captive_private_bcb_pin_object_validate(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object) -{ -guint64 start,end; - - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT( - CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap)); - - start=captive_private_bcb_pin_object->offset; - end =captive_private_bcb_pin_object->offset+PAGE_SIZE; - - g_assert(end<=CAPTIVE_ROUND_UP64( - CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap->AllocationSize,PAGE_SIZE)); -} - -static void captive_private_bcb_pin_object_FileSizes_changed(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 AllocationSize,guint64 FileSize,guint64 ValidDataLength, - CaptivePrivateBcbPinObject *captive_private_bcb_pin_object /* user_data */) -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_return_if_fail(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap - ==captive_shared_cache_map_object); - - /* ntfs.sys of NT-5.1sp1 may extend StreamFileObject while dirty pins exist. - * How to extend SharedCacheMap size without changing the memory location? - * I hope ntfs.sys does not expect long-term absolute position of its - * StreamFileObject: - */ - if (!(captive_shared_cache_map_object->FileObject->Flags&FO_STREAM_FILE)) { - /* 'AllocationSize' must not change if any map/pin Bcbs exist. */ - g_assert(AllocationSize==captive_shared_cache_map_object->AllocationSize); - } -} - -static void captive_private_bcb_pin_object_purge(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - CaptivePrivateBcbPinObject *captive_private_bcb_pin_object /* user_data */) -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_return_if_fail(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap - ==captive_shared_cache_map_object); - - g_assert(!captive_shared_cache_map_is_page_dirty(captive_shared_cache_map_object, - captive_private_bcb_pin_object->offset)); -} - -static void captive_private_bcb_pin_object_FileSizes_changed_after(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 AllocationSize,guint64 FileSize,guint64 ValidDataLength, - CaptivePrivateBcbPinObject *captive_private_bcb_pin_object /* user_data */) -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_return_if_fail(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap - ==captive_shared_cache_map_object); - - /* we are 'g_signal_connect_after' */ - g_assert(AllocationSize ==captive_shared_cache_map_object->AllocationSize); - g_assert(FileSize ==captive_shared_cache_map_object->FileSize); - g_assert(ValidDataLength==captive_shared_cache_map_object->ValidDataLength); - - captive_private_bcb_pin_object_validate(captive_private_bcb_pin_object); -} - -void _captive_private_bcb_pin_object_connect_SharedCacheMap - (CaptivePrivateBcbPinObject *captive_private_bcb_pin_object,CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap==NULL); - - _captive_private_bcb_object_connect_SharedCacheMap( - CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object),captive_shared_cache_map_object); - - captive_private_bcb_pin_object->FileSizes_changed_handler_id=g_signal_connect( - captive_shared_cache_map_object,"FileSizes_changed", - G_CALLBACK(captive_private_bcb_pin_object_FileSizes_changed), - captive_private_bcb_pin_object); - g_assert(captive_private_bcb_pin_object->FileSizes_changed_handler_id>=1); - captive_private_bcb_pin_object->FileSizes_changed_after_handler_id=g_signal_connect_after( - captive_shared_cache_map_object,"FileSizes_changed", - G_CALLBACK(captive_private_bcb_pin_object_FileSizes_changed_after), - captive_private_bcb_pin_object); - g_assert(captive_private_bcb_pin_object->FileSizes_changed_after_handler_id>=1); - captive_private_bcb_pin_object->purge_handler_id=g_signal_connect( - captive_shared_cache_map_object,"purge", - G_CALLBACK(captive_private_bcb_pin_object_purge), - captive_private_bcb_pin_object); - g_assert(captive_private_bcb_pin_object->purge_handler_id>=1); -} - -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_new(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset) -{ -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; - - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),NULL); - g_return_val_if_fail(0==CAPTIVE_ROUND_DOWN_EXCEEDING64(offset,PAGE_SIZE),NULL); - - g_assert(captive_shared_cache_map_object->PinAccess); - - captive_private_bcb_pin_object=g_object_new( - CAPTIVE_PRIVATE_BCB_PIN_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - - captive_private_bcb_pin_object->offset=offset; - - _captive_private_bcb_pin_object_connect_SharedCacheMap(captive_private_bcb_pin_object, - captive_shared_cache_map_object); - - g_assert(captive_shared_cache_map_object->pin_hash!=NULL); - g_assert(!g_hash_table_lookup(captive_shared_cache_map_object->pin_hash, - &captive_private_bcb_pin_object->offset)); - g_hash_table_insert(captive_shared_cache_map_object->pin_hash, - &captive_private_bcb_pin_object->offset, - captive_private_bcb_pin_object); - - return captive_private_bcb_pin_object; -} - -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_get(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset) -{ -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; - - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),NULL); - g_return_val_if_fail(0==CAPTIVE_ROUND_DOWN_EXCEEDING64(offset,PAGE_SIZE),NULL); - - if ((captive_private_bcb_pin_object=g_hash_table_lookup(captive_shared_cache_map_object->pin_hash, - &offset))) { - g_assert(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - return captive_private_bcb_pin_object; - } - return NULL; -} - -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_get_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset,gboolean invalidate_new) -{ -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object; - - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),NULL); - g_return_val_if_fail(0==CAPTIVE_ROUND_DOWN_EXCEEDING64(offset,PAGE_SIZE),NULL); - - if ((captive_private_bcb_pin_object=captive_private_bcb_pin_object_get(captive_shared_cache_map_object,offset))) { - g_assert(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_object_ref(captive_private_bcb_pin_object); - return captive_private_bcb_pin_object; - } - - if (invalidate_new) { - /* Invalide possibly only 'map'ped data as we need to re-read them on CcPinRead(). - * Otherwise any file written by fastfat.sys of NT-5.1sp1 will corrupt - * the code+55AA of DOS boot sector (disk offset 0x0). - */ - captive_shared_cache_map_flush(captive_shared_cache_map_object, - offset,offset+PAGE_SIZE); - captive_shared_cache_map_set_data_invalid(captive_shared_cache_map_object, - offset,offset+PAGE_SIZE); - } - - return captive_private_bcb_pin_object_new(captive_shared_cache_map_object,offset); -} - -gboolean captive_private_bcb_pin_object_is_dirty(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object) -{ - g_return_val_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object),FALSE); - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT( - CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap),FALSE); - - return captive_shared_cache_map_is_page_dirty(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap, - captive_private_bcb_pin_object->offset); -} - -void captive_private_bcb_pin_object_flush(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object) -{ - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT( - CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap)); - g_return_if_fail(captive_private_bcb_pin_object_is_dirty(captive_private_bcb_pin_object)); - - /* Flush synchronously here. */ - captive_shared_cache_map_flush(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap, - captive_private_bcb_pin_object->offset, - captive_private_bcb_pin_object->offset+PAGE_SIZE); -} - -void captive_private_bcb_pin_object_set_dirty(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object) -{ - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT( - CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap)); - - captive_shared_cache_map_set_dirty(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap, - captive_private_bcb_pin_object->offset, - captive_private_bcb_pin_object->offset+PAGE_SIZE); -} - -void captive_private_bcb_pin_object_set_lsn(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object,gint64 lsn) -{ - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT( - CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap)); - - captive_shared_cache_map_page_set_lsn(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)->SharedCacheMap, - captive_private_bcb_pin_object->offset,lsn); -} - -void captive_private_bcb_pin_object_detach_pin(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object) -{ -CaptiveSharedCacheMapObject *SharedCacheMap; - - g_return_if_fail(CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(captive_private_bcb_pin_object)); - - SharedCacheMap=captive_private_bcb_object_get_SharedCacheMap(CAPTIVE_PRIVATE_BCB_OBJECT(captive_private_bcb_pin_object)); - g_assert(SharedCacheMap->pin_hash!=NULL); - g_assert(captive_private_bcb_pin_object==g_hash_table_lookup(SharedCacheMap->pin_hash, - &captive_private_bcb_pin_object->offset)); - g_hash_table_remove(SharedCacheMap->pin_hash,&captive_private_bcb_pin_object->offset); -} diff --git a/src/libcaptive/cc/privatebcbpin.h b/src/libcaptive/cc/privatebcbpin.h deleted file mode 100644 index caafee3..0000000 --- a/src/libcaptive/cc/privatebcbpin.h +++ /dev/null @@ -1,62 +0,0 @@ -/* $Id$ - * Include file for reactos Cache Manager (Cc*) PrivateBcbPin structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CC_PRIVATE_BCB_PIN_H -#define _CAPTIVE_CC_PRIVATE_BCB_PIN_H 1 - - -#include -#include -#include "sharedcachemap.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_PRIVATE_BCB_PIN_TYPE_OBJECT (captive_private_bcb_pin_object_get_type()) -#define CAPTIVE_PRIVATE_BCB_PIN_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_PRIVATE_BCB_PIN_TYPE_OBJECT,CaptivePrivateBcbPinObject)) -#define CAPTIVE_PRIVATE_BCB_PIN_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_PRIVATE_BCB_PIN_TYPE_OBJECT,CaptivePrivateBcbPinObjectClass)) -#define CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_PRIVATE_BCB_PIN_TYPE_OBJECT)) -#define CAPTIVE_PRIVATE_BCB_PIN_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_PRIVATE_BCB_PIN_TYPE_OBJECT)) -#define CAPTIVE_PRIVATE_BCB_PIN_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_PRIVATE_BCB_PIN_TYPE_OBJECT,CaptivePrivateBcbPinObjectClass)) -typedef struct _CaptivePrivateBcbPinObject CaptivePrivateBcbPinObject; -typedef struct _CaptivePrivateBcbPinObjectClass CaptivePrivateBcbPinObjectClass; - - -GType captive_private_bcb_pin_object_get_type(void); - -GHashTable *captive_private_bcb_pin_object_hash_new(void); -void captive_private_bcb_pin_object_hash_destroy(GHashTable *pin_hash); -void _captive_private_bcb_pin_object_connect_SharedCacheMap - (CaptivePrivateBcbPinObject *captive_private_bcb_pin_object,CaptiveSharedCacheMapObject *SharedCacheMap); -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_new(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset); -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_get(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset); -CaptivePrivateBcbPinObject *captive_private_bcb_pin_object_get_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset,gboolean invalidate_new); -gboolean captive_private_bcb_pin_object_is_dirty(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object); -void captive_private_bcb_pin_object_flush(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object); -void captive_private_bcb_pin_object_set_dirty(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object); -void captive_private_bcb_pin_object_set_lsn(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object,gint64 lsn); -void captive_private_bcb_pin_object_detach_pin(CaptivePrivateBcbPinObject *captive_private_bcb_pin_object); - -G_END_DECLS - - -#endif /* _CAPTIVE_CC_PRIVATE_BCB_PIN_H */ diff --git a/src/libcaptive/cc/sharedcachemap-priv.h b/src/libcaptive/cc/sharedcachemap-priv.h deleted file mode 100644 index 7a7cf07..0000000 --- a/src/libcaptive/cc/sharedcachemap-priv.h +++ /dev/null @@ -1,92 +0,0 @@ -/* $Id$ - * Object-private include file for reactos Cache Manager (Cc*) SharedCacheMap structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CC_SHARED_CACHE_MAP_PRIV_H -#define _CAPTIVE_CC_SHARED_CACHE_MAP_PRIV_H 1 - - -#include -#include -#include "reactos/ddk/cctypes.h" -#include "privatebcbmap.h" - - -G_BEGIN_DECLS - -typedef struct _CaptiveSharedCacheMapObject_page CaptiveSharedCacheMapObject_page; - -struct _CaptiveSharedCacheMapObject_page { - gboolean data_valid; - gboolean dirty; - gint64 lsn_oldest,lsn_newest; - }; - -struct _CaptiveSharedCacheMapObject { - GObject parent_instance; - - gint w32_ref_count; - FILE_OBJECT *FileObject; - SECTION_OBJECT_POINTERS *SectionObjectPointer; - /* ValidDataLength<=FileSize<=AllocationSize */ - /* 'AllocationSize' sets the mmap(2)ed area of buffers of this SharedCacheMap. - * We must reallocate this area if 'AllocationSize' changes and in such case - * there must exist no map-Bcb or pin-Bcbs for it. - * We would cope with 'buffer' change with existing Bcbs but W32 client could not. - */ - guint64 AllocationSize; /* ==CC_FILE_SIZES.AllocationSize.QuadPart */ - /* We generally check against CAPTIVE_ROUND_UP64(FileSize,PAGE_SIZE) - * as the offsets are usually PAGE_SIZE aligned due to pin-Bcb expectations. - */ - guint64 FileSize; /* ==CC_FILE_SIZES.FileSize.QuadPart */ - /* We use do not use 'ValidDataLength' as I assume W32 - * automatically increases 'ValidDataLength' during Cache Manager write operations. - * We do not increase it and therefore it is mostly useless for us. - * In some cases (during NTFS mount) there may be also invalid 'ValidDataLength' at all: - * CcSetFileSizes(AllocationSize=0x1000000,FileSize=0xf80208,ValidDataLength=0x23b801a0) - */ - guint64 ValidDataLength; /* ==CC_FILE_SIZES.ValidDataLength.QuadPart */ - /* The real allocation size of 'buffer' and 'pages'. - * Maintained by captive_shared_cache_map_object_FileSizes_changed() - * to prevent continous reallocation to (n+1) size. - * We use (n*2) sizes for logaritmic time complexity. - */ - guint64 alloc_length; - CACHE_MANAGER_CALLBACKS CallBacks; - VOID *LazyWriterContext; - gboolean PinAccess; - CaptivePrivateBcbMapObject *map; /* 'map' will g_object_ref(CaptiveSharedCacheMapObject). */ - GHashTable *pin_hash; /* map: (guint64 *) -> (CaptivePrivateBcbPinObject *) */ - gboolean LogHandle_set; - gboolean FlushToLsnRoutine_set; - - gpointer buffer; /* FileOffset 0 based */ - CaptiveSharedCacheMapObject_page *pages; /* FileOffset 0 based, item corresponds to 'buffer' PAGE_SIZE */ - }; -struct _CaptiveSharedCacheMapObjectClass { - GObjectClass parent_class; - - void (*FileSizes_changed)(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 AllocationSize,guint64 FileSize,guint64 ValidDataLength); - void (*purge)(CaptiveSharedCacheMapObject *captive_shared_cache_map_object); - }; - -G_END_DECLS - - -#endif /* _CAPTIVE_CC_SHARED_CACHE_MAP_PRIV_H */ diff --git a/src/libcaptive/cc/sharedcachemap.c b/src/libcaptive/cc/sharedcachemap.c deleted file mode 100644 index 42c6780..0000000 --- a/src/libcaptive/cc/sharedcachemap.c +++ /dev/null @@ -1,1075 +0,0 @@ -/* $Id$ - * reactos Cache Manager (Cc*) SharedCacheMap structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "sharedcachemap.h" /* self */ -#include "sharedcachemap-priv.h" /* self */ -#include "io.h" -#include "marshallers.h" -#include -#include "privatebcbpin.h" -#include "captive/macros.h" -#include -#include "reactos/ddk/obfuncs.h" -#include - - -static GHashTable *CaptiveSharedCacheMapObject_hash; - -static void CaptiveSharedCacheMapObject_hash_init(void) -{ - if (CaptiveSharedCacheMapObject_hash) - return; - CaptiveSharedCacheMapObject_hash=g_hash_table_new( - g_direct_hash, /* hash_func */ - g_direct_equal); /* key_equal_func */ -} - - -static gpointer captive_shared_cache_map_object_parent_class=NULL; - - -static void captive_shared_cache_map_object_finalize(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ -static const CC_FILE_SIZES FileSizes_zero; -gboolean errbool; -guint64 offset; -CaptiveSharedCacheMapObject_page *page; - - g_return_if_fail(captive_shared_cache_map_object!=NULL); - - for (offset=0;offsetAllocationSize,PAGE_SIZE);offset+=PAGE_SIZE) { - page=captive_shared_cache_map_object->pages+offset/PAGE_SIZE; - if (!page->data_valid) - continue; - g_assert(!page->dirty); /* FIXME: Is it allowed by W32? */ - } - - CaptiveSharedCacheMapObject_hash_init(); - errbool=g_hash_table_remove(CaptiveSharedCacheMapObject_hash,captive_shared_cache_map_object); - g_assert(errbool==TRUE); - - captive_shared_cache_map_FileSizes_set(captive_shared_cache_map_object,&FileSizes_zero); - g_assert(captive_shared_cache_map_object->buffer==NULL); - g_assert(captive_shared_cache_map_object->pages==NULL); - - if (captive_shared_cache_map_object->pin_hash) { - captive_private_bcb_pin_object_hash_destroy(captive_shared_cache_map_object->pin_hash); - captive_shared_cache_map_object->pin_hash=NULL; - } - g_assert(captive_shared_cache_map_object->map==NULL); - if (captive_shared_cache_map_object->SectionObjectPointer) { - g_assert(captive_shared_cache_map_object==captive_shared_cache_map_object->SectionObjectPointer->SharedCacheMap); - captive_shared_cache_map_object->SectionObjectPointer->SharedCacheMap=NULL; - } - - if (captive_shared_cache_map_object->FileObject) { - /* W32 dereferences twice. */ - ObDereferenceObject(captive_shared_cache_map_object->FileObject); - captive_shared_cache_map_object->FileObject=NULL; - } - - G_OBJECT_CLASS(captive_shared_cache_map_object_parent_class)->finalize((GObject *)captive_shared_cache_map_object); -} - -static guint FileSizes_changed_signal; -static guint purge_signal; - -static void captive_shared_cache_map_object_FileSizes_changed(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 AllocationSize,guint64 FileSize,guint64 ValidDataLength); -static void captive_shared_cache_map_object_purge(CaptiveSharedCacheMapObject *captive_shared_cache_map_object); - -static void captive_shared_cache_map_object_class_init(CaptiveSharedCacheMapObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); - - captive_shared_cache_map_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_shared_cache_map_object_finalize; - - class->FileSizes_changed=captive_shared_cache_map_object_FileSizes_changed; - class->purge=captive_shared_cache_map_object_purge; - - FileSizes_changed_signal=g_signal_new("FileSizes_changed", - G_TYPE_FROM_CLASS(gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(CaptiveSharedCacheMapObjectClass,FileSizes_changed), - NULL,NULL, - captive_cc_VOID__UINT64_UINT64_UINT64, - G_TYPE_NONE,3,G_TYPE_UINT64,G_TYPE_UINT64,G_TYPE_UINT64); - purge_signal=g_signal_new("purge", - G_TYPE_FROM_CLASS(gobject_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(CaptiveSharedCacheMapObjectClass,purge), - NULL,NULL, - captive_cc_VOID__VOID, - G_TYPE_NONE,0); -} - - -static void captive_shared_cache_map_object_init(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ - captive_shared_cache_map_object->pin_hash=captive_private_bcb_pin_object_hash_new(); - - captive_shared_cache_map_w32_ref(captive_shared_cache_map_object); - g_object_unref(captive_shared_cache_map_object); /* ==sink */ - - CaptiveSharedCacheMapObject_hash_init(); - g_hash_table_insert(CaptiveSharedCacheMapObject_hash, - captive_shared_cache_map_object,captive_shared_cache_map_object); -} - - -GType captive_shared_cache_map_object_get_type(void) -{ -static GType captive_shared_cache_map_object_type=0; - - if (!captive_shared_cache_map_object_type) { -static const GTypeInfo captive_shared_cache_map_object_info={ - sizeof(CaptiveSharedCacheMapObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_shared_cache_map_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveSharedCacheMapObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_shared_cache_map_object_init, - }; - - captive_shared_cache_map_object_type=g_type_register_static(G_TYPE_OBJECT, - "CaptiveSharedCacheMapObject",&captive_shared_cache_map_object_info,0); - } - - return captive_shared_cache_map_object_type; -} - -static void captive_shared_cache_map_object_FileSizes_changed(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 AllocationSize,guint64 FileSize,guint64 ValidDataLength) -{ -size_t size_old,size_new; -guint64 size64_old,size64_new; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - - g_assert((!captive_shared_cache_map_object->buffer)==(!captive_shared_cache_map_object->AllocationSize)); - g_assert((!captive_shared_cache_map_object->pages)==(!captive_shared_cache_map_object->AllocationSize)); - - size64_old=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE); - size_old=size64_old; - g_assert(size_old==size64_old); - size64_new=CAPTIVE_ROUND_UP64(AllocationSize,PAGE_SIZE); - size_new=size64_new; - if (size_new!=size64_new) { -size_new_big: - g_error("Mapped size %" G_GUINT64_FORMAT " is too big; FIXME: non-mmap(2)-able areas not yet supported",size64_new); - g_assert_not_reached(); - } - - if (size_old!=size_new) { - /* ntfs.sys of NT-5.1sp1 may extend StreamFileObject while dirty pins exist. - * How to extend SharedCacheMap size without changing the memory location? - * I hope ntfs.sys does not expect long-term absolute position of its - * StreamFileObject: - */ - if (!(captive_shared_cache_map_object->FileObject->Flags&FO_STREAM_FILE)) { - /* These two assertions should be already catched by pin/map signal handlers. */ - g_assert(!captive_shared_cache_map_object->map); - g_assert(!g_hash_table_size(captive_shared_cache_map_object->pin_hash)); - } - } - - if (!size_new || size_new > captive_shared_cache_map_object->alloc_length) { -size_t alloc_new; -guint64 alloc64_new; -gpointer buffer_new; - - alloc64_new=CAPTIVE_ROUND_UP64((!size64_new ? 0 : MAX(size64_new*2,0x10000)),PAGE_SIZE); - alloc_new=alloc64_new; - if (alloc_new!=alloc64_new) - goto size_new_big; - - if (!alloc_new) - buffer_new=NULL; - else { -gpointer base; -int errint; - - base=mmap( - NULL, /* start */ - PAGE_SIZE+alloc_new+PAGE_SIZE, /* length; leading and trailing boundary check pages */ - PROT_READ|PROT_WRITE, /* prot; read/write must be possible although write is not guaranteed to be flushed yet */ - MAP_PRIVATE|MAP_ANONYMOUS /* flags */ - |MAP_NORESERVE, /* At least ext2fsd maps the whole disk. */ - -1, /* fd; ignored due to MAP_ANONYMOUS */ - 0); /* offset; ignored due to MAP_ANONYMOUS */ - if (base==MAP_FAILED) - goto size_new_big; - g_assert(base!=NULL); - - base+=PAGE_SIZE; - errint=munmap(base-PAGE_SIZE,PAGE_SIZE); /* unmap leading boundary check page */ - g_assert(errint==0); - errint=munmap(base+alloc_new,PAGE_SIZE); /* unmap trailing boundary check page */ - g_assert(errint==0); - - buffer_new=base; - } - - memcpy(buffer_new,captive_shared_cache_map_object->buffer, - MIN(AllocationSize,captive_shared_cache_map_object->AllocationSize)); - - if (captive_shared_cache_map_object->alloc_length) { -int errint; - - errint=munmap(captive_shared_cache_map_object->buffer,captive_shared_cache_map_object->alloc_length); - g_assert(errint==0); - } - - captive_shared_cache_map_object->buffer=buffer_new; - -#if 0 /* It appears it is valid to squeeze out 'dirty' blocks. FIXME: Flush them? */ - /* FIXME: The code may be no longer valid with the 'alloc_new' introduction! */ - if (size_old>size_new) { -guint64 now; - - for (now=size_new;nowpages[now/PAGE_SIZE].data_valid) - continue; - g_assert(!captive_shared_cache_map_object->pages[now/PAGE_SIZE].dirty); - } - } -#endif - - captive_shared_cache_map_object->pages=g_realloc(captive_shared_cache_map_object->pages, - alloc_new/PAGE_SIZE*sizeof(*captive_shared_cache_map_object->pages)); - - captive_shared_cache_map_object->alloc_length=alloc_new; - } - - if (size_new>size_old) /* prevent 'size_new-size_old' as it is unsigned! */ - memset(captive_shared_cache_map_object->pages+(size_old/PAGE_SIZE),0, - (size_new-size_old)/PAGE_SIZE*sizeof(*captive_shared_cache_map_object->pages)); - - captive_shared_cache_map_object->AllocationSize=AllocationSize; - captive_shared_cache_map_object->FileSize=FileSize; - captive_shared_cache_map_object->ValidDataLength=ValidDataLength; - - g_assert((!captive_shared_cache_map_object->buffer)==(!captive_shared_cache_map_object->AllocationSize)); - g_assert((!captive_shared_cache_map_object->pages)==(!captive_shared_cache_map_object->AllocationSize)); -} - -static void captive_shared_cache_map_object_purge(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - - /* NOP; just to provide slot for checking by Bcbs */ -} - -CaptiveSharedCacheMapObject *captive_shared_cache_map_get_ref(FILE_OBJECT *FileObject, - const CC_FILE_SIZES *FileSizes,BOOLEAN PinAccess,const CACHE_MANAGER_CALLBACKS *CallBacks,VOID *LazyWriterContext) -{ -CaptiveSharedCacheMapObject *captive_shared_cache_map_object; - - g_return_val_if_fail(FileObject!=NULL,NULL); - g_return_val_if_fail(FileObject->SectionObjectPointer!=NULL,NULL); - g_return_val_if_fail(FileSizes!=NULL,NULL); - g_return_val_if_fail(CallBacks!=NULL,NULL); - - if ((captive_shared_cache_map_object=FileObject->SectionObjectPointer->SharedCacheMap)) { - captive_shared_cache_map_w32_ref(captive_shared_cache_map_object); - } - else { - captive_shared_cache_map_object=g_object_new( - CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - - /* FIXME: When to drop SharedCacheMap? - * Currently we never close it. - * Fix also CcZeroData() workaround. - */ - g_object_ref(captive_shared_cache_map_object); - - /* W32 references twice. */ - ObReferenceObject(FileObject); - captive_shared_cache_map_object->FileObject=FileObject; - captive_shared_cache_map_object->SectionObjectPointer=FileObject->SectionObjectPointer; - captive_shared_cache_map_object->AllocationSize=0; - captive_shared_cache_map_object->FileSize=0; - captive_shared_cache_map_object->ValidDataLength=0; - captive_shared_cache_map_object->PinAccess=PinAccess; - captive_shared_cache_map_object->CallBacks=*CallBacks; - captive_shared_cache_map_object->LazyWriterContext=LazyWriterContext; - - FileObject->SectionObjectPointer->SharedCacheMap=captive_shared_cache_map_object; - } - - g_assert(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - /* FileObject may differ - we can have a different reference to the same FCB. */ - g_assert(FileObject->SectionObjectPointer==captive_shared_cache_map_object->SectionObjectPointer); - g_assert(PinAccess==captive_shared_cache_map_object->PinAccess); - g_assert(CallBacks->AcquireForLazyWrite==captive_shared_cache_map_object->CallBacks.AcquireForLazyWrite); - g_assert(CallBacks->ReleaseFromLazyWrite==captive_shared_cache_map_object->CallBacks.ReleaseFromLazyWrite); - g_assert(CallBacks->AcquireForReadAhead==captive_shared_cache_map_object->CallBacks.AcquireForReadAhead); - g_assert(CallBacks->ReleaseFromReadAhead==captive_shared_cache_map_object->CallBacks.ReleaseFromReadAhead); - g_assert(LazyWriterContext==captive_shared_cache_map_object->LazyWriterContext); - - captive_shared_cache_map_FileSizes_set(captive_shared_cache_map_object,FileSizes); - - return captive_shared_cache_map_object; -} - -void captive_shared_cache_map_FileSizes_set(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - const CC_FILE_SIZES *FileSizes) -{ -guint64 AllocationSize,FileSize,ValidDataLength; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(FileSizes!=NULL); - - AllocationSize=FileSizes->AllocationSize.QuadPart; - FileSize=FileSizes->FileSize.QuadPart; - ValidDataLength=FileSizes->ValidDataLength.QuadPart; - - /* Do not: if (ValidDataLength==G_MAXINT64) - * ValidDataLength=FileSize; - * In some cases (during NTFS mount) there may be also invalid 'ValidDataLength' at all: - * CcSetFileSizes(AllocationSize=0x1000000,FileSize=0xf80208,ValidDataLength=0x23b801a0) - */ - ValidDataLength=FileSize; - - g_assert(AllocationSize>=0); - g_assert(FileSize>=0); - g_assert(ValidDataLength>=0); - - g_assert(ValidDataLength<=FileSize); - /* Do not: g_assert(0==(AllocationSize%0x200)); - * as it is true for ntfs.sys of NT-5.1sp1 but it fails for fastfat.sys of NT-5.1sp1. - */ - /* AllocationSize can be much higher: */ - g_assert(FileSize<=AllocationSize); - - /* Prevent signalling if not needed. */ - if (0 - || captive_shared_cache_map_object->AllocationSize!=AllocationSize - || captive_shared_cache_map_object->FileSize!=FileSize - || captive_shared_cache_map_object->ValidDataLength!=ValidDataLength) { - /* Signalling is forbidden in captive_shared_cache_map_object_finalize(). */ - if (G_OBJECT(captive_shared_cache_map_object)->ref_count==0) { - (*CAPTIVE_SHARED_CACHE_MAP_OBJECT_GET_CLASS(captive_shared_cache_map_object)->FileSizes_changed) - (captive_shared_cache_map_object,AllocationSize,FileSize,ValidDataLength); - } - else { - g_signal_emit(captive_shared_cache_map_object,FileSizes_changed_signal,0, - AllocationSize,FileSize,ValidDataLength); - } - } - - g_assert(captive_shared_cache_map_object->AllocationSize==AllocationSize); - g_assert(captive_shared_cache_map_object->FileSize==FileSize); - g_assert(captive_shared_cache_map_object->ValidDataLength==ValidDataLength); -} - -CaptiveSharedCacheMapObject *captive_SectionObjectPointers_to_SharedCacheMap(SECTION_OBJECT_POINTERS *SectionObjectPointers) -{ - g_return_val_if_fail(SectionObjectPointers!=NULL,NULL); - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(SectionObjectPointers->SharedCacheMap),NULL); - - return SectionObjectPointers->SharedCacheMap; -} - -CaptiveSharedCacheMapObject *captive_FileObject_to_SharedCacheMap(FILE_OBJECT *FileObject) -{ - g_return_val_if_fail(FileObject!=NULL,NULL); - - return captive_SectionObjectPointers_to_SharedCacheMap(FileObject->SectionObjectPointer); -} - -void captive_shared_cache_map_w32_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - - g_object_ref(captive_shared_cache_map_object); - captive_shared_cache_map_object->w32_ref_count++; -} - -void captive_shared_cache_map_w32_unref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(G_OBJECT(captive_shared_cache_map_object)->ref_count>0); - - captive_shared_cache_map_object->w32_ref_count--; - g_object_unref(captive_shared_cache_map_object); -} - -gint captive_shared_cache_map_query_w32_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),0); - - return captive_shared_cache_map_object->w32_ref_count; -} - -void captive_shared_cache_map_data_validate_read(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - FILE_OBJECT *FileObject,guint64 start,guint64 end) -{ -guint64 now; -gboolean after_eof=FALSE; /* Did we reached the end of file already? */ - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object==captive_FileObject_to_SharedCacheMap(FileObject)); - g_return_if_fail(start<=end); - g_return_if_fail(end<=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - - start=CAPTIVE_ROUND_DOWN64(start,PAGE_SIZE); - end=CAPTIVE_ROUND_UP64(end,PAGE_SIZE); - - for (now=start;nowpages[now/PAGE_SIZE].data_valid) - continue; - now_LargeInteger.QuadPart=now; - got=captive_Cc_IoPageRead(FileObject,captive_shared_cache_map_object->buffer+now,PAGE_SIZE,&now_LargeInteger); - if (after_eof) - g_assert(got==0); - else - g_assert(got<=PAGE_SIZE); - after_eof=(gotpages[now/PAGE_SIZE].data_valid=TRUE; - captive_shared_cache_map_object->pages[now/PAGE_SIZE].dirty=FALSE; - } -} - -void captive_shared_cache_map_data_validate_noread(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end) -{ -guint64 now; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(start<=end); - g_return_if_fail(end<=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - - start=CAPTIVE_ROUND_DOWN64(start,PAGE_SIZE); - end=CAPTIVE_ROUND_UP64(end,PAGE_SIZE); - - for (now=start;nowpages[now/PAGE_SIZE].data_valid); - } -} - -void captive_shared_cache_map_set_data_valid(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end) -{ -guint64 now; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(start<=end); - g_return_if_fail(end<=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - - start=CAPTIVE_ROUND_UP64(start,PAGE_SIZE); - if (endFileSize) - end=CAPTIVE_ROUND_DOWN64(end,PAGE_SIZE); - else { - /* We can validate the last page of the file - * even if it does not end on PAGE_SIZE boundary. - */ - end=CAPTIVE_ROUND_UP64(end,PAGE_SIZE); - } - /* We may get endpages[now/PAGE_SIZE].data_valid=TRUE; - /* .dirty is undefined */ - } -} - -void captive_shared_cache_map_set_data_invalid(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end) -{ -guint64 now; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(start<=end); - g_return_if_fail(end<=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - - start=CAPTIVE_ROUND_DOWN64(start,PAGE_SIZE); - end=CAPTIVE_ROUND_UP64(end,PAGE_SIZE); - - for (now=start;nowpages[now/PAGE_SIZE].data_valid=FALSE; - } -} - -void captive_shared_cache_map_set_dirty(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end) -{ -guint64 now; -CaptiveSharedCacheMapObject_page *page; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(end<=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - - start=CAPTIVE_ROUND_DOWN64(start,PAGE_SIZE); - end=CAPTIVE_ROUND_UP64(end,PAGE_SIZE); - - for (now=start;nowpages+now/PAGE_SIZE; - g_assert(page->data_valid); - if (!page->dirty) { - page->dirty=TRUE; - page->lsn_oldest=0; - page->lsn_newest=0; - } - } -} - -typedef struct _captive_shared_cache_map_memory_range_set_dirty_param - captive_shared_cache_map_memory_range_set_dirty_param; -struct _captive_shared_cache_map_memory_range_set_dirty_param { - gpointer address_start; - gpointer address_end; - guint64 bytes_set; - }; - -static void captive_shared_cache_map_memory_range_set_dirty_foreach( - CaptiveSharedCacheMapObject *captive_shared_cache_map_object, /* key */ - CaptiveSharedCacheMapObject *captive_shared_cache_map_object_value, /* value */ - captive_shared_cache_map_memory_range_set_dirty_param *param) /* user_data */ -{ -gpointer address_start_local,address_end_local; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object==captive_shared_cache_map_object_value); - g_return_if_fail(param!=NULL); - - address_start_local=MAX(param->address_start,captive_shared_cache_map_object->buffer); - address_end_local=MIN(param->address_end,captive_shared_cache_map_object->buffer+captive_shared_cache_map_object->AllocationSize); - - if (address_start_local>address_end_local) - return; - - captive_shared_cache_map_set_dirty(captive_shared_cache_map_object, - address_start_local-captive_shared_cache_map_object->buffer, /* start */ - address_end_local -captive_shared_cache_map_object->buffer); /* end */ - - param->bytes_set+=(address_end_local-address_start_local); -} - -guint64 captive_shared_cache_map_memory_range_set_dirty(gpointer address_start,gpointer address_end) -{ -captive_shared_cache_map_memory_range_set_dirty_param set_dirty_param; - - g_return_val_if_fail(address_start!=NULL,0); - g_return_val_if_fail(address_end!=NULL,0); - g_return_val_if_fail(address_start<=address_end,0); - - address_start=CAPTIVE_ROUND_DOWN(address_start,PAGE_SIZE); - address_end=CAPTIVE_ROUND_UP(address_end,PAGE_SIZE); - - CaptiveSharedCacheMapObject_hash_init(); - set_dirty_param.address_start=address_start; - set_dirty_param.address_end=address_end; - set_dirty_param.bytes_set=0; - g_hash_table_foreach( - CaptiveSharedCacheMapObject_hash, /* hash_table */ - (GHFunc)captive_shared_cache_map_memory_range_set_dirty_foreach, /* func */ - &set_dirty_param); /* user_data */ - - return set_dirty_param.bytes_set; -} - -gboolean captive_shared_cache_map_is_page_dirty(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset) -{ -CaptiveSharedCacheMapObject_page *page; - - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),FALSE); - g_return_val_if_fail(offsetAllocationSize,PAGE_SIZE),FALSE); - g_return_val_if_fail(0==CAPTIVE_ROUND_DOWN_EXCEEDING64(offset,PAGE_SIZE),FALSE); - page=captive_shared_cache_map_object->pages+offset/PAGE_SIZE; - g_return_val_if_fail(page->data_valid,FALSE); - - return page->dirty; -} - -void captive_shared_cache_map_page_set_lsn(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset,gint64 lsn) -{ -CaptiveSharedCacheMapObject_page *page; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(offset<=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - g_return_if_fail(0==CAPTIVE_ROUND_DOWN_EXCEEDING64(offset,PAGE_SIZE)); - page=captive_shared_cache_map_object->pages+offset/PAGE_SIZE; - g_return_if_fail(page->data_valid); - g_return_if_fail(page->dirty); - g_return_if_fail(page->lsn_oldest<=page->lsn_newest); - g_return_if_fail(!page->lsn_newest || lsn>=page->lsn_newest); - g_return_if_fail(captive_shared_cache_map_object->LogHandle_set); - g_return_if_fail(captive_shared_cache_map_object->FlushToLsnRoutine_set); - - if (!page->lsn_oldest) - page->lsn_oldest=lsn; - page->lsn_newest=lsn; -} - -void captive_shared_cache_map_purge(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ -guint64 offset; -CaptiveSharedCacheMapObject_page *page; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - - g_signal_emit(captive_shared_cache_map_object,purge_signal,0); - - /* Needed by fastfat.sys of NT-5.1sp1 during FAT32 unmount - * otherwise it fails on: g_assert(!page->dirty); - * It corrupts the disk if the buffer is dropped instead. - */ - captive_shared_cache_map_flush(captive_shared_cache_map_object, - 0,CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - - for (offset=0;offsetAllocationSize,PAGE_SIZE);offset+=PAGE_SIZE) { - page=captive_shared_cache_map_object->pages+offset/PAGE_SIZE; - if (!page->data_valid) - continue; - g_assert(!page->dirty); - page->data_valid=FALSE; - } -} - -static VOID *captive_LogHandle; -static PFLUSH_TO_LSN captive_FlushToLsnRoutine; - -void captive_shared_cache_map_set_LogHandle(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,VOID *LogHandle) -{ - g_return_if_fail(!captive_shared_cache_map_object || CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - /* FIXME: 'captive_shared_cache_map_object->LogHandle_set' may be set. - * Does it mean 'LogHandle_set' is 'FileObject'-based instead of 'SharedCacheMap'-based? - */ - - /* Do not: if (!LogHandle) - * return; - * See CcGetDirtyPages()/"W32 undocumented: What does mean LogHandle==NULL?" - */ - g_assert(!captive_LogHandle || !LogHandle || captive_LogHandle==LogHandle); - captive_LogHandle=LogHandle; - if (captive_shared_cache_map_object) - captive_shared_cache_map_object->LogHandle_set=!!LogHandle; -} - -void captive_shared_cache_map_set_FlushToLsnRoutine - (CaptiveSharedCacheMapObject *captive_shared_cache_map_object,PFLUSH_TO_LSN FlushToLsnRoutine) -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - /* FIXME: 'captive_shared_cache_map_object->FlushToLsnRoutine_set' may be set. - * Does it mean 'FlushToLsnRoutine_set' is 'FileObject'-based instead of 'SharedCacheMap'-based? - */ - - if (!FlushToLsnRoutine) - return; - g_assert(!captive_FlushToLsnRoutine || captive_FlushToLsnRoutine==FlushToLsnRoutine); - captive_FlushToLsnRoutine=FlushToLsnRoutine; - if (FlushToLsnRoutine) - captive_shared_cache_map_object->FlushToLsnRoutine_set=TRUE; -} - -static void captive_shared_cache_map_page_write(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset) -{ -LARGE_INTEGER offset_LargeInteger; -static gint64 lsn_last; -CaptiveSharedCacheMapObject_page *page; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object->FileObject!=NULL); - g_return_if_fail(offset<=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - g_return_if_fail(0==CAPTIVE_ROUND_DOWN_EXCEEDING64(offset,PAGE_SIZE)); - page=captive_shared_cache_map_object->pages+offset/PAGE_SIZE; - g_return_if_fail(page->data_valid); - g_return_if_fail(page->dirty); - - if (page->lsn_newest) { - /* sanity check */ - g_assert(!lsn_last || lsn_last<=page->lsn_newest); - lsn_last=page->lsn_newest; - - captive_stdcall_call_12((CaptiveStdCallFunc12)captive_FlushToLsnRoutine, - captive_LogHandle, - (gpointer)(guint32)(page->lsn_newest>> 0U), /* 'LARGE_INTEGER' argument */ - (gpointer)(guint32)(page->lsn_newest>>32U)); - } - - offset_LargeInteger.QuadPart=offset; - captive_Cc_IoPageWrite(captive_shared_cache_map_object->FileObject, - captive_shared_cache_map_object->buffer+offset,PAGE_SIZE,&offset_LargeInteger); - - page->dirty=FALSE; - page->lsn_oldest=0; - page->lsn_newest=0; -} - -typedef struct _captive_shared_cache_map_flush_lsn_sort captive_shared_cache_map_flush_lsn_sort; -struct _captive_shared_cache_map_flush_lsn_sort { - gint64 lsn; - CaptiveSharedCacheMapObject *captive_shared_cache_map_object; - guint64 offset; - }; - -typedef struct _captive_shared_cache_map_flush_lsn_pages_foreach_param - captive_shared_cache_map_flush_lsn_pages_foreach_param; -struct _captive_shared_cache_map_flush_lsn_pages_foreach_param { - gint64 lsn_target; - guint lsn_pages_count; - captive_shared_cache_map_flush_lsn_sort *lsn_pages_pointer; /* Not filled in if NULL */ - }; - -static void captive_shared_cache_map_flush_lsn_pages_foreach( - CaptiveSharedCacheMapObject *captive_shared_cache_map_object, /* key */ - CaptiveSharedCacheMapObject *captive_shared_cache_map_object_value, /* value */ - captive_shared_cache_map_flush_lsn_pages_foreach_param *param) /* user_data */ -{ -guint64 now; -CaptiveSharedCacheMapObject_page *page; - -#if 0 /* acceleration */ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object==captive_shared_cache_map_object_value); - g_return_if_fail(param!=NULL); -#endif - - for (now=0;nowAllocationSize;now+=PAGE_SIZE) { - page=captive_shared_cache_map_object->pages+now/PAGE_SIZE; - if (!page->data_valid) - continue; - if (!page->dirty) - continue; - if (!page->lsn_newest) - continue; - if (page->lsn_newest>param->lsn_target) - continue; - param->lsn_pages_count++; - if (!param->lsn_pages_pointer) - continue; - param->lsn_pages_pointer->lsn=page->lsn_newest; - param->lsn_pages_pointer->captive_shared_cache_map_object=captive_shared_cache_map_object; - param->lsn_pages_pointer->offset=now; - param->lsn_pages_pointer++; - } -} - -static int captive_shared_cache_map_flush_lsn_pages_compar - (const captive_shared_cache_map_flush_lsn_sort *a,const captive_shared_cache_map_flush_lsn_sort *b) -{ -#if 0 /* acceleration */ - g_return_val_if_fail(a!=NULL,0); - g_return_val_if_fail(b!=NULL,0); -#endif - - return (a->lsn>b->lsn)-(b->lsn>a->lsn); -} - -guint64 captive_shared_cache_map_flush(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end) -{ -guint64 flushed; -guint64 now; -gint64 lsn_target; -captive_shared_cache_map_flush_lsn_pages_foreach_param lsn_pages_foreach_param; -captive_shared_cache_map_flush_lsn_sort *lsn_pages_pointer; -const captive_shared_cache_map_flush_lsn_sort *lsn_page; -guint lsn_pages_count; - - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),0); - g_return_val_if_fail(start<=end,0); - - end=MIN(end,CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE)); - - start=CAPTIVE_ROUND_DOWN64(start,PAGE_SIZE); - end=CAPTIVE_ROUND_UP64(end,PAGE_SIZE); - - lsn_target=0; - for (now=start;nowpages+now/PAGE_SIZE; - if (!page->data_valid) - continue; - if (!page->dirty) - continue; - if (!page->lsn_newest) - continue; - if (!lsn_target || lsn_targetlsn_newest) - lsn_target=page->lsn_newest; - } - - CaptiveSharedCacheMapObject_hash_init(); - - lsn_pages_foreach_param.lsn_target=lsn_target; - lsn_pages_foreach_param.lsn_pages_count=0; - lsn_pages_foreach_param.lsn_pages_pointer=NULL; /* Not yet filling */ - g_hash_table_foreach( - CaptiveSharedCacheMapObject_hash, /* hash_table */ - (GHFunc)captive_shared_cache_map_flush_lsn_pages_foreach, /* func */ - &lsn_pages_foreach_param); /* user_data */ - - lsn_pages_count=lsn_pages_foreach_param.lsn_pages_count; - captive_newn(lsn_pages_pointer,lsn_pages_count); - g_assert(lsn_pages_foreach_param.lsn_target==lsn_target); - lsn_pages_foreach_param.lsn_pages_count=0; - lsn_pages_foreach_param.lsn_pages_pointer=lsn_pages_pointer; - g_hash_table_foreach( - CaptiveSharedCacheMapObject_hash, /* hash_table */ - (GHFunc)captive_shared_cache_map_flush_lsn_pages_foreach, /* func */ - &lsn_pages_foreach_param); /* user_data */ - - g_assert(lsn_pages_foreach_param.lsn_target==lsn_target); - g_assert(lsn_pages_foreach_param.lsn_pages_count==lsn_pages_count); - g_assert(lsn_pages_foreach_param.lsn_pages_pointer==lsn_pages_pointer+lsn_pages_count); - - qsort(lsn_pages_pointer,lsn_pages_count,sizeof(*lsn_pages_pointer), - (int (*)(const void *,const void *))captive_shared_cache_map_flush_lsn_pages_compar); - - flushed=0; - - for (lsn_page=lsn_pages_pointer;lsn_pagecaptive_shared_cache_map_object,lsn_page->offset); - if (lsn_page->captive_shared_cache_map_object==captive_shared_cache_map_object - && lsn_page->offset>=start && lsn_page->offsetpages+now/PAGE_SIZE; - if (!page->data_valid) - continue; - if (!page->dirty) - continue; - captive_shared_cache_map_page_write(captive_shared_cache_map_object,now); - flushed+=PAGE_SIZE; - } - - /* We were calling W32 code - recheck our task completion. */ - for (now=start;nowpages+now/PAGE_SIZE; - if (!page->data_valid) - continue; - g_assert(!page->dirty); - } - - return flushed; -} - -static void captive_shared_cache_map_flush_all_foreach_flush( - CaptiveSharedCacheMapObject *captive_shared_cache_map_object, /* key */ - CaptiveSharedCacheMapObject *captive_shared_cache_map_object_value, /* value */ - gboolean user_data) /* unused */ -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object==captive_shared_cache_map_object_value); - - captive_shared_cache_map_flush(captive_shared_cache_map_object,0,G_MAXUINT64-1); /* '-1' for overflow safety */ -} - -static void captive_shared_cache_map_flush_all_foreach_check( - CaptiveSharedCacheMapObject *captive_shared_cache_map_object, /* key */ - CaptiveSharedCacheMapObject *captive_shared_cache_map_object_value, /* value */ - gboolean user_data) /* unused */ -{ -guint64 start,end; -guint64 now; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object==captive_shared_cache_map_object_value); - - start=0; - end=CAPTIVE_ROUND_UP64(captive_shared_cache_map_object->AllocationSize,PAGE_SIZE); - - start=CAPTIVE_ROUND_DOWN64(start,PAGE_SIZE); - end=CAPTIVE_ROUND_UP64(end,PAGE_SIZE); - - /* We were calling W32 code - recheck our task completion. */ - for (now=start;nowpages+now/PAGE_SIZE; - if (!page->data_valid) - continue; - g_assert(!page->dirty); - } -} - -void captive_shared_cache_map_flush_all(void) -{ - CaptiveSharedCacheMapObject_hash_init(); - g_hash_table_foreach( - CaptiveSharedCacheMapObject_hash, /* hash_table */ - (GHFunc)captive_shared_cache_map_flush_all_foreach_flush, /* func */ - NULL); /* user_data; unused */ - g_hash_table_foreach( - CaptiveSharedCacheMapObject_hash, /* hash_table */ - (GHFunc)captive_shared_cache_map_flush_all_foreach_check, /* func */ - NULL); /* user_data; unused */ -} - -static void captive_shared_cache_map_is_any_dirty_foreach( - CaptiveSharedCacheMapObject *captive_shared_cache_map_object, /* key */ - CaptiveSharedCacheMapObject *captive_shared_cache_map_object_value, /* value */ - gboolean *dirty_foundp) /* user_data */ -{ -guint64 now; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object==captive_shared_cache_map_object_value); - g_return_if_fail(dirty_foundp!=NULL); - - for (now=0;nowAllocationSize;now+=PAGE_SIZE) { -CaptiveSharedCacheMapObject_page *page; - - page=captive_shared_cache_map_object->pages+now/PAGE_SIZE; - if (!page->data_valid) - continue; - if (!page->dirty) - continue; - *dirty_foundp=TRUE; /* FIXME: stop the traversal. */ - break; - } -} - - -gboolean captive_shared_cache_map_is_any_dirty(void) -{ -gboolean dirty_found; - - CaptiveSharedCacheMapObject_hash_init(); - dirty_found=FALSE; - g_hash_table_foreach( - CaptiveSharedCacheMapObject_hash, /* hash_table */ - (GHFunc)captive_shared_cache_map_is_any_dirty_foreach, /* func */ - &dirty_found); /* user_data */ - - return dirty_found; -} - - -typedef struct _captive_shared_cache_map_CcGetDirtyPages_foreach_param captive_shared_cache_map_CcGetDirtyPages_foreach_param; -struct _captive_shared_cache_map_CcGetDirtyPages_foreach_param { - PDIRTY_PAGE_ROUTINE DirtyPageRoutine; - VOID *Context1; - VOID *Context2; - gint64 result; - }; - -static void captive_shared_cache_map_CcGetDirtyPages_foreach( - CaptiveSharedCacheMapObject *captive_shared_cache_map_object, /* key */ - CaptiveSharedCacheMapObject *captive_shared_cache_map_object_value, /* value */ - captive_shared_cache_map_CcGetDirtyPages_foreach_param *param) /* user_data */ -{ -gint64 now; -CaptiveSharedCacheMapObject_page *page; - - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object->FileObject!=NULL); - g_return_if_fail(captive_shared_cache_map_object==captive_shared_cache_map_object_value); - g_return_if_fail(param!=NULL); - - for (now=CAPTIVE_ROUND_DOWN64(captive_shared_cache_map_object->AllocationSize-1,PAGE_SIZE);now>=0;now-=PAGE_SIZE) { -LARGE_INTEGER now_LargeInteger,lsn_oldest_LargeInteger,lsn_newest_LargeInteger; - - page=captive_shared_cache_map_object->pages+now/PAGE_SIZE; - if (!page->data_valid) - continue; - if (!page->dirty) - continue; - if (page->lsn_oldest && (!param->result || param->result>page->lsn_oldest)) - param->result=page->lsn_oldest; - - now_LargeInteger.QuadPart=now; - lsn_oldest_LargeInteger.QuadPart=page->lsn_oldest; - lsn_newest_LargeInteger.QuadPart=page->lsn_newest; - (*param->DirtyPageRoutine)( - captive_shared_cache_map_object->FileObject, /* FileObject */ - &now_LargeInteger, /* FileOffset */ - PAGE_SIZE, /* Length */ - &lsn_oldest_LargeInteger, /* OldestLsn */ - &lsn_newest_LargeInteger, /* NewestLsn */ - param->Context1, /* Context1 */ - param->Context2); /* Context2 */ - } -} - -gint64 captive_shared_cache_map_CcGetDirtyPages(PDIRTY_PAGE_ROUTINE DirtyPageRoutine,VOID *Context1,VOID *Context2) -{ -captive_shared_cache_map_CcGetDirtyPages_foreach_param param; - - g_return_val_if_fail(DirtyPageRoutine!=NULL,0); - - param.DirtyPageRoutine=DirtyPageRoutine; - param.Context1=Context1; - param.Context2=Context2; - param.result=0; - - CaptiveSharedCacheMapObject_hash_init(); - g_hash_table_foreach( - CaptiveSharedCacheMapObject_hash, /* hash_table */ - (GHFunc)captive_shared_cache_map_CcGetDirtyPages_foreach, /* func */ - ¶m); /* user_data */ - - return param.result; -} - -gpointer captive_shared_cache_map_get_buffer(CaptiveSharedCacheMapObject *captive_shared_cache_map_object) -{ - g_return_val_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object),NULL); - g_return_val_if_fail(captive_shared_cache_map_object->buffer!=NULL,NULL); - - return captive_shared_cache_map_object->buffer; -} - -static void captive_cc_FileObject_delete_foreach( - CaptiveSharedCacheMapObject *captive_shared_cache_map_object, /* key */ - CaptiveSharedCacheMapObject *captive_shared_cache_map_object_value, /* value */ - FILE_OBJECT *FileObject) /* user_data */ -{ - g_return_if_fail(CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(captive_shared_cache_map_object)); - g_return_if_fail(captive_shared_cache_map_object==captive_shared_cache_map_object_value); - g_return_if_fail(FileObject!=NULL); - - g_assert(FileObject!=captive_shared_cache_map_object->FileObject); -} - -BOOLEAN captive_cc_FileObject_delete(FILE_OBJECT *FileObject) -{ - g_return_val_if_fail(FileObject!=NULL,FALSE); - - CaptiveSharedCacheMapObject_hash_init(); - g_hash_table_foreach( - CaptiveSharedCacheMapObject_hash, /* hash_table */ - (GHFunc)captive_cc_FileObject_delete_foreach, /* func */ - FileObject); /* user_data */ - - return FALSE; /* FIXME: remove useless return code. */ -} diff --git a/src/libcaptive/cc/sharedcachemap.h b/src/libcaptive/cc/sharedcachemap.h deleted file mode 100644 index 9c0e309..0000000 --- a/src/libcaptive/cc/sharedcachemap.h +++ /dev/null @@ -1,81 +0,0 @@ -/* $Id$ - * Include file for reactos Cache Manager (Cc*) SharedCacheMap structure of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CC_SHARED_CACHE_MAP_H -#define _CAPTIVE_CC_SHARED_CACHE_MAP_H 1 - - -#include -#include -#include "reactos/ddk/cctypes.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT (captive_shared_cache_map_object_get_type()) -#define CAPTIVE_SHARED_CACHE_MAP_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT,CaptiveSharedCacheMapObject)) -#define CAPTIVE_SHARED_CACHE_MAP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT,CaptiveSharedCacheMapObjectClass)) -#define CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT)) -#define CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT)) -#define CAPTIVE_SHARED_CACHE_MAP_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT,CaptiveSharedCacheMapObjectClass)) -typedef struct _CaptiveSharedCacheMapObject CaptiveSharedCacheMapObject; -typedef struct _CaptiveSharedCacheMapObjectClass CaptiveSharedCacheMapObjectClass; - - -GType captive_shared_cache_map_object_get_type(void); - -CaptiveSharedCacheMapObject *captive_shared_cache_map_get_ref(FILE_OBJECT *FileObject, - const CC_FILE_SIZES *FileSizes,BOOLEAN PinAccess,const CACHE_MANAGER_CALLBACKS *CallBacks,VOID *LazyWriterContext); -void captive_shared_cache_map_FileSizes_set(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - const CC_FILE_SIZES *FileSizes); -CaptiveSharedCacheMapObject *captive_SectionObjectPointers_to_SharedCacheMap(SECTION_OBJECT_POINTERS *SectionObjectPointers); -CaptiveSharedCacheMapObject *captive_FileObject_to_SharedCacheMap(FILE_OBJECT *FileObject); -void captive_shared_cache_map_w32_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object); -void captive_shared_cache_map_w32_unref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object); -gint captive_shared_cache_map_query_w32_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object); -void captive_shared_cache_map_data_validate_read(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - FILE_OBJECT *FileObject,guint64 validate_start,guint64 validate_end); -void captive_shared_cache_map_data_validate_noread(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 validate_start,guint64 validate_end); -void captive_shared_cache_map_set_data_valid(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end); -void captive_shared_cache_map_set_data_invalid(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end); -void captive_shared_cache_map_set_dirty(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end); -guint64 captive_shared_cache_map_memory_range_set_dirty(gpointer address_start,gpointer address_end); -gboolean captive_shared_cache_map_is_page_dirty(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset); -void captive_shared_cache_map_page_set_lsn(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 offset,gint64 lsn); -void captive_shared_cache_map_purge(CaptiveSharedCacheMapObject *captive_shared_cache_map_object); -void captive_shared_cache_map_set_LogHandle(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,VOID *LogHandle); -void captive_shared_cache_map_set_FlushToLsnRoutine - (CaptiveSharedCacheMapObject *captive_shared_cache_map_object,PFLUSH_TO_LSN FlushToLsnRoutine); -guint64 captive_shared_cache_map_flush(CaptiveSharedCacheMapObject *captive_shared_cache_map_object, - guint64 start,guint64 end); -void captive_shared_cache_map_flush_all(void); -gboolean captive_shared_cache_map_is_any_dirty(void); -gint64 captive_shared_cache_map_CcGetDirtyPages(PDIRTY_PAGE_ROUTINE DirtyPageRoutine,VOID *Context1,VOID *Context2); -gpointer captive_shared_cache_map_get_buffer(CaptiveSharedCacheMapObject *captive_shared_cache_map_object); - -G_END_DECLS - - -#endif /* _CAPTIVE_CC_SHARED_CACHE_MAP_H */ diff --git a/src/libcaptive/client/Makefile.am b/src/libcaptive/client/Makefile.am deleted file mode 100644 index 55a700a..0000000 --- a/src/libcaptive/client/Makefile.am +++ /dev/null @@ -1,90 +0,0 @@ -# $Id$ -# automake source for the client interface of libcaptive Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -if HAVE_GNOME -standalone_gnome_cond= \ - standalone-gnome.c \ - standalone-gnome.h -endif - -noinst_LTLIBRARIES=libclient.la -libclient_la_SOURCES= \ - directory-parent.c \ - directory-parent.h \ - directory-slave.c \ - directory-slave.h \ - directory.c \ - directory.h \ - file-parent.c \ - file-parent.h \ - file-slave.c \ - file-slave.h \ - file.c \ - file.h \ - giochannel-blind.c \ - giochannel-blind.h \ - giochannel-subrange.c \ - giochannel-subrange.h \ - init.c \ - init.h \ - leave.c \ - lib.c \ - lib.h \ - libxml.c \ - options-module.c \ - options.c \ - parent-connector.c \ - parent-connector.h \ - result.c \ - result.h \ - standalone.c \ - standalone.h \ - usecount.c \ - vfs-parent.c \ - vfs-parent.h \ - vfs-slave.c \ - vfs-slave.h \ - vfs.c \ - vfs.h \ - $(MARSHALLERS) \ - $(standalone_gnome_cond) -libclient_la_CFLAGS= \ - $(GNOME_VFS_MODULE_CFLAGS) $(OPENSSL_CFLAGS) $(LIBXML_CFLAGS) -libclient_la_LIBADD= \ - $(GNOME_VFS_MODULE_LIBS) $(OPENSSL_LIBS) $(LIBXML_LIBS) - -marshallers.h: marshallers.list - $(GLIB_GENMARSHAL) --prefix=captive_client $< --header >$@ - -marshallers.c: marshallers.list - $(GLIB_GENMARSHAL) --prefix=captive_client $< --body >$@ - -EXTRA_DIST+= \ - marshallers.list -MARSHALLERS= \ - marshallers.c \ - marshallers.h -# 'BUILT_SOURCES' will force its building before any other compilation. -BUILT_SOURCES+=$(MARSHALLERS) -CLEANFILES+=$(MARSHALLERS) - -EXTRA_DIST +=options.pod.pl.in -noinst_DATA+=options.pod.pl diff --git a/src/libcaptive/client/directory-parent.c b/src/libcaptive/client/directory-parent.c deleted file mode 100644 index 796a05b..0000000 --- a/src/libcaptive/client/directory-parent.c +++ /dev/null @@ -1,333 +0,0 @@ -/* $Id$ - * captive vfs 'directory' interface to reactos of sandbox parent - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "directory-parent.h" /* self */ -#include -#include "../sandbox/parent-Directory.h" -#include "vfs-parent.h" -#include "parent-connector.h" - - -static gpointer captive_directory_parent_object_parent_class=NULL; - - -static GnomeVFSResult captive_directory_parent_close(CaptiveDirectoryObject *captive_directory_object); -static GnomeVFSResult captive_directory_parent_read - (CaptiveDirectoryObject *captive_directory_object,GnomeVFSFileInfo *file_info); -static GnomeVFSResult captive_directory_parent_remove(CaptiveDirectoryObject *captive_directory_object); - - -static void captive_directory_parent_object_dispose(CaptiveDirectoryParentObject *captive_directory_parent_object) -{ - g_return_if_fail(captive_directory_parent_object!=NULL); - - captive_directory_parent_close(CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object)); /* errors ignored */ - - if (captive_parent_connector_dispose(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object))) - return; - - G_OBJECT_CLASS(captive_directory_parent_object_parent_class)->dispose((GObject *)captive_directory_parent_object); -} - -static void captive_directory_parent_object_finalize(CaptiveDirectoryParentObject *captive_directory_parent_object) -{ - g_return_if_fail(captive_directory_parent_object!=NULL); - - captive_parent_connector_finalize(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)); - - g_free(captive_directory_parent_object->pathname); - captive_directory_parent_object->pathname=NULL; - - G_OBJECT_CLASS(captive_directory_parent_object_parent_class)->finalize((GObject *)captive_directory_parent_object); -} - -static void captive_directory_parent_object_class_init(CaptiveDirectoryParentObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); -CaptiveDirectoryObjectClass *captive_directory_object_class=CAPTIVE_DIRECTORY_OBJECT_CLASS(class); - - captive_directory_parent_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->dispose=(void (*)(GObject *object))captive_directory_parent_object_dispose; - gobject_class->finalize=(void (*)(GObject *object))captive_directory_parent_object_finalize; - - captive_directory_object_class->read=captive_directory_parent_read; - captive_directory_object_class->remove=captive_directory_parent_remove; -} - - -static GnomeVFSResult (*captive_directory_parent_object_captive_parent_connector_open_orig) - (CaptiveParentConnector *captive_parent_connector); -static GnomeVFSResult captive_directory_parent_object_captive_parent_connector_open - (CaptiveParentConnector *captive_parent_connector); - -static GnomeVFSResult captive_directory_parent_object_captive_parent_connector_close - (CaptiveParentConnector *captive_parent_connector); -static GnomeVFSResult (*captive_directory_parent_object_captive_parent_connector_close_orig) - (CaptiveParentConnector *captive_parent_connector); - -static G_CONST_RETURN gchar *captive_directory_parent_object_captive_parent_connector_get_pathname - (CaptiveParentConnector *captive_parent_connector); - -static void captive_directory_parent_object_captive_parent_connector_init(CaptiveParentConnectorIface *captive_parent_connector_iface) -{ - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR_CLASS(captive_parent_connector_iface)); - - captive_directory_parent_object_captive_parent_connector_open_orig=captive_parent_connector_iface->open; - captive_parent_connector_iface->open=captive_directory_parent_object_captive_parent_connector_open; - - captive_directory_parent_object_captive_parent_connector_close_orig=captive_parent_connector_iface->close; - captive_parent_connector_iface->close=captive_directory_parent_object_captive_parent_connector_close; - - captive_parent_connector_iface->get_pathname=captive_directory_parent_object_captive_parent_connector_get_pathname; -} - - -static void captive_directory_parent_object_init(CaptiveDirectoryParentObject *captive_directory_parent_object) -{ - g_return_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object)); -} - - -GType captive_directory_parent_object_get_type(void) -{ -static GType captive_directory_parent_object_type=0; - - if (!captive_directory_parent_object_type) { -static const GTypeInfo captive_directory_parent_object_info={ - sizeof(CaptiveDirectoryParentObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_directory_parent_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveDirectoryParentObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_directory_parent_object_init, - }; -static const GInterfaceInfo captive_parent_connector_info={ - (GInterfaceInitFunc)captive_directory_parent_object_captive_parent_connector_init, /* interface_init */ - NULL, /* interface_finalize */ - NULL, /* interface_data */ - }; - - captive_directory_parent_object_type=g_type_register_static(CAPTIVE_DIRECTORY_TYPE_OBJECT, - "CaptiveDirectoryParentObject",&captive_directory_parent_object_info,0); - g_type_add_interface_static(captive_directory_parent_object_type, - CAPTIVE_TYPE_PARENT_CONNECTOR,&captive_parent_connector_info); - } - - return captive_directory_parent_object_type; -} - - -static void captive_directory_parent_init - (CaptiveDirectoryParentObject *captive_directory_parent_object,CaptiveVfsObject *captive_vfs_object) -{ - g_return_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object)); - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object)); - - /* Order of captive_directory_init() and captive_parent_connector_init() - * should not matter as 'vfs' is passed by value to captive_parent_connector_init(). - */ - captive_directory_init(CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object),captive_vfs_object); - - captive_parent_connector_init( - CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object), /* captive_parent_connector */ - &captive_directory_parent_object->corba_Directory_object, /* corba_objectp */ - CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object)->vfs)); /* captive_vfs_parent_object */ -} - -GnomeVFSResult captive_directory_parent_new_open(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname) -{ -CaptiveDirectoryParentObject *captive_directory_parent_object; -GnomeVFSResult r; - - g_return_val_if_fail(captive_directory_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_parent_object=g_object_new( - CAPTIVE_DIRECTORY_PARENT_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - captive_directory_parent_object->pathname=g_strdup(pathname); - - captive_directory_parent_init(captive_directory_parent_object,captive_vfs_object); - - if (GNOME_VFS_OK!=(r=captive_parent_connector_connect(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)))) - return r; - - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_directory_new_open(captive_directory_parent_object))) { - g_object_unref(captive_directory_parent_object); - *captive_directory_object_return=NULL; - return r; - } - - *captive_directory_object_return=CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object); - return (*captive_directory_parent_object_captive_parent_connector_open_orig) - (CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)); -} - - -GnomeVFSResult captive_directory_parent_new_make(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,guint perm) -{ -CaptiveDirectoryParentObject *captive_directory_parent_object; -GnomeVFSResult r; - - g_return_val_if_fail(captive_directory_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_parent_object=g_object_new( - CAPTIVE_DIRECTORY_PARENT_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - captive_directory_parent_object->pathname=g_strdup(pathname); - - captive_directory_parent_init(captive_directory_parent_object,captive_vfs_object); - - if (GNOME_VFS_OK!=(r=captive_parent_connector_connect(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)))) - return r; - - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_directory_new_make(captive_directory_parent_object,perm))) { - g_object_unref(captive_directory_parent_object); - *captive_directory_object_return=NULL; - return r; - } - captive_parent_connector_set_dirty(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)); - - *captive_directory_object_return=CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object); - return (*captive_directory_parent_object_captive_parent_connector_open_orig) - (CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)); -} - - -static GnomeVFSResult captive_directory_parent_close(CaptiveDirectoryObject *captive_directory_object) -{ -CaptiveDirectoryParentObject *captive_directory_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_parent_object=CAPTIVE_DIRECTORY_PARENT_OBJECT(captive_directory_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)))) - break; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_parent_connector_close(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)))) - break; - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_directory_parent_object_captive_parent_connector_open - (CaptiveParentConnector *captive_parent_connector) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_directory_new_open(CAPTIVE_DIRECTORY_PARENT_OBJECT(captive_parent_connector)))) - return r; - - return (*captive_directory_parent_object_captive_parent_connector_open_orig)(captive_parent_connector); -} - - -static GnomeVFSResult captive_directory_parent_object_captive_parent_connector_close - (CaptiveParentConnector *captive_parent_connector) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_directory_close(CAPTIVE_DIRECTORY_PARENT_OBJECT(captive_parent_connector)))) - return r; - - return (*captive_directory_parent_object_captive_parent_connector_close_orig)(captive_parent_connector); -} - - -static G_CONST_RETURN gchar *captive_directory_parent_object_captive_parent_connector_get_pathname - (CaptiveParentConnector *captive_parent_connector) -{ -CaptiveDirectoryParentObject *captive_directory_parent_object; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),NULL); - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_parent_connector),NULL); - - captive_directory_parent_object=CAPTIVE_DIRECTORY_PARENT_OBJECT(captive_parent_connector); - - g_return_val_if_fail(captive_directory_parent_object->pathname!=NULL,NULL); - - return captive_directory_parent_object->pathname; -} - - -static GnomeVFSResult captive_directory_parent_read - (CaptiveDirectoryObject *captive_directory_object,GnomeVFSFileInfo *file_info) -{ -CaptiveDirectoryParentObject *captive_directory_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_parent_object=CAPTIVE_DIRECTORY_PARENT_OBJECT(captive_directory_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_directory_read(captive_directory_parent_object,file_info))) - return r; - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_directory_parent_remove(CaptiveDirectoryObject *captive_directory_object) -{ -CaptiveDirectoryParentObject *captive_directory_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_parent_object=CAPTIVE_DIRECTORY_PARENT_OBJECT(captive_directory_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE!=(r=captive_sandbox_parent_directory_remove(captive_directory_parent_object))) { - if (GNOME_VFS_OK==r) - captive_parent_connector_set_dirty(CAPTIVE_PARENT_CONNECTOR(captive_directory_parent_object)); - return r; - } - } while (!retried++); - return r; -} diff --git a/src/libcaptive/client/directory-parent.h b/src/libcaptive/client/directory-parent.h deleted file mode 100644 index 1f3d7be..0000000 --- a/src/libcaptive/client/directory-parent.h +++ /dev/null @@ -1,66 +0,0 @@ -/* $Id$ - * Include file for captive vfs 'directory' private interface to reactos of sandbox parent - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_DIRECTORY_PARENT_H -#define _CAPTIVE_CLIENT_PRIV_DIRECTORY_PARENT_H 1 - - -#include -#include -#include -#include "captive/client-directory.h" /* for CaptiveDirectoryObject */ -#include "directory.h" /* for CaptiveDirectoryObject priv */ -#include "../sandbox/sandbox.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_DIRECTORY_PARENT_TYPE_OBJECT (captive_directory_parent_object_get_type()) -#define CAPTIVE_DIRECTORY_PARENT_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_DIRECTORY_PARENT_TYPE_OBJECT,CaptiveDirectoryParentObject)) -#define CAPTIVE_DIRECTORY_PARENT_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_DIRECTORY_PARENT_TYPE_OBJECT,CaptiveDirectoryParentObjectClass)) -#define CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_DIRECTORY_PARENT_TYPE_OBJECT)) -#define CAPTIVE_DIRECTORY_PARENT_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_DIRECTORY_PARENT_TYPE_OBJECT)) -#define CAPTIVE_DIRECTORY_PARENT_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_DIRECTORY_PARENT_TYPE_OBJECT,CaptiveDirectoryParentObjectClass)) -typedef struct _CaptiveDirectoryParentObject CaptiveDirectoryParentObject; -typedef struct _CaptiveDirectoryParentObjectClass CaptiveDirectoryParentObjectClass; - - -GType captive_directory_parent_object_get_type(void); - -struct _CaptiveDirectoryParentObject { - CaptiveDirectoryObject parent_instance; - - /*< private >*/ - Captive_Directory corba_Directory_object; - GList *corba_Directory_file_info_list; /* contents */ - gchar *pathname; - }; -struct _CaptiveDirectoryParentObjectClass { - CaptiveDirectoryObjectClass parent_class; - }; - -GnomeVFSResult captive_directory_parent_new_open(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname); -GnomeVFSResult captive_directory_parent_new_make(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,guint perm); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_DIRECTORY_PARENT_H */ diff --git a/src/libcaptive/client/directory-slave.c b/src/libcaptive/client/directory-slave.c deleted file mode 100644 index 1a6f6b6..0000000 --- a/src/libcaptive/client/directory-slave.c +++ /dev/null @@ -1,513 +0,0 @@ -/* $Id$ - * captive vfs 'directory' interface to reactos of sandbox slave - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "directory-slave.h" /* self */ -#include "captive/client-directory.h" /* for CaptiveDirectoryObject */ -#include "directory.h" /* for CaptiveDirectoryObject priv */ -#include "lib.h" -#include -#include "captive/unicode.h" -#include "reactos/ntos/types.h" /* for HANDLE */ -#include "reactos/ddk/iotypes.h" /* for IO_STATUS_BLOCK */ -#include "reactos/ddk/iofuncs.h" /* for IoCreateFile() */ -#include "result.h" -#include "captive/leave.h" -#include "captive/usecount.h" -#include "vfs.h" -#include "vfs-slave.h" - - -static gpointer captive_directory_slave_object_parent_class=NULL; - -static GnomeVFSResult captive_directory_slave_close(CaptiveDirectoryObject *captive_directory_object); -static GnomeVFSResult captive_directory_slave_read - (CaptiveDirectoryObject *captive_directory_object,GnomeVFSFileInfo *file_info); -static GnomeVFSResult captive_directory_slave_remove(CaptiveDirectoryObject *captive_directory_object); - - -static void captive_directory_slave_object_finalize(CaptiveDirectorySlaveObject *captive_directory_slave_object) -{ - g_return_if_fail(captive_directory_slave_object!=NULL); - - captive_directory_slave_close(CAPTIVE_DIRECTORY_OBJECT(captive_directory_slave_object)); /* errors ignored */ - - G_OBJECT_CLASS(captive_directory_slave_object_parent_class)->finalize((GObject *)captive_directory_slave_object); -} - - -static void captive_directory_slave_object_class_init(CaptiveDirectorySlaveObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); -CaptiveDirectoryObjectClass *captive_directory_object_class=CAPTIVE_DIRECTORY_OBJECT_CLASS(class); - - captive_directory_slave_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_directory_slave_object_finalize; - captive_directory_object_class->read=captive_directory_slave_read; - captive_directory_object_class->remove=captive_directory_slave_remove; -} - - -static void captive_directory_slave_object_init(CaptiveDirectorySlaveObject *captive_directory_slave_object) -{ - captive_directory_slave_object->dir_Handle=NULL; - captive_directory_slave_object->read_first=TRUE; - captive_directory_slave_object->CaptiveDirectorySlaveObject_QueryDirectory_type= - CaptiveDirectorySlaveObject_QueryDirectory_type_FileIdBothDirInformation; -} - - -GType captive_directory_slave_object_get_type(void) -{ -static GType captive_directory_slave_object_type=0; - - if (!captive_directory_slave_object_type) { -static const GTypeInfo captive_directory_slave_object_info={ - sizeof(CaptiveDirectorySlaveObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_directory_slave_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveDirectorySlaveObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_directory_slave_object_init, - }; - - captive_directory_slave_object_type=g_type_register_static(CAPTIVE_DIRECTORY_TYPE_OBJECT, - "CaptiveDirectorySlaveObject",&captive_directory_slave_object_info,0); - } - - return captive_directory_slave_object_type; -} - - -static GnomeVFSResult captive_directory_slave_new_internal - (CaptiveDirectorySlaveObject *captive_directory_slave_object,const gchar *pathname,gboolean create,guint create_perm) -{ -GnomeVFSResult errvfsresult; -OBJECT_ATTRIBUTES dir_ObjectAttributes; -HANDLE dir_Handle; -IO_STATUS_BLOCK dir_IoStatusBlock; -NTSTATUS err; - - g_return_val_if_fail(captive_directory_slave_object!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_ObjectAttributes_init(pathname,&dir_ObjectAttributes); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - /* wanted: * IoCreateFile()->ObCreateObject(,,,IoFileObjectType)-> - * ->(IoFileObjectType->Create==IopCreateFile)()->IoMountVolume() - */ - err=IoCreateFile( - &dir_Handle, /* FileHandle */ - FILE_LIST_DIRECTORY, /* DesiredAccess */ - &dir_ObjectAttributes, /* ObjectAttributes */ - &dir_IoStatusBlock, /* IoStatusBlock */ - NULL, /* AllocationSize; ignored for open */ - (!create || create_perm&0200 ? FILE_ATTRIBUTE_NORMAL: FILE_ATTRIBUTE_READONLY), /* FileAttributes; ignored for open */ - (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE), /* ShareAccess; 0 means exclusive */ - (!create ? FILE_OPEN : FILE_CREATE), /* CreateDisposition */ - /* FILE_SYNCHRONOUS_IO_{,NON}ALERT: We need to allow W32 filesystem - * any waits to not to let it return STATUS_CANT_WAIT us. - * Alertability should have only effect on asynchronous events - * from KeWaitForSingleObject() by setting/clearing its parameter 'Alertable'. - */ - FILE_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_ALERT, /* CreateOptions */ - NULL, /* EaBuffer */ - 0, /* EaLength */ - CreateFileTypeNone, /* CreateFileType */ - NULL, /* ExtraCreateParameters */ - 0); /* Options */ - g_free(dir_ObjectAttributes.ObjectName); /* left from captive_gnomevfs_uri_parent_init() */ - g_return_val_if_fail(NT_SUCCESS(err)==NT_SUCCESS(dir_IoStatusBlock.Status),GNOME_VFS_ERROR_GENERIC); - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(dir_IoStatusBlock.Information - ==(!create ? FILE_OPENED : FILE_CREATED), - GNOME_VFS_ERROR_GENERIC); - - captive_directory_slave_object->dir_Handle=dir_Handle; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_directory_slave_new_open(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname) -{ -GnomeVFSResult r; -CaptiveDirectorySlaveObject *captive_directory_slave_object; - - g_return_val_if_fail(captive_directory_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_slave_object=g_object_new( - CAPTIVE_DIRECTORY_SLAVE_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - - captive_directory_init(CAPTIVE_DIRECTORY_OBJECT(captive_directory_slave_object),captive_vfs_object); - - *captive_directory_object_return=CAPTIVE_DIRECTORY_OBJECT(captive_directory_slave_object); - - r=captive_directory_slave_new_internal(captive_directory_slave_object,pathname, - FALSE, /* create */ - 0); /* create_perm; ignored */ - - captive_leave(); - if (r==GNOME_VFS_OK) - captive_usecount(+1); - else { - g_object_unref(captive_directory_slave_object); - *captive_directory_object_return=NULL; - } - return r; -} - - -GnomeVFSResult captive_directory_slave_new_make(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,guint perm) -{ -GnomeVFSResult r; -CaptiveDirectorySlaveObject *captive_directory_slave_object; - - g_return_val_if_fail(captive_directory_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_slave_object=g_object_new( - CAPTIVE_DIRECTORY_SLAVE_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - - captive_directory_init(CAPTIVE_DIRECTORY_OBJECT(captive_directory_slave_object),captive_vfs_object); - - *captive_directory_object_return=CAPTIVE_DIRECTORY_OBJECT(captive_directory_slave_object); - - r=captive_directory_slave_new_internal(captive_directory_slave_object,pathname, - TRUE, /* create */ - perm); /* create_perm; ignored */ - - captive_leave(); - if (r==GNOME_VFS_OK) - captive_usecount(+1); - else { - g_object_unref(captive_directory_slave_object); - *captive_directory_object_return=NULL; - } - return r; -} - - -static GnomeVFSResult FileIdBothDirInformation_to_GnomeVFSFileInfo(GnomeVFSFileInfo *file_info, - FILE_ID_BOTH_DIR_INFORMATION *FileIdBothDirInformation,IO_STATUS_BLOCK *IoStatusBlock) -{ -UNICODE_STRING FileName_UnicodeString; -ULONG tmp_ULONG; - - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(FileIdBothDirInformation!=NULL,GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(IoStatusBlock!=NULL,GNOME_VFS_ERROR_GENERIC); - - g_return_val_if_fail(NT_SUCCESS(IoStatusBlock->Status),GNOME_VFS_ERROR_GENERIC); - /* do not exceed the returned buffer by this record; Redundant now, see below. */ - g_assert((gpointer)(((char *)FileIdBothDirInformation)+FileIdBothDirInformation->NextEntryOffset) - <=(gpointer)(((char *)FileIdBothDirInformation)+IoStatusBlock->Information)); - /* '->NextEntryOffset' is ==0 as we used 'ReturnSingleEntry==TRUE' */ - g_assert(FileIdBothDirInformation->NextEntryOffset==0); - - file_info->valid_fields=0; - - FileName_UnicodeString.Length=FileIdBothDirInformation->FileNameLength; - FileName_UnicodeString.MaximumLength=FileIdBothDirInformation->FileNameLength - +sizeof(*FileIdBothDirInformation->FileName); /* 0-terminator */ - g_assert((gpointer)(((char *)FileIdBothDirInformation->FileName)+FileName_UnicodeString.Length) - <=(gpointer)(((char *)FileIdBothDirInformation)+IoStatusBlock->Information)); - /* ensure we fit below '->IoStatusBlock->Information' at least without the 0-terminator */ - FileIdBothDirInformation->FileName[FileIdBothDirInformation->FileNameLength - /sizeof(*FileIdBothDirInformation->FileName)]=0; /* 0-terminate it */ - FileName_UnicodeString.Buffer=FileIdBothDirInformation->FileName; - file_info->name=captive_UnicodeString_to_utf8_malloc(&FileName_UnicodeString); - /* '->name' assumed for 'file_info->valid_fields' */ - - /* FIXME: What is 'FILE_ATTRIBUTE_NORMAL'? */ - switch (FileIdBothDirInformation->FileAttributes & (0 - | FILE_ATTRIBUTE_DIRECTORY - | FILE_ATTRIBUTE_DEVICE)) { - case 0: file_info->type=GNOME_VFS_FILE_TYPE_REGULAR; break; - case FILE_ATTRIBUTE_DIRECTORY: file_info->type=GNOME_VFS_FILE_TYPE_DIRECTORY; break; - case FILE_ATTRIBUTE_DEVICE: file_info->type=GNOME_VFS_FILE_TYPE_SOCKET; - /* or GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE or GNOME_VFS_FILE_TYPE_BLOCK_DEVICE ? */ - break; - default: file_info->type=GNOME_VFS_FILE_TYPE_UNKNOWN; break; - } - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_TYPE; - - /* we use 0600 for r/w files, 0400 for FILE_ATTRIBUTE_READONLY */ - file_info->permissions=GNOME_VFS_PERM_USER_READ; - if (file_info->type==GNOME_VFS_FILE_TYPE_DIRECTORY) - file_info->permissions|=GNOME_VFS_PERM_USER_EXEC; - if (!(FileIdBothDirInformation->FileAttributes & FILE_ATTRIBUTE_READONLY)) - file_info->permissions|=GNOME_VFS_PERM_USER_WRITE; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS; - - file_info->size=FileIdBothDirInformation->EndOfFile.QuadPart; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_SIZE; - - file_info->block_count=FileIdBothDirInformation->AllocationSize.QuadPart/512; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT; - - file_info->flags=GNOME_VFS_FILE_FLAGS_LOCAL; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_FLAGS; - - if (FileIdBothDirInformation->LastAccessTime.QuadPart) { /* it may be 0 if not set */ - if (RtlTimeToSecondsSince1970(&FileIdBothDirInformation->LastAccessTime,&tmp_ULONG)) { - file_info->atime=tmp_ULONG; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_ATIME; - } - } - - /* it may be 0 if not set */ - if (FileIdBothDirInformation->LastWriteTime.QuadPart || FileIdBothDirInformation->ChangeTime.QuadPart) { - if (RtlTimeToSecondsSince1970( - /* take the more recent (==bigger) time: */ - (FileIdBothDirInformation->LastWriteTime.QuadPart > FileIdBothDirInformation->ChangeTime.QuadPart - ? &FileIdBothDirInformation->LastWriteTime : &FileIdBothDirInformation->ChangeTime), - &tmp_ULONG)) { - file_info->mtime=tmp_ULONG; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_MTIME; - } - } - - if (FileIdBothDirInformation->CreationTime.QuadPart) { /* it may be 0 if not set */ - if (RtlTimeToSecondsSince1970(&FileIdBothDirInformation->CreationTime,&tmp_ULONG)) { - file_info->ctime=tmp_ULONG; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_CTIME; - } - } - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult FileBothDirInformation_to_FileIdBothDirInformation(FILE_ID_BOTH_DIR_INFORMATION *FileIdBothDirInformation, - FILE_BOTH_DIR_INFORMATION *FileBothDirInformation,IO_STATUS_BLOCK *IoStatusBlock) -{ -static LARGE_INTEGER FileId_counter; - - g_return_val_if_fail(FileIdBothDirInformation!=NULL,GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(FileBothDirInformation!=NULL,GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(IoStatusBlock!=NULL,GNOME_VFS_ERROR_GENERIC); - - g_return_val_if_fail(NT_SUCCESS(IoStatusBlock->Status),GNOME_VFS_ERROR_GENERIC); - /* do not exceed the returned buffer by this record; Redundant now, see below. */ - g_assert((gpointer)(((char *)FileBothDirInformation)+FileBothDirInformation->NextEntryOffset) - <=(gpointer)(((char *)FileBothDirInformation)+IoStatusBlock->Information)); - /* '->NextEntryOffset' is ==0 as we used 'ReturnSingleEntry==TRUE' */ - g_assert(FileBothDirInformation->NextEntryOffset==0); - - g_assert((gpointer)(((char *)FileBothDirInformation->FileName)+FileBothDirInformation->FileNameLength) - <=(gpointer)(((char *)FileBothDirInformation)+IoStatusBlock->Information)); - /* ensure we fit below '->IoStatusBlock->Information' at least without the 0-terminator */ - memcpy(FileIdBothDirInformation->FileName,FileBothDirInformation->FileName, - FileBothDirInformation->FileNameLength); - - /* NextEntryOffset already handled */ - FileIdBothDirInformation->FileIndex =FileBothDirInformation->FileIndex; - FileIdBothDirInformation->CreationTime =FileBothDirInformation->CreationTime; - FileIdBothDirInformation->LastAccessTime =FileBothDirInformation->LastAccessTime; - FileIdBothDirInformation->LastWriteTime =FileBothDirInformation->LastWriteTime; - FileIdBothDirInformation->ChangeTime =FileBothDirInformation->ChangeTime; - FileIdBothDirInformation->EndOfFile =FileBothDirInformation->EndOfFile; - FileIdBothDirInformation->AllocationSize =FileBothDirInformation->AllocationSize; - FileIdBothDirInformation->FileAttributes =FileBothDirInformation->FileAttributes; - FileIdBothDirInformation->FileNameLength =FileBothDirInformation->FileNameLength; - FileIdBothDirInformation->EaSize =FileBothDirInformation->EaSize; - FileIdBothDirInformation->ShortNameLength=FileBothDirInformation->ShortNameLength; - g_assert(sizeof(FileIdBothDirInformation->ShortName)==sizeof(FileBothDirInformation->ShortName)); - memcpy(FileIdBothDirInformation->ShortName,FileBothDirInformation->ShortName, - sizeof(FileBothDirInformation->ShortName)); - /* FIXME: Register filenames for uniqueness; - * Not needed now as 'FileId' field not used by libcaptive anywhere anyway. - */ - FileIdBothDirInformation->FileId.QuadPart=FileId_counter.QuadPart++; - /* FileName already handled */ - - IoStatusBlock->Information=sizeof(*FileIdBothDirInformation)+FileIdBothDirInformation->FileNameLength; - /* '->NextEntryOffset' is ==0 as we used 'ReturnSingleEntry==TRUE' */ - FileIdBothDirInformation->NextEntryOffset=0; - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_directory_slave_close(CaptiveDirectoryObject *captive_directory_object) -{ -CaptiveDirectorySlaveObject *captive_directory_slave_object; -NTSTATUS err; -HANDLE dir_Handle; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_SLAVE_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_slave_object=CAPTIVE_DIRECTORY_SLAVE_OBJECT(captive_directory_object); - - if (captive_directory_slave_object->dir_Handle!=NULL) { /* not yet already closed */ - captive_usecount(-1); /* close() errors notwithstanding */ - - dir_Handle=captive_directory_slave_object->dir_Handle; - captive_directory_slave_object->dir_Handle=NULL; - err=NtClose(dir_Handle); - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - } - - captive_leave(); - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_directory_slave_read - (CaptiveDirectoryObject *captive_directory_object,GnomeVFSFileInfo *file_info) -{ -CaptiveDirectorySlaveObject *captive_directory_slave_object; -NTSTATUS err; -IO_STATUS_BLOCK dir_IoStatusBlock; -FILE_ID_BOTH_DIR_INFORMATION *FileIdBothDirInformation; -FILE_BOTH_DIR_INFORMATION *FileBothDirInformation; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_SLAVE_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_slave_object=CAPTIVE_DIRECTORY_SLAVE_OBJECT(captive_directory_object); - - g_return_val_if_fail(captive_directory_slave_object->dir_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - FileIdBothDirInformation=(void *)captive_directory_slave_object->QueryDirectory_buf.FileIdBothDirInformation; -retry: - switch (captive_directory_slave_object->CaptiveDirectorySlaveObject_QueryDirectory_type) { - - case CaptiveDirectorySlaveObject_QueryDirectory_type_FileIdBothDirInformation: - err=NtQueryDirectoryFile( - captive_directory_slave_object->dir_Handle, /* FileHandle */ - NULL, /* PEvent; completion signalling; optional */ - NULL, /* ApcRoutine; optional */ - NULL, /* ApcContext; optional */ - &dir_IoStatusBlock, /* IoStatusBlock */ - (gpointer)captive_directory_slave_object->QueryDirectory_buf.FileIdBothDirInformation, /* FileInformation */ - sizeof(captive_directory_slave_object->QueryDirectory_buf.FileIdBothDirInformation) /* Length */ - -sizeof(*FileIdBothDirInformation->FileName), /* reserve space for 0-terminator */ - FileIdBothDirectoryInformation, /* FileInformationClass; =>FILE_ID_BOTH_DIR_INFORMATION */ - TRUE, /* ReturnSingleEntry */ - NULL, /* FileName; wildcards possible; optional */ - captive_directory_slave_object->read_first); /* RestartScan */ - if (err==STATUS_NO_SUCH_FILE) { - /* 'FileIdBothDirInformation' not supported at least by ext2fsd.sys. - * Emulate it from 'FileBothDirectoryInformation' here. - */ - captive_directory_slave_object->CaptiveDirectorySlaveObject_QueryDirectory_type= - CaptiveDirectorySlaveObject_QueryDirectory_type_FileBothDirInformation; - goto retry; - } - - captive_directory_slave_object->read_first=FALSE; - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - break; - - case CaptiveDirectorySlaveObject_QueryDirectory_type_FileBothDirInformation: - FileBothDirInformation=(void *)captive_directory_slave_object->QueryDirectory_buf.FileBothDirInformation; - /* SL_INDEX_SPECIFIED is forbidden for ext2fsd.sys-V0.10A although - * IIRC it was required for the native W32 filesystems. - * Fortunately 'FileBothDirInformation' is just a workaround for ext2fsd.sys-V0.10A - * which is not used for the native W32 filesystems and therefore it should be safe. - * WARNING: Hack with 'FileIndex==0' to prevent SL_INDEX_SPECIFIED is just libcaptive - * specific hack of reactos! See also NtQueryDirectoryFile(). - */ - FileBothDirInformation->FileIndex=0; - err=NtQueryDirectoryFile( - captive_directory_slave_object->dir_Handle, /* FileHandle */ - NULL, /* PEvent; completion signalling; optional */ - NULL, /* ApcRoutine; optional */ - NULL, /* ApcContext; optional */ - &dir_IoStatusBlock, /* IoStatusBlock */ - (gpointer)captive_directory_slave_object->QueryDirectory_buf.FileBothDirInformation, /* FileInformation */ - sizeof(captive_directory_slave_object->QueryDirectory_buf.FileBothDirInformation) /* Length */ - -sizeof(*FileBothDirInformation->FileName), /* reserve space for 0-terminator */ - FileBothDirectoryInformation, /* FileInformationClass; =>FILE_BOTH_DIR_INFORMATION */ - TRUE, /* ReturnSingleEntry */ - NULL, /* FileName; wildcards possible; optional */ - captive_directory_slave_object->read_first); /* RestartScan */ - - captive_directory_slave_object->read_first=FALSE; - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) { - /* Do not reset 'read_first' on 'STATUS_NO_SUCH_FILE' to leave us stuck at EOF - GnomeVFS behaves that way. */ - return errvfsresult; - } - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - - errvfsresult=FileBothDirInformation_to_FileIdBothDirInformation(FileIdBothDirInformation,FileBothDirInformation, - &dir_IoStatusBlock); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - break; - - default: g_assert_not_reached(); - } - - errvfsresult=FileIdBothDirInformation_to_GnomeVFSFileInfo(file_info,FileIdBothDirInformation, - &dir_IoStatusBlock); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - captive_leave(); - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_directory_slave_remove(CaptiveDirectoryObject *captive_directory_object) -{ -CaptiveDirectorySlaveObject *captive_directory_slave_object; -NTSTATUS err; -FILE_DISPOSITION_INFORMATION FileDispositionInformation_struct; -IO_STATUS_BLOCK dir_IoStatusBlock; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_SLAVE_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_directory_slave_object=CAPTIVE_DIRECTORY_SLAVE_OBJECT(captive_directory_object); - - g_return_val_if_fail(captive_directory_slave_object->dir_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - FileDispositionInformation_struct.DoDeleteFile=TRUE; - - err=NtSetInformationFile( - captive_directory_slave_object->dir_Handle, /* FileHandle */ - &dir_IoStatusBlock, /* IoStatusBlock */ - &FileDispositionInformation_struct, /* FileInformation */ - sizeof(FileDispositionInformation_struct), /* Length */ - FileDispositionInformation); /* FileInformationClass */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - - captive_leave(); - return GNOME_VFS_OK; -} diff --git a/src/libcaptive/client/directory-slave.h b/src/libcaptive/client/directory-slave.h deleted file mode 100644 index 12dedc5..0000000 --- a/src/libcaptive/client/directory-slave.h +++ /dev/null @@ -1,83 +0,0 @@ -/* $Id$ - * Include file for captive vfs 'directory' private interface to reactos of sandbox slave - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_DIRECTORY_SLAVE_H -#define _CAPTIVE_CLIENT_PRIV_DIRECTORY_SLAVE_H 1 - - -#include -#include -#include -#include -#include "captive/client-directory.h" /* for CaptiveDirectoryObject */ -#include "directory.h" /* for CaptiveDirectoryObject priv */ -#include "reactos/ntos/types.h" /* for HANDLE */ -#include "reactos/ntos/zwtypes.h" /* for FILE_ID_BOTH_DIR_INFORMATION */ - - -G_BEGIN_DECLS - -#define CAPTIVE_DIRECTORY_SLAVE_TYPE_OBJECT (captive_directory_slave_object_get_type()) -#define CAPTIVE_DIRECTORY_SLAVE_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_DIRECTORY_SLAVE_TYPE_OBJECT,CaptiveDirectorySlaveObject)) -#define CAPTIVE_DIRECTORY_SLAVE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_DIRECTORY_SLAVE_TYPE_OBJECT,CaptiveDirectorySlaveObjectClass)) -#define CAPTIVE_DIRECTORY_SLAVE_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_DIRECTORY_SLAVE_TYPE_OBJECT)) -#define CAPTIVE_DIRECTORY_SLAVE_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_DIRECTORY_SLAVE_TYPE_OBJECT)) -#define CAPTIVE_DIRECTORY_SLAVE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_DIRECTORY_SLAVE_TYPE_OBJECT,CaptiveDirectorySlaveObjectClass)) -typedef struct _CaptiveDirectorySlaveObject CaptiveDirectorySlaveObject; -typedef struct _CaptiveDirectorySlaveObjectClass CaptiveDirectorySlaveObjectClass; - - -GType captive_directory_slave_object_get_type(void); - -struct _CaptiveDirectorySlaveObject { - CaptiveDirectoryObject parent_instance; - - /*< private >*/ - HANDLE dir_Handle; - gboolean read_first; - /* 'QueryDirectory_buf' for NtQueryDirectoryFile() must be persistent - * to keep the state if !read_first. - * Both types of 'QueryDirectory_buf' MUST NOT be 'union' as we convert - * them by copying one to other. - */ - struct { - char FileIdBothDirInformation[sizeof(FILE_ID_BOTH_DIR_INFORMATION) - +0x1000 /* max 'FileName' length, 255 should be enough */ * sizeof(WCHAR /* *FILE_ID_BOTH_DIR_INFORMATION.FileName */ )]; - char FileBothDirInformation[sizeof(FILE_BOTH_DIR_INFORMATION) - +0x1000 /* max 'FileName' length, 255 should be enough */ * sizeof(WCHAR /* *FILE_ID_BOTH_DIR_INFORMATION.FileName */ )]; - } QueryDirectory_buf; - enum { - CaptiveDirectorySlaveObject_QueryDirectory_type_FileIdBothDirInformation, - CaptiveDirectorySlaveObject_QueryDirectory_type_FileBothDirInformation, - } CaptiveDirectorySlaveObject_QueryDirectory_type; - }; -struct _CaptiveDirectorySlaveObjectClass { - CaptiveDirectoryObjectClass parent_class; - }; - - -GnomeVFSResult captive_directory_slave_new_open(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname); -GnomeVFSResult captive_directory_slave_new_make(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,guint perm); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_DIRECTORY_SLAVE_H */ diff --git a/src/libcaptive/client/directory.c b/src/libcaptive/client/directory.c deleted file mode 100644 index eacc458..0000000 --- a/src/libcaptive/client/directory.c +++ /dev/null @@ -1,159 +0,0 @@ -/* $Id$ - * captive vfs 'directory' interface to reactos - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/client-directory.h" /* self */ -#include "directory.h" /* self-priv */ -#include -#include "vfs.h" - - -static gpointer captive_directory_object_parent_class=NULL; - - -static GnomeVFSResult captive_directory_close(CaptiveDirectoryObject *captive_directory_object); - -static void captive_directory_object_finalize(CaptiveDirectoryObject *captive_directory_object) -{ - g_return_if_fail(captive_directory_object!=NULL); - - captive_directory_close(captive_directory_object); /* errors ignored */ - - G_OBJECT_CLASS(captive_directory_object_parent_class)->finalize((GObject *)captive_directory_object); -} - - -static void captive_directory_object_class_init(CaptiveDirectoryObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); - - captive_directory_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_directory_object_finalize; -} - - -static void captive_directory_object_init(CaptiveDirectoryObject *captive_directory_object) -{ -} - - -GType captive_directory_object_get_type(void) -{ -static GType captive_directory_object_type=0; - - if (!captive_directory_object_type) { -static const GTypeInfo captive_directory_object_info={ - sizeof(CaptiveDirectoryObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_directory_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveDirectoryObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_directory_object_init, - }; - - captive_directory_object_type=g_type_register_static(G_TYPE_OBJECT, - "CaptiveDirectoryObject",&captive_directory_object_info,G_TYPE_FLAG_ABSTRACT); - } - - return captive_directory_object_type; -} - - -GnomeVFSResult captive_directory_new_open(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname) -{ - g_return_val_if_fail(captive_directory_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_VFS_OBJECT_GET_CLASS(captive_vfs_object)->directory_new_open) - (captive_directory_object_return,captive_vfs_object,pathname); -} - - -GnomeVFSResult captive_directory_new_make(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,guint perm) -{ - g_return_val_if_fail(captive_directory_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_VFS_OBJECT_GET_CLASS(captive_vfs_object)->directory_new_make) - (captive_directory_object_return,captive_vfs_object,pathname,perm); -} - - -GnomeVFSResult captive_directory_init(CaptiveDirectoryObject *captive_directory_object,CaptiveVfsObject *captive_vfs_object) -{ - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_directory_object->vfs==NULL,GNOME_VFS_ERROR_GENERIC); - - captive_directory_object->vfs=g_object_ref(captive_vfs_object); - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_directory_close(CaptiveDirectoryObject *captive_directory_object) -{ - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (captive_directory_object->vfs!=NULL) { - g_assert(CAPTIVE_VFS_IS_OBJECT(captive_directory_object->vfs)); - g_object_unref(captive_directory_object->vfs); - captive_directory_object->vfs=NULL; - } - - return GNOME_VFS_OK; -} - - -CaptiveVfsObject *captive_directory_ref_vfs(CaptiveDirectoryObject *captive_directory_object) -{ - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),NULL); - - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_directory_object->vfs),NULL); - - return g_object_ref(captive_directory_object->vfs); -} - - -GnomeVFSResult captive_directory_read(CaptiveDirectoryObject *captive_directory_object,GnomeVFSFileInfo *file_info) -{ - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_DIRECTORY_OBJECT_GET_CLASS(captive_directory_object)->read) - (captive_directory_object,file_info); -} - - -GnomeVFSResult captive_directory_remove(CaptiveDirectoryObject *captive_directory_object) -{ - g_return_val_if_fail(CAPTIVE_DIRECTORY_IS_OBJECT(captive_directory_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_DIRECTORY_OBJECT_GET_CLASS(captive_directory_object)->remove) - (captive_directory_object); -} diff --git a/src/libcaptive/client/directory.h b/src/libcaptive/client/directory.h deleted file mode 100644 index 59da556..0000000 --- a/src/libcaptive/client/directory.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ - * Include file for captive vfs 'directory' private interface to reactos - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_DIRECTORY_H -#define _CAPTIVE_CLIENT_PRIV_DIRECTORY_H 1 - - -#include -#include -#include "captive/client-vfs.h" -#include "captive/client-directory.h" - - -G_BEGIN_DECLS - -struct _CaptiveDirectoryObject { - GObject parent_instance; - - /*< private >*/ - CaptiveVfsObject *vfs; - }; -struct _CaptiveDirectoryObjectClass { - GObjectClass parent_class; - - GnomeVFSResult (*read)(CaptiveDirectoryObject *captive_directory_object,GnomeVFSFileInfo *file_info); - GnomeVFSResult (*remove)(CaptiveDirectoryObject *captive_directory_object); - }; - -GnomeVFSResult captive_directory_init(CaptiveDirectoryObject *captive_directory_object,CaptiveVfsObject *captive_vfs_object); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_DIRECTORY_H */ diff --git a/src/libcaptive/client/file-parent.c b/src/libcaptive/client/file-parent.c deleted file mode 100644 index 038bdc5..0000000 --- a/src/libcaptive/client/file-parent.c +++ /dev/null @@ -1,602 +0,0 @@ -/* $Id$ - * captive vfs 'file' interface to reactos of sandbox parent - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "file-parent.h" /* self */ -#include -#include "../sandbox/parent-File.h" -#include "vfs-parent.h" -#include "reactos/ntos/types.h" /* for ULONG */ -#include "parent-connector.h" -#include "captive/client.h" /* for captive_path_normalize() */ -#include - - -static gpointer captive_file_parent_object_parent_class=NULL; - - -static GnomeVFSResult captive_file_parent_close(CaptiveFileObject *captive_file_object); -static GnomeVFSResult captive_file_parent_read(CaptiveFileObject *captive_file_object, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return); -static GnomeVFSResult captive_file_parent_write(CaptiveFileObject *captive_file_object, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return); -static GnomeVFSResult captive_file_parent_seek - (CaptiveFileObject *captive_file_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset); -static GnomeVFSResult captive_file_parent_tell(CaptiveFileObject *captive_file_object,GnomeVFSFileOffset *offset_return); -static GnomeVFSResult captive_file_parent_remove(CaptiveFileObject *captive_file_object); -static GnomeVFSResult captive_file_parent_file_info_get - (CaptiveFileObject *captive_file_object,GnomeVFSFileInfo *file_info); -static GnomeVFSResult captive_file_parent_file_info_set - (CaptiveFileObject *captive_file_object,const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask); -static GnomeVFSResult captive_file_parent_truncate(CaptiveFileObject *captive_file_object,GnomeVFSFileSize file_size); -static GnomeVFSResult captive_file_parent_move - (CaptiveFileObject *captive_file_object_old,const gchar *pathname_new,gboolean force_replace); - - -static void captive_file_parent_object_dispose(CaptiveFileParentObject *captive_file_parent_object) -{ - g_return_if_fail(captive_file_parent_object!=NULL); - - captive_file_parent_close(CAPTIVE_FILE_OBJECT(captive_file_parent_object)); /* errors ignored */ - - if (captive_parent_connector_dispose(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object))) - return; - - G_OBJECT_CLASS(captive_file_parent_object_parent_class)->dispose((GObject *)captive_file_parent_object); -} - -static void captive_file_parent_object_finalize(CaptiveFileParentObject *captive_file_parent_object) -{ - g_return_if_fail(captive_file_parent_object!=NULL); - - captive_parent_connector_finalize(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)); - - g_free(captive_file_parent_object->pathname); - captive_file_parent_object->pathname=NULL; - - G_OBJECT_CLASS(captive_file_parent_object_parent_class)->finalize((GObject *)captive_file_parent_object); -} - -static void captive_file_parent_object_class_init(CaptiveFileParentObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); -CaptiveFileObjectClass *captive_file_object_class=CAPTIVE_FILE_OBJECT_CLASS(class); - - captive_file_parent_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->dispose=(void (*)(GObject *object))captive_file_parent_object_dispose; - gobject_class->finalize=(void (*)(GObject *object))captive_file_parent_object_finalize; - - captive_file_object_class->read=captive_file_parent_read; - captive_file_object_class->write=captive_file_parent_write; - captive_file_object_class->seek=captive_file_parent_seek; - captive_file_object_class->tell=captive_file_parent_tell; - captive_file_object_class->remove=captive_file_parent_remove; - captive_file_object_class->file_info_get=captive_file_parent_file_info_get; - captive_file_object_class->file_info_set=captive_file_parent_file_info_set; - captive_file_object_class->truncate=captive_file_parent_truncate; - captive_file_object_class->move=captive_file_parent_move; -} - - -static GnomeVFSResult (*captive_file_parent_object_captive_parent_connector_open_orig) - (CaptiveParentConnector *captive_parent_connector); -static GnomeVFSResult captive_file_parent_object_captive_parent_connector_open - (CaptiveParentConnector *captive_parent_connector); - -static GnomeVFSResult captive_file_parent_object_captive_parent_connector_close - (CaptiveParentConnector *captive_parent_connector); -static GnomeVFSResult (*captive_file_parent_object_captive_parent_connector_close_orig) - (CaptiveParentConnector *captive_parent_connector); - -static G_CONST_RETURN gchar *captive_file_parent_object_captive_parent_connector_get_pathname - (CaptiveParentConnector *captive_parent_connector); - -static void captive_file_parent_object_captive_parent_connector_init(CaptiveParentConnectorIface *captive_parent_connector_iface) -{ - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR_CLASS(captive_parent_connector_iface)); - - captive_file_parent_object_captive_parent_connector_open_orig=captive_parent_connector_iface->open; - captive_parent_connector_iface->open=captive_file_parent_object_captive_parent_connector_open; - - captive_file_parent_object_captive_parent_connector_close_orig=captive_parent_connector_iface->close; - captive_parent_connector_iface->close=captive_file_parent_object_captive_parent_connector_close; - - captive_parent_connector_iface->get_pathname=captive_file_parent_object_captive_parent_connector_get_pathname; -} - - -static void captive_file_parent_object_init(CaptiveFileParentObject *captive_file_parent_object) -{ - g_return_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object)); -} - - -GType captive_file_parent_object_get_type(void) -{ -static GType captive_file_parent_object_type=0; - - if (!captive_file_parent_object_type) { -static const GTypeInfo captive_file_parent_object_info={ - sizeof(CaptiveFileParentObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_file_parent_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveFileParentObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_file_parent_object_init, - }; -static const GInterfaceInfo captive_parent_connector_info={ - (GInterfaceInitFunc)captive_file_parent_object_captive_parent_connector_init, /* interface_init */ - NULL, /* interface_finalize */ - NULL, /* interface_data */ - }; - - captive_file_parent_object_type=g_type_register_static(CAPTIVE_FILE_TYPE_OBJECT, - "CaptiveFileParentObject",&captive_file_parent_object_info,0); - g_type_add_interface_static(captive_file_parent_object_type, - CAPTIVE_TYPE_PARENT_CONNECTOR,&captive_parent_connector_info); - } - - return captive_file_parent_object_type; -} - - -static void captive_file_parent_init - (CaptiveFileParentObject *captive_file_parent_object,CaptiveVfsObject *captive_vfs_object) -{ - g_return_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object)); - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object)); - - /* Order of captive_file_init() and captive_parent_connector_init() - * should not matter as 'vfs' is passed by value to captive_parent_connector_init(). - */ - captive_file_init(CAPTIVE_FILE_OBJECT(captive_file_parent_object),captive_vfs_object); - - captive_parent_connector_init( - CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object), /* captive_parent_connector */ - &captive_file_parent_object->corba_File_object, /* corba_objectp */ - CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs)); /* captive_vfs_parent_object */ -} - -GnomeVFSResult captive_file_parent_new_open(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; -gint retried_commit=0; - - g_return_val_if_fail(captive_file_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=g_object_new( - CAPTIVE_FILE_PARENT_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - captive_file_parent_object->pathname=g_strdup(pathname); - captive_file_parent_object->mode=mode; - - captive_file_parent_init(captive_file_parent_object,captive_vfs_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_connect(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_new_open(captive_file_parent_object))) { - if (GNOME_VFS_ERROR_SERVICE_OBSOLETE==r) { - if (!retried_commit++) { - if (GNOME_VFS_OK!=(r=captive_vfs_commit(captive_vfs_object))) - return r; - retried=0; - continue; - } - } - if (GNOME_VFS_OK!=r) { - g_object_unref(captive_file_parent_object); - *captive_file_object_return=NULL; - return r; - } - *captive_file_object_return=CAPTIVE_FILE_OBJECT(captive_file_parent_object); - return (*captive_file_parent_object_captive_parent_connector_open_orig) - (CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)); - } - } while (!retried++); - return r; -} - - -GnomeVFSResult captive_file_parent_new_create(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; -gint retried_commit=0; - - g_return_val_if_fail(captive_file_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=g_object_new( - CAPTIVE_FILE_PARENT_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - captive_file_parent_object->pathname=g_strdup(pathname); - captive_file_parent_object->mode=mode; - - captive_file_parent_init(captive_file_parent_object,captive_vfs_object); - - if (GNOME_VFS_OK!=(r=captive_parent_connector_connect(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_connect(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_new_create(captive_file_parent_object,exclusive,perm))) { - if (GNOME_VFS_ERROR_SERVICE_OBSOLETE==r) { - if (!retried_commit++) { - if (GNOME_VFS_OK!=(r=captive_vfs_commit(captive_vfs_object))) - return r; - retried=0; - continue; - } - } - if (GNOME_VFS_OK!=r) { - g_object_unref(captive_file_parent_object); - *captive_file_object_return=NULL; - return r; - } - captive_parent_connector_set_dirty(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)); - *captive_file_object_return=CAPTIVE_FILE_OBJECT(captive_file_parent_object); - return (*captive_file_parent_object_captive_parent_connector_open_orig) - (CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)); - } - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_close(CaptiveFileObject *captive_file_object) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - break; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_parent_connector_close(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - break; - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_object_captive_parent_connector_open - (CaptiveParentConnector *captive_parent_connector) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_file_new_open(CAPTIVE_FILE_PARENT_OBJECT(captive_parent_connector)))) - return r; - - return (*captive_file_parent_object_captive_parent_connector_open_orig)(captive_parent_connector); -} - - -static GnomeVFSResult captive_file_parent_object_captive_parent_connector_close - (CaptiveParentConnector *captive_parent_connector) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_file_close(CAPTIVE_FILE_PARENT_OBJECT(captive_parent_connector)))) - return r; - - return (*captive_file_parent_object_captive_parent_connector_close_orig)(captive_parent_connector); -} - - -static G_CONST_RETURN gchar *captive_file_parent_object_captive_parent_connector_get_pathname - (CaptiveParentConnector *captive_parent_connector) -{ -CaptiveFileParentObject *captive_file_parent_object; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),NULL); - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_parent_connector),NULL); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_parent_connector); - - g_return_val_if_fail(captive_file_parent_object->pathname!=NULL,NULL); - - return captive_file_parent_object->pathname; -} - - -static GnomeVFSResult captive_file_parent_read(CaptiveFileObject *captive_file_object, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_read_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_read(captive_file_parent_object,buffer,num_bytes,bytes_read_return))) - return r; - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_write(CaptiveFileObject *captive_file_object, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; -gint retried_commit=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_written_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_write(captive_file_parent_object,buffer,num_bytes,bytes_written_return))) { - /* Occured: ExRaiseStatus(STATUS_LOG_FILE_FULL); */ - if (GNOME_VFS_ERROR_SERVICE_OBSOLETE==r) { - if (!retried_commit++) { - if (GNOME_VFS_OK!=(r=captive_vfs_commit(captive_file_object->vfs))) - return r; - retried=0; - continue; - } - } - g_assert(*bytes_written_return==num_bytes); /* Not GNOME_VFS_ERROR_SERVICE_OBSOLETE. */ - if (GNOME_VFS_OK==r) - captive_parent_connector_set_dirty(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)); - return r; - } - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_seek - (CaptiveFileObject *captive_file_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_seek(captive_file_parent_object,whence,offset))) - return r; - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_tell(CaptiveFileObject *captive_file_object,GnomeVFSFileOffset *offset_return) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(offset_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_tell(captive_file_parent_object,offset_return))) - return r; - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_remove(CaptiveFileObject *captive_file_object) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_remove(captive_file_parent_object))) { - if (GNOME_VFS_OK==r) - captive_parent_connector_set_dirty(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)); - return r; - } - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_file_info_get - (CaptiveFileObject *captive_file_object,GnomeVFSFileInfo *file_info) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_file_info_get(captive_file_parent_object,file_info))) - return r; - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_file_info_set - (CaptiveFileObject *captive_file_object,const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_file_info_set(captive_file_parent_object,info,mask))) { - if (GNOME_VFS_OK==r) - captive_parent_connector_set_dirty(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)); - return r; - } - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_truncate(CaptiveFileObject *captive_file_object,GnomeVFSFileSize file_size) -{ -CaptiveFileParentObject *captive_file_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_truncate(captive_file_parent_object,file_size))) { - if (GNOME_VFS_OK==r) - captive_parent_connector_set_dirty(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object)); - return r; - } - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_file_parent_move - (CaptiveFileObject *captive_file_object_old,const gchar *pathname_new,gboolean force_replace) -{ -CaptiveFileParentObject *captive_file_parent_object_old; -GnomeVFSResult r; -gint retried=0; -gchar *chksub_pathname_old_cased,*chksub_pathname_new_cased; /* case-sensitive version */ -gchar *chksub_pathname_old,*chksub_pathname_new,*chksub_s_old,*chksub_s_new; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_object_old),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname_new!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_parent_object_old=CAPTIVE_FILE_PARENT_OBJECT(captive_file_object_old); - - /* Prevent "mv dir dir/subdir" as it is not catched by ntfs.sys of NT-5.1sp1. */ - /* FIXME: Move to 'CaptiveFileSlaveObject' but it has no '->pathname' stored now! */ - /* FIXME: UTF8 may not be compared correctly - we should use g_utf8_collate() */ - chksub_pathname_old_cased=captive_path_normalize(captive_file_parent_object_old->pathname); - chksub_pathname_new_cased=captive_path_normalize(pathname_new); - chksub_pathname_old=g_utf8_casefold(chksub_pathname_old_cased, - -1); /* len; '\0'-terminated */ - chksub_pathname_new=g_utf8_casefold(chksub_pathname_new_cased, - -1); /* len; '\0'-terminated */ - g_free(chksub_pathname_old_cased); - g_free(chksub_pathname_new_cased); - for ( - chksub_s_old=chksub_pathname_old,chksub_s_new=chksub_pathname_new; - *chksub_s_old && *chksub_s_new && tolower(*chksub_s_old)==tolower(*chksub_s_new); - chksub_s_old++,chksub_s_new++); - g_assert(chksub_s_old>chksub_pathname_old); - g_assert(chksub_s_new>chksub_pathname_new); - if (!*chksub_s_old && (!*chksub_s_new || *chksub_s_new=='/')) - return GNOME_VFS_ERROR_DIRECTORY_BUSY; - if (!*chksub_s_new && (!*chksub_s_old || *chksub_s_old=='/')) - return GNOME_VFS_ERROR_DIRECTORY_BUSY; - g_free(chksub_pathname_old); - g_free(chksub_pathname_new); - - do { - if (GNOME_VFS_OK!=(r=captive_parent_connector_open(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object_old)))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_file_move(captive_file_parent_object_old,pathname_new,force_replace))) { - if (GNOME_VFS_OK==r) { - g_free(captive_file_parent_object_old->pathname); - captive_file_parent_object_old->pathname=g_strdup(pathname_new); - captive_parent_connector_set_dirty(CAPTIVE_PARENT_CONNECTOR(captive_file_parent_object_old)); - } - return r; - } - } while (!retried++); - return r; -} diff --git a/src/libcaptive/client/file-parent.h b/src/libcaptive/client/file-parent.h deleted file mode 100644 index 0e6478f..0000000 --- a/src/libcaptive/client/file-parent.h +++ /dev/null @@ -1,66 +0,0 @@ -/* $Id$ - * Include file for captive vfs 'file' private interface to reactos of sandbox parent - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_FILE_PARENT_H -#define _CAPTIVE_CLIENT_PRIV_FILE_PARENT_H 1 - - -#include -#include -#include "captive/client-file.h" /* for CaptiveFileObject */ -#include "file.h" /* for CaptiveFileObject priv */ -#include "../sandbox/sandbox.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_FILE_PARENT_TYPE_OBJECT (captive_file_parent_object_get_type()) -#define CAPTIVE_FILE_PARENT_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_FILE_PARENT_TYPE_OBJECT,CaptiveFileParentObject)) -#define CAPTIVE_FILE_PARENT_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_FILE_PARENT_TYPE_OBJECT,CaptiveFileParentObjectClass)) -#define CAPTIVE_FILE_PARENT_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_FILE_PARENT_TYPE_OBJECT)) -#define CAPTIVE_FILE_PARENT_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_FILE_PARENT_TYPE_OBJECT)) -#define CAPTIVE_FILE_PARENT_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_FILE_PARENT_TYPE_OBJECT,CaptiveFileParentObjectClass)) -typedef struct _CaptiveFileParentObject CaptiveFileParentObject; -typedef struct _CaptiveFileParentObjectClass CaptiveFileParentObjectClass; - - -GType captive_file_parent_object_get_type(void); - -struct _CaptiveFileParentObject { - CaptiveFileObject parent_instance; - - /*< private >*/ - Captive_File corba_File_object; - GnomeVFSFileOffset offset; - gchar *pathname; - GnomeVFSOpenMode mode; - }; -struct _CaptiveFileParentObjectClass { - CaptiveFileObjectClass parent_class; - }; - -GnomeVFSResult captive_file_parent_new_open(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode); -GnomeVFSResult captive_file_parent_new_create(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_FILE_PARENT_H */ diff --git a/src/libcaptive/client/file-slave.c b/src/libcaptive/client/file-slave.c deleted file mode 100644 index fac5eef..0000000 --- a/src/libcaptive/client/file-slave.c +++ /dev/null @@ -1,893 +0,0 @@ -/* $Id$ - * captive vfs 'file' interface to reactos - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "file-slave.h" /* self */ -#include "captive/client-file.h" /* for CaptiveFileObject */ -#include "file.h" /* for CaptiveFileObject priv */ -#include "directory.h" -#include "lib.h" -#include -#include "captive/unicode.h" -#include "reactos/ntos/types.h" /* for HANDLE */ -#include "reactos/ddk/iotypes.h" /* for IO_STATUS_BLOCK */ -#include "reactos/ddk/iofuncs.h" /* for IoCreateFile() */ -#include "result.h" -#include "captive/client-directory.h" -#include "reactos/ddk/obfuncs.h" /* for ObReferenceObjectByHandle() */ -#include "captive/macros.h" -#include "captive/leave.h" -#include "captive/usecount.h" -#include "vfs.h" -#include "vfs-slave.h" - - -/* Config: */ -#define MAX_FILE_WRITTEN 0x100000 /* FIXME: Workaround memory consumption for non-journalled fastfat.sys */ - - -struct _CaptiveFileSlaveObject { - CaptiveFileObject parent_instance; - - /*< private >*/ - HANDLE file_Handle; - GnomeVFSFileOffset offset; - }; -struct _CaptiveFileSlaveObjectClass { - CaptiveFileObjectClass parent_class; - }; - - -static gpointer captive_file_slave_object_parent_class=NULL; - - -static GnomeVFSResult captive_file_slave_close(CaptiveFileObject *captive_file_object); -static GnomeVFSResult captive_file_slave_read(CaptiveFileObject *captive_file_object, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return); -static GnomeVFSResult captive_file_slave_write(CaptiveFileObject *captive_file_object, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return); -static GnomeVFSResult captive_file_slave_seek - (CaptiveFileObject *captive_file_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset); -static GnomeVFSResult captive_file_slave_tell(CaptiveFileObject *captive_file_object,GnomeVFSFileOffset *offset_return); -static GnomeVFSResult captive_file_slave_remove(CaptiveFileObject *captive_file_object); -static GnomeVFSResult captive_file_slave_file_info_get - (CaptiveFileObject *captive_file_object,GnomeVFSFileInfo *file_info); -static GnomeVFSResult captive_file_slave_file_info_set - (CaptiveFileObject *captive_file_object,const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask); -static GnomeVFSResult captive_file_slave_truncate(CaptiveFileObject *captive_file_object,GnomeVFSFileSize file_size); -static GnomeVFSResult captive_file_slave_move - (CaptiveFileObject *captive_file_object_old,const gchar *pathname_new,gboolean force_replace); - - -static void captive_file_slave_object_finalize(CaptiveFileSlaveObject *captive_file_slave_object) -{ - g_return_if_fail(captive_file_slave_object!=NULL); - - captive_file_slave_close(CAPTIVE_FILE_OBJECT(captive_file_slave_object)); /* errors ignored */ - - G_OBJECT_CLASS(captive_file_slave_object_parent_class)->finalize((GObject *)captive_file_slave_object); -} - - -static void captive_file_slave_object_class_init(CaptiveFileSlaveObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); -CaptiveFileObjectClass *captive_file_object_class=CAPTIVE_FILE_OBJECT_CLASS(class); - - captive_file_slave_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_file_slave_object_finalize; - - captive_file_object_class->read=captive_file_slave_read; - captive_file_object_class->write=captive_file_slave_write; - captive_file_object_class->seek=captive_file_slave_seek; - captive_file_object_class->tell=captive_file_slave_tell; - captive_file_object_class->remove=captive_file_slave_remove; - captive_file_object_class->file_info_get=captive_file_slave_file_info_get; - captive_file_object_class->file_info_set=captive_file_slave_file_info_set; - captive_file_object_class->truncate=captive_file_slave_truncate; - captive_file_object_class->move=captive_file_slave_move; -} - - -static void captive_file_slave_object_init(CaptiveFileSlaveObject *captive_file_slave_object) -{ - captive_file_slave_object->file_Handle=NULL; -} - - -GType captive_file_slave_object_get_type(void) -{ -static GType captive_file_slave_object_type=0; - - if (!captive_file_slave_object_type) { -static const GTypeInfo captive_file_slave_object_info={ - sizeof(CaptiveFileSlaveObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_file_slave_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveFileSlaveObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_file_slave_object_init, - }; - - captive_file_slave_object_type=g_type_register_static(CAPTIVE_FILE_TYPE_OBJECT, - "CaptiveFileSlaveObject",&captive_file_slave_object_info,0); - } - - return captive_file_slave_object_type; -} - - -static GnomeVFSResult captive_file_slave_new_internal(CaptiveFileSlaveObject *captive_file_slave_object, - const gchar *pathname,GnomeVFSOpenMode mode,gboolean create,gboolean create_exclusive,guint create_perm) -{ -IO_STATUS_BLOCK file_IoStatusBlock; -GnomeVFSResult errvfsresult; -OBJECT_ATTRIBUTES file_ObjectAttributes; -HANDLE file_Handle; -NTSTATUS err; - - g_return_val_if_fail(captive_file_slave_object!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_ObjectAttributes_init(pathname,&file_ObjectAttributes); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - /* open */ - err=IoCreateFile( - &file_Handle, /* FileHandle */ - 0 - /* sniffed: | SYNCHRONIZE */ - |(!(mode&GNOME_VFS_OPEN_READ ) ? 0 : FILE_READ_DATA) - |(!(mode&GNOME_VFS_OPEN_WRITE) ? 0 : FILE_WRITE_DATA | FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES) - |( mode!=0 ? 0 : FILE_READ_ATTRIBUTES) - , /* DesiredAccess */ - &file_ObjectAttributes, /* ObjectAttributes */ - &file_IoStatusBlock, /* IoStatusBlock */ - NULL, /* AllocationSize; ignored for open */ - (!create || create_perm&0200 ? FILE_ATTRIBUTE_NORMAL: FILE_ATTRIBUTE_READONLY), /* FileAttributes; ignored for open */ - (!create || !create_exclusive /* ShareAccess; 0 means exclusive */ - ? (FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE) - : 0), - (!create ? FILE_OPEN : FILE_CREATE), /* CreateDisposition */ - /* FILE_SYNCHRONOUS_IO_{,NON}ALERT: We need to allow W32 filesystem - * any waits to not to let it return STATUS_CANT_WAIT us. - * Alertability should have only effect on asynchronous events - * from KeWaitForSingleObject() by setting/clearing its parameter 'Alertable'. - */ - FILE_SYNCHRONOUS_IO_ALERT /* CreateOptions */ - /* sniffed: | FILE_DIRECTORY_FILE */ - /* sniffed: | FILE_OPEN_FOR_BACKUP_INTENT */ - , - NULL, /* EaBuffer */ - 0, /* EaLength */ - CreateFileTypeNone, /* CreateFileType */ - NULL, /* ExtraCreateParameters */ - 0); /* Options */ - g_free(file_ObjectAttributes.ObjectName); /* left from captive_file_slave_uri_parent_init() */ - g_return_val_if_fail(NT_SUCCESS(err)==NT_SUCCESS(file_IoStatusBlock.Status),GNOME_VFS_ERROR_GENERIC); - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(file_IoStatusBlock.Information - ==(!create ? FILE_OPENED : FILE_CREATED), - GNOME_VFS_ERROR_GENERIC); - - captive_file_slave_object->file_Handle=file_Handle; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_new_open(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode) -{ -GnomeVFSResult r; -CaptiveFileSlaveObject *captive_file_slave_object; - - g_return_val_if_fail(captive_file_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=g_object_new( - CAPTIVE_FILE_SLAVE_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - - captive_file_init(CAPTIVE_FILE_OBJECT(captive_file_slave_object),captive_vfs_object); - - *captive_file_object_return=CAPTIVE_FILE_OBJECT(captive_file_slave_object); - - r=captive_file_slave_new_internal(captive_file_slave_object,pathname,mode, - FALSE, /* create */ - FALSE, /* create_exclusive; ignored */ - 0); /* create_perm; ignored */ - - captive_leave(); - if (r==GNOME_VFS_OK) - captive_usecount(+1); - else { - g_object_unref(captive_file_slave_object); - *captive_file_object_return=NULL; - } - return r; -} - - -GnomeVFSResult captive_file_slave_new_create(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm) -{ -GnomeVFSResult r; -CaptiveFileSlaveObject *captive_file_slave_object; - - g_return_val_if_fail(captive_file_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=g_object_new( - CAPTIVE_FILE_SLAVE_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - - captive_file_init(CAPTIVE_FILE_OBJECT(captive_file_slave_object),captive_vfs_object); - - *captive_file_object_return=CAPTIVE_FILE_OBJECT(captive_file_slave_object); - - r=captive_file_slave_new_internal(captive_file_slave_object,pathname,mode, - TRUE, /* create */ - exclusive, /* create_exclusive */ - perm); /* create_perm */ - - captive_leave(); - if (r==GNOME_VFS_OK) - captive_usecount(+1); - else { - g_object_unref(captive_file_slave_object); - *captive_file_object_return=NULL; - } - return r; -} - - -static GnomeVFSResult captive_file_slave_close(CaptiveFileObject *captive_file_object) -{ -CaptiveFileSlaveObject *captive_file_slave_object; -NTSTATUS err; -HANDLE file_Handle; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - if (captive_file_slave_object->file_Handle!=NULL) { /* not yet already closed */ - captive_usecount(-1); /* close() errors notwithstanding */ - - file_Handle=captive_file_slave_object->file_Handle; - captive_file_slave_object->file_Handle=NULL; - err=NtClose(file_Handle); - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - } - - captive_leave(); - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_read(CaptiveFileObject *captive_file_object, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return) -{ -CaptiveFileSlaveObject *captive_file_slave_object; -NTSTATUS err; -IO_STATUS_BLOCK file_IoStatusBlock; -LARGE_INTEGER file_offset; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_read_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - g_return_val_if_fail(captive_file_slave_object->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - file_offset.QuadPart=captive_file_slave_object->offset; - err=NtReadFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - NULL, /* EventHandle; completion signalling; optional */ - NULL, /* ApcRoutine; optional */ - NULL, /* ApcContext; optional */ - &file_IoStatusBlock, /* IoStatusBlock */ - buffer, /* Buffer */ - num_bytes, /* Length */ - &file_offset, /* ByteOffset */ - NULL); /* Key; NULL means no file locking key */ - if (err==STATUS_END_OF_FILE) { - g_return_val_if_fail(file_IoStatusBlock.Status==STATUS_END_OF_FILE,GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(file_IoStatusBlock.Information==0,GNOME_VFS_ERROR_GENERIC); - *bytes_read_return=0; - return GNOME_VFS_ERROR_EOF; - } - g_return_val_if_fail(file_IoStatusBlock.Information>0,GNOME_VFS_ERROR_GENERIC); /* if not STATUS_END_OF_FILE... */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err)==NT_SUCCESS(file_IoStatusBlock.Status),GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(file_IoStatusBlock.Information<=num_bytes,GNOME_VFS_ERROR_GENERIC); - - captive_file_slave_object->offset+=file_IoStatusBlock.Information; - *bytes_read_return=file_IoStatusBlock.Information; - captive_leave(); - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_write(CaptiveFileObject *captive_file_object, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return) -{ -CaptiveFileSlaveObject *captive_file_slave_object; -NTSTATUS err; -IO_STATUS_BLOCK file_IoStatusBlock; -LARGE_INTEGER file_offset; -GnomeVFSFileInfo file_info; -GnomeVFSFileSize endoffile_wanted; -GnomeVFSResult errvfsresult; -static GnomeVFSFileSize total_written=0; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_written_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - g_return_val_if_fail(captive_file_slave_object->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - /* FIXME: Workaround memory consumption for non-journalled fastfat.sys */ - if (total_written>=MAX_FILE_WRITTEN && captive_options->sandbox) - return GNOME_VFS_ERROR_SERVICE_OBSOLETE; - total_written+=num_bytes; - - if ((GnomeVFSFileOffset)(captive_file_slave_object->offset+num_bytes) < captive_file_slave_object->offset) - return GNOME_VFS_ERROR_TOO_BIG; - endoffile_wanted=captive_file_slave_object->offset+num_bytes; - if (GNOME_VFS_OK!=(errvfsresult=captive_file_slave_file_info_get( - CAPTIVE_FILE_OBJECT(captive_file_slave_object),&file_info))) - return errvfsresult; - if (file_info.sizeoffset; - err=NtWriteFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - NULL, /* Event; completion signalling; optional */ - NULL, /* ApcRoutine; optional */ - NULL, /* ApcContext; optional */ - &file_IoStatusBlock, /* IoStatusBlock */ - (gpointer /* de-const */ )buffer, /* Buffer */ - num_bytes, /* Length */ - &file_offset, /* ByteOffset */ - NULL); /* Key; NULL means no file locking key */ - g_return_val_if_fail(NT_SUCCESS(err)==NT_SUCCESS(file_IoStatusBlock.Status),GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - if (!file_IoStatusBlock.Information) { - /* FIXME: Check ExRaiseStatus(STATUS_LOG_FILE_FULL); - * really occured. We expect so and we will remount the volume. - */ - *bytes_written_return=0; - return GNOME_VFS_ERROR_SERVICE_OBSOLETE; - } - g_return_val_if_fail(file_IoStatusBlock.Information==num_bytes,GNOME_VFS_ERROR_GENERIC); - - captive_file_slave_object->offset+=file_IoStatusBlock.Information; - *bytes_written_return=file_IoStatusBlock.Information; - captive_leave(); - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_seek - (CaptiveFileObject *captive_file_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset) -{ -CaptiveFileSlaveObject *captive_file_slave_object; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - g_return_val_if_fail(captive_file_slave_object->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - switch (whence) { - case GNOME_VFS_SEEK_START: - captive_file_slave_object->offset=offset; - break; - case GNOME_VFS_SEEK_CURRENT: - if (0 - || (offset>0 && (captive_file_slave_object->offset+offset)offset) - || (offset<0 && (captive_file_slave_object->offset+offset)>captive_file_slave_object->offset)) - return GNOME_VFS_ERROR_BAD_PARAMETERS; - captive_file_slave_object->offset+=offset; - break; - case GNOME_VFS_SEEK_END: - g_assert_not_reached(); /* NOT IMPLEMENTED YET */ - break; - default: - g_return_val_if_reached(GNOME_VFS_ERROR_BAD_PARAMETERS); - } - - captive_leave(); - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_tell(CaptiveFileObject *captive_file_object,GnomeVFSFileOffset *offset_return) -{ -CaptiveFileSlaveObject *captive_file_slave_object; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(offset_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - g_return_val_if_fail(captive_file_slave_object->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - *offset_return=captive_file_slave_object->offset; - captive_leave(); - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_remove(CaptiveFileObject *captive_file_object) -{ -CaptiveFileSlaveObject *captive_file_slave_object; -NTSTATUS err; -FILE_DISPOSITION_INFORMATION FileDispositionInformation_struct; -IO_STATUS_BLOCK file_IoStatusBlock; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - g_return_val_if_fail(captive_file_slave_object->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - FileDispositionInformation_struct.DoDeleteFile=TRUE; - - err=NtSetInformationFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - &FileDispositionInformation_struct, /* FileInformation */ - sizeof(FileDispositionInformation_struct), /* Length */ - FileDispositionInformation); /* FileInformationClass */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - - captive_leave(); - return GNOME_VFS_OK; -} - - -/* Use 'FileNameInformationStruct' identifier instead of the logical 'FileNameInformation' - * to prevent override of enum member 'FileNameInformation' - */ -static GnomeVFSResult FileNameInformationStruct_to_GnomeVFSFileInfo(GnomeVFSFileInfo *file_info, - FILE_NAME_INFORMATION *FileNameInformationStruct) -{ -UNICODE_STRING FileName_UnicodeString; - - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(FileNameInformationStruct!=NULL,GNOME_VFS_ERROR_GENERIC); - - FileName_UnicodeString.Length=FileNameInformationStruct->FileNameLength; - FileName_UnicodeString.MaximumLength=FileNameInformationStruct->FileNameLength - +sizeof(*FileNameInformationStruct->FileName); /* 0-terminator */ - -#if 0 /* 'IoStatusBlock->Information' is sometimes weird, do not check it */ - g_assert((gpointer)(((char *)FileNameInformationStruct->FileName)+FileName_UnicodeString.Length) - <=(gpointer)(((char *)FileAllInformationStruct)+IoStatusBlock->Information)); - /* ensure we fit below '->IoStatusBlock->Information' at least without the 0-terminator */ -#endif - - FileNameInformationStruct->FileName[FileNameInformationStruct->FileNameLength - /sizeof(*FileNameInformationStruct->FileName)]=0; /* 0-terminate it */ - FileName_UnicodeString.Buffer=FileNameInformationStruct->FileName; - file_info->name=captive_UnicodeString_to_utf8_malloc(&FileName_UnicodeString); - /* '->name' assumed for 'file_info->valid_fields' */ - - return GNOME_VFS_OK; -} - - -/* Use 'FileBasicInformationStruct' identifier instead of the logical 'FileBasicInformation' - * to prevent override of enum member 'FileBasicInformation' - */ -static GnomeVFSResult FileBasicInformationStruct_to_GnomeVFSFileInfo(GnomeVFSFileInfo *file_info, - FILE_BASIC_INFORMATION *FileBasicInformationStruct) -{ -BOOLEAN errBOOLEAN; -ULONG tmp_ULONG; - - /* FIXME: What is 'FILE_ATTRIBUTE_NORMAL'? */ - switch (FileBasicInformationStruct->FileAttributes & (0 - | FILE_ATTRIBUTE_DIRECTORY - | FILE_ATTRIBUTE_DEVICE)) { - case 0: file_info->type=GNOME_VFS_FILE_TYPE_REGULAR; break; - case FILE_ATTRIBUTE_DIRECTORY: file_info->type=GNOME_VFS_FILE_TYPE_DIRECTORY; break; - case FILE_ATTRIBUTE_DEVICE: file_info->type=GNOME_VFS_FILE_TYPE_SOCKET; - /* or GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE or GNOME_VFS_FILE_TYPE_BLOCK_DEVICE ? */ - break; - default: file_info->type=GNOME_VFS_FILE_TYPE_UNKNOWN; break; - } - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_TYPE; - - /* we use 0600 for r/w files, 0400 for FILE_ATTRIBUTE_READONLY */ - file_info->permissions=GNOME_VFS_PERM_USER_READ; - if (file_info->type==GNOME_VFS_FILE_TYPE_DIRECTORY) - file_info->permissions|=GNOME_VFS_PERM_USER_EXEC; - if (!(FileBasicInformationStruct->FileAttributes & FILE_ATTRIBUTE_READONLY)) - file_info->permissions|=GNOME_VFS_PERM_USER_WRITE; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS; - - if (FileBasicInformationStruct->LastAccessTime.QuadPart) { /* it may be 0 if not set */ - errBOOLEAN=RtlTimeToSecondsSince1970(&FileBasicInformationStruct->LastAccessTime,&tmp_ULONG); - g_assert(errBOOLEAN==TRUE); - file_info->atime=tmp_ULONG; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_ATIME; - } - - /* it may be 0 if not set */ - if (FileBasicInformationStruct->LastWriteTime.QuadPart || FileBasicInformationStruct->ChangeTime.QuadPart) { - errBOOLEAN=RtlTimeToSecondsSince1970( - /* take the more recent (==bigger) time: */ - (FileBasicInformationStruct->LastWriteTime.QuadPart > FileBasicInformationStruct->ChangeTime.QuadPart - ? &FileBasicInformationStruct->LastWriteTime : &FileBasicInformationStruct->ChangeTime), - &tmp_ULONG); - g_assert(errBOOLEAN==TRUE); - file_info->mtime=tmp_ULONG; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_MTIME; - } - - if (FileBasicInformationStruct->CreationTime.QuadPart) { /* it may be 0 if not set */ - errBOOLEAN=RtlTimeToSecondsSince1970(&FileBasicInformationStruct->CreationTime,&tmp_ULONG); - g_assert(errBOOLEAN==TRUE); - file_info->ctime=tmp_ULONG; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_CTIME; - } - - return GNOME_VFS_OK; -} - - -/* Use 'FileStandardInformationStruct' identifier instead of the logical 'FileStandardInformation' - * to prevent override of enum member 'FileStandardInformation' - */ -static GnomeVFSResult FileStandardInformationStruct_to_GnomeVFSFileInfo(GnomeVFSFileInfo *file_info, - FILE_STANDARD_INFORMATION *FileStandardInformationStruct) -{ - file_info->size=FileStandardInformationStruct->EndOfFile.QuadPart; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_SIZE; - - file_info->block_count=FileStandardInformationStruct->AllocationSize.QuadPart/512; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_file_info_get(CaptiveFileObject *captive_file_object, - GnomeVFSFileInfo *file_info) -{ -CaptiveFileSlaveObject *captive_file_slave_object; -NTSTATUS err; -IO_STATUS_BLOCK file_IoStatusBlock; -FILE_NAME_INFORMATION *FileNameInformationStruct; -FILE_BASIC_INFORMATION *FileBasicInformationStruct; -FILE_STANDARD_INFORMATION *FileStandardInformationStruct; -GnomeVFSResult errvfsresult; -char QueryFile_buf[sizeof(FILE_NAME_INFORMATION) - +0x1000 /* max 'FileName' length, 255 should be enough */ * sizeof(WCHAR /* *FILE_ALL_INFORMATION.NameInformation.FileName */ )]; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - g_return_val_if_fail(captive_file_slave_object->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - /* ntfs.sys of NT-5.1sp1 has *(FILE_BASIC_INFORMATION *)FILE_ALL_INFORMATION.BasicInformation - * size 0x28 although reactos includes and all the information says 0x24. - * fastfat.sys of NT-5.1sp1 also has the 'official' sizeof 0x24. - * It would be a bit of heuristic to correctly detect its expected sizeof. - */ - - file_info->valid_fields=0; - - file_info->flags=GNOME_VFS_FILE_FLAGS_LOCAL; - file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_FLAGS; - - /* query NameInformation */ - FileNameInformationStruct=(void *)QueryFile_buf; - err=NtQueryInformationFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - (gpointer)QueryFile_buf, /* FileInformation */ - sizeof(QueryFile_buf) /* Length */ - -sizeof(*FileNameInformationStruct->FileName), /* reserve space for a possible 0-terminator */ - FileNameInformation); /* FileInformationClass; =>FILE_NAME_INFORMATION */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err)==NT_SUCCESS(file_IoStatusBlock.Status),GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - errvfsresult=FileNameInformationStruct_to_GnomeVFSFileInfo(file_info,FileNameInformationStruct); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - /* query BasicInformation */ - FileBasicInformationStruct=(void *)QueryFile_buf; - err=NtQueryInformationFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - (gpointer)QueryFile_buf, /* FileInformation */ - sizeof(QueryFile_buf), /* Length */ - FileBasicInformation); /* FileInformationClass; =>FILE_BASIC_INFORMATION */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err)==NT_SUCCESS(file_IoStatusBlock.Status),GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - errvfsresult=FileBasicInformationStruct_to_GnomeVFSFileInfo(file_info,FileBasicInformationStruct); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - /* query StandardInformation */ - FileStandardInformationStruct=(void *)QueryFile_buf; - err=NtQueryInformationFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - (gpointer)QueryFile_buf, /* FileInformation */ - sizeof(QueryFile_buf), /* Length */ - FileStandardInformation); /* FileInformationClass; =>FILE_STANDARD_INFORMATION */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err)==NT_SUCCESS(file_IoStatusBlock.Status),GNOME_VFS_ERROR_GENERIC); - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - errvfsresult=FileStandardInformationStruct_to_GnomeVFSFileInfo(file_info,FileStandardInformationStruct); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - captive_leave(); - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_file_info_set(CaptiveFileObject *captive_file_object, - const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask) -{ -CaptiveFileSlaveObject *captive_file_slave_object; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - g_return_val_if_fail(captive_file_slave_object->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (mask & GNOME_VFS_SET_FILE_INFO_NAME) { -gchar *name_dirname,*name_basename; -UNICODE_STRING *name_UnicodeString; -FILE_RENAME_INFORMATION *FileRenameInformation_structp; -gsize FileRenameInformation_struct_len; -IO_STATUS_BLOCK file_IoStatusBlock; -NTSTATUS err=STATUS_SUCCESS; /* Prevent: ... might be used uninitialized in this function */ -GnomeVFSResult errvfsresult; - - /* non-existing dirname assertion */ - name_dirname=g_path_get_dirname(info->name); - if (*name_dirname) { - g_assert_not_reached(); - errvfsresult=GNOME_VFS_ERROR_BAD_PARAMETERS; - goto err; - } - - /* fully-matching basename assertion */ - name_basename=g_path_get_basename(info->name); - if (strcmp(name_basename,info->name)) { - g_assert_not_reached(); - errvfsresult=GNOME_VFS_ERROR_BAD_PARAMETERS; - goto err_free_name_dirname; - } - - name_UnicodeString=captive_utf8_to_UnicodeString_alloca(info->name); - FileRenameInformation_struct_len=sizeof(*FileRenameInformation_structp) - +name_UnicodeString->MaximumLength; /* ==Length+(0-terminator); is the terminator needed? */ - - FileRenameInformation_structp=g_alloca(FileRenameInformation_struct_len); - FileRenameInformation_structp->Replace=FALSE; - FileRenameInformation_structp->RootDir=NULL; /* we do 'simple rename' here */ - FileRenameInformation_structp->FileNameLength=name_UnicodeString->Length; - memcpy(FileRenameInformation_structp->FileName,name_UnicodeString->Buffer, - name_UnicodeString->MaximumLength); /* ==Length+(0-terminator); is the terminator needed? */ - - err=NtSetInformationFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - FileRenameInformation_structp, /* FileInformation */ - FileRenameInformation_struct_len, /* Length */ - FileRenameInformation); /* FileInformationClass */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - goto err_free_name_basename; - -err_free_name_basename: - g_free(name_basename); -err_free_name_dirname: - g_free(name_dirname); -err: - - if (errvfsresult!=GNOME_VFS_OK) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - } - - if (mask & (GNOME_VFS_SET_FILE_INFO_PERMISSIONS | GNOME_VFS_SET_FILE_INFO_TIME)) { -char FileBasicInformation_buf[sizeof(FILE_BASIC_INFORMATION)+4]; -FILE_BASIC_INFORMATION *FileBasicInformationp=(FILE_BASIC_INFORMATION *)FileBasicInformation_buf; -IO_STATUS_BLOCK file_IoStatusBlock; -NTSTATUS err; - - /* FIXME: Everywhere is is the declaration with 4xLARGE_INTEGER+1xULONG==36 bytes - * but the precompiled ext2fsd.sys wants 40 bytes - why? - * The same case applies to ntfs.sys of NT-5.1sp1. - */ - g_assert(sizeof(FILE_BASIC_INFORMATION)==36); - g_assert(sizeof(FileBasicInformation_buf)==40); - err=NtQueryInformationFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - FileBasicInformation_buf, /* FileInformation */ - sizeof(FileBasicInformation_buf), /* Length */ - FileBasicInformation); /* FileInformationClass */ - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - - if (mask & GNOME_VFS_SET_FILE_INFO_PERMISSIONS) { - FileBasicInformationp->FileAttributes&=~FILE_ATTRIBUTE_READONLY; - g_assert(info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS); - if (!(info->permissions&0200)) - FileBasicInformationp->FileAttributes|=FILE_ATTRIBUTE_READONLY; - } - - if (mask & GNOME_VFS_SET_FILE_INFO_TIME) { - g_assert(info->valid_fields & (0 - | GNOME_VFS_FILE_INFO_FIELDS_ATIME - | GNOME_VFS_FILE_INFO_FIELDS_MTIME)); - /* !GNOME_VFS_FILE_INFO_FIELDS_CTIME is used by FUSE op_utime(). */ - if (info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_ATIME) { - RtlSecondsSince1970ToTime( - info->atime, /* SecondsSince1970 */ - &FileBasicInformationp->LastAccessTime); /* Time */ - } - if (info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_MTIME) { - RtlSecondsSince1970ToTime( - info->mtime, /* SecondsSince1970 */ - &FileBasicInformationp->LastWriteTime); /* Time */ - FileBasicInformationp->ChangeTime=FileBasicInformationp->LastWriteTime; - } - if (info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_CTIME) { - RtlSecondsSince1970ToTime( - info->ctime, /* SecondsSince1970 */ - &FileBasicInformationp->CreationTime); /* Time */ - } - } - - err=NtSetInformationFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - FileBasicInformation_buf, /* FileInformation */ - sizeof(FileBasicInformation_buf), /* Length */ - FileBasicInformation); /* FileInformationClass */ - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - } - - if (mask & GNOME_VFS_SET_FILE_INFO_OWNER) { - /* FIXME: g_assert(info->valid_fields & ???); */ - /* owner ignored for W32 */ - } - - captive_leave(); - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_truncate(CaptiveFileObject *captive_file_object,GnomeVFSFileSize file_size) -{ -CaptiveFileSlaveObject *captive_file_slave_object; -NTSTATUS err; -FILE_END_OF_FILE_INFORMATION FileEndOfFileInformation_struct; -IO_STATUS_BLOCK file_IoStatusBlock; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object); - - g_return_val_if_fail(captive_file_slave_object->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - FileEndOfFileInformation_struct.EndOfFile.QuadPart=file_size; - - err=NtSetInformationFile( - captive_file_slave_object->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - &FileEndOfFileInformation_struct, /* FileInformation */ - sizeof(FileEndOfFileInformation_struct), /* Length */ - FileEndOfFileInformation); /* FileInformationClass */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - return errvfsresult; - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - - captive_leave(); - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_file_slave_move - (CaptiveFileObject *captive_file_object_old,const gchar *pathname_new,gboolean force_replace) -{ -CaptiveFileSlaveObject *captive_file_slave_object_old; -NTSTATUS err; -FILE_RENAME_INFORMATION *FileRenameInformation_structp; -IO_STATUS_BLOCK file_IoStatusBlock; -GnomeVFSResult errvfsresult; -OBJECT_ATTRIBUTES pathname_new_ObjectAttributes; - - g_return_val_if_fail(CAPTIVE_FILE_SLAVE_IS_OBJECT(captive_file_object_old),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname_new!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_file_slave_object_old=CAPTIVE_FILE_SLAVE_OBJECT(captive_file_object_old); - - g_return_val_if_fail(captive_file_slave_object_old->file_Handle!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errvfsresult=captive_ObjectAttributes_init(pathname_new,&pathname_new_ObjectAttributes); - g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult); - - FileRenameInformation_structp= - g_alloca(sizeof(*FileRenameInformation_structp)+pathname_new_ObjectAttributes.ObjectName->MaximumLength); - FileRenameInformation_structp->Replace=force_replace; - FileRenameInformation_structp->RootDir=0; /* AFAIK never set by orig W32 */ - FileRenameInformation_structp->FileNameLength=pathname_new_ObjectAttributes.ObjectName->Length; - memcpy(FileRenameInformation_structp->FileName,pathname_new_ObjectAttributes.ObjectName->Buffer, - pathname_new_ObjectAttributes.ObjectName->MaximumLength); - - err=NtSetInformationFile( - captive_file_slave_object_old->file_Handle, /* FileHandle */ - &file_IoStatusBlock, /* IoStatusBlock */ - FileRenameInformation_structp, /* FileInformation */ - sizeof(*FileRenameInformation_structp)+pathname_new_ObjectAttributes.ObjectName->MaximumLength, /* Length */ - FileRenameInformation); /* FileInformationClass */ - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - goto err_free_ObjectAttributes; - g_return_val_if_fail(NT_SUCCESS(err),GNOME_VFS_ERROR_GENERIC); - - errvfsresult=GNOME_VFS_OK; - -err_free_ObjectAttributes: - g_free(pathname_new_ObjectAttributes.ObjectName); /* left from captive_file_slave_uri_parent_init() */ - - captive_leave(); - return errvfsresult; -} diff --git a/src/libcaptive/client/file-slave.h b/src/libcaptive/client/file-slave.h deleted file mode 100644 index c05dd7a..0000000 --- a/src/libcaptive/client/file-slave.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $Id$ - * Include file for captive vfs 'file' private interface to reactos of sandbox slave - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_FILE_SLAVE_H -#define _CAPTIVE_CLIENT_PRIV_FILE_SLAVE_H 1 - - -#include -#include -#include -#include -#include "captive/client-file.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_FILE_SLAVE_TYPE_OBJECT (captive_file_slave_object_get_type()) -#define CAPTIVE_FILE_SLAVE_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_FILE_SLAVE_TYPE_OBJECT,CaptiveFileSlaveObject)) -#define CAPTIVE_FILE_SLAVE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_FILE_SLAVE_TYPE_OBJECT,CaptiveFileSlaveObjectClass)) -#define CAPTIVE_FILE_SLAVE_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_FILE_SLAVE_TYPE_OBJECT)) -#define CAPTIVE_FILE_SLAVE_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_FILE_SLAVE_TYPE_OBJECT)) -#define CAPTIVE_FILE_SLAVE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_FILE_SLAVE_TYPE_OBJECT,CaptiveFileSlaveObjectClass)) -typedef struct _CaptiveFileSlaveObject CaptiveFileSlaveObject; -typedef struct _CaptiveFileSlaveObjectClass CaptiveFileSlaveObjectClass; - - -GType captive_file_slave_object_get_type(void); - -GnomeVFSResult captive_file_slave_new_open(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode); -GnomeVFSResult captive_file_slave_new_create(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_FILE_SLAVE_H */ diff --git a/src/libcaptive/client/file.c b/src/libcaptive/client/file.c deleted file mode 100644 index b1268be..0000000 --- a/src/libcaptive/client/file.c +++ /dev/null @@ -1,236 +0,0 @@ -/* $Id$ - * captive vfs 'file' interface to reactos - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/client-file.h" /* self */ -#include "file.h" /* self-priv */ -#include -#include "vfs.h" -#include "reactos/ntos/types.h" /* for ULONG */ - - -static gpointer captive_file_object_parent_class=NULL; - - -static GnomeVFSResult captive_file_close(CaptiveFileObject *captive_file_object); - -static void captive_file_object_finalize(CaptiveFileObject *captive_file_object) -{ - g_return_if_fail(captive_file_object!=NULL); - - captive_file_close(captive_file_object); /* errors ignored */ - - G_OBJECT_CLASS(captive_file_object_parent_class)->finalize((GObject *)captive_file_object); -} - - -static void captive_file_object_class_init(CaptiveFileObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); - - captive_file_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_file_object_finalize; -} - - -static void captive_file_object_init(CaptiveFileObject *captive_file_object) -{ -} - - -GType captive_file_object_get_type(void) -{ -static GType captive_file_object_type=0; - - if (!captive_file_object_type) { -static const GTypeInfo captive_file_object_info={ - sizeof(CaptiveFileObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_file_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveFileObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_file_object_init, - }; - - captive_file_object_type=g_type_register_static(G_TYPE_OBJECT, - "CaptiveFileObject",&captive_file_object_info,G_TYPE_FLAG_ABSTRACT); - } - - return captive_file_object_type; -} - - -GnomeVFSResult captive_file_new_open(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode) -{ - g_return_val_if_fail(captive_file_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_VFS_OBJECT_GET_CLASS(captive_vfs_object)->file_new_open) - (captive_file_object_return,captive_vfs_object,pathname,mode); -} - - -GnomeVFSResult captive_file_new_create(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm) -{ - g_return_val_if_fail(captive_file_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_VFS_OBJECT_GET_CLASS(captive_vfs_object)->file_new_create) - (captive_file_object_return,captive_vfs_object,pathname,mode,exclusive,perm); -} - - -GnomeVFSResult captive_file_init(CaptiveFileObject *captive_file_object,CaptiveVfsObject *captive_vfs_object) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_file_object->vfs==NULL,GNOME_VFS_ERROR_GENERIC); - - captive_file_object->vfs=g_object_ref(captive_vfs_object); - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_file_close(CaptiveFileObject *captive_file_object) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (captive_file_object->vfs!=NULL) { - g_assert(CAPTIVE_VFS_IS_OBJECT(captive_file_object->vfs)); - g_object_unref(captive_file_object->vfs); - captive_file_object->vfs=NULL; - } - - return GNOME_VFS_OK; -} - - -CaptiveVfsObject *captive_file_ref_vfs(CaptiveFileObject *captive_file_object) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),NULL); - - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_file_object->vfs),NULL); - - return g_object_ref(captive_file_object->vfs); -} - - -GnomeVFSResult captive_file_read(CaptiveFileObject *captive_file_object, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_read_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object)->read) - (captive_file_object,buffer,num_bytes,bytes_read_return); -} - - -GnomeVFSResult captive_file_write(CaptiveFileObject *captive_file_object, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_written_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object)->write) - (captive_file_object,buffer,num_bytes,bytes_written_return); -} - - -GnomeVFSResult captive_file_seek - (CaptiveFileObject *captive_file_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object)->seek) - (captive_file_object,whence,offset); -} - - -GnomeVFSResult captive_file_tell(CaptiveFileObject *captive_file_object,GnomeVFSFileOffset *offset_return) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object)->tell) - (captive_file_object,offset_return); -} - - -GnomeVFSResult captive_file_remove(CaptiveFileObject *captive_file_object) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object)->remove) - (captive_file_object); -} - - -GnomeVFSResult captive_file_file_info_get(CaptiveFileObject *captive_file_object, - GnomeVFSFileInfo *file_info) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object)->file_info_get) - (captive_file_object,file_info); -} - - -GnomeVFSResult captive_file_file_info_set(CaptiveFileObject *captive_file_object, - const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object)->file_info_set) - (captive_file_object,info,mask); -} - - -GnomeVFSResult captive_file_truncate(CaptiveFileObject *captive_file_object,GnomeVFSFileSize file_size) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object)->truncate) - (captive_file_object,file_size); -} - - -GnomeVFSResult captive_file_move(CaptiveFileObject *captive_file_object_old,const gchar *pathname_new,gboolean force_replace) -{ - g_return_val_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object_old),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname_new!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_FILE_OBJECT_GET_CLASS(captive_file_object_old)->move) - (captive_file_object_old,pathname_new,force_replace); -} diff --git a/src/libcaptive/client/file.h b/src/libcaptive/client/file.h deleted file mode 100644 index e4f1af5..0000000 --- a/src/libcaptive/client/file.h +++ /dev/null @@ -1,61 +0,0 @@ -/* $Id$ - * Include file for captive vfs 'file' private interface to reactos - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_FILE_H -#define _CAPTIVE_CLIENT_PRIV_FILE_H 1 - - -#include -#include -#include "captive/client-vfs.h" - - -G_BEGIN_DECLS - -struct _CaptiveFileObject { - GObject parent_instance; - - /*< private >*/ - CaptiveVfsObject *vfs; - }; -struct _CaptiveFileObjectClass { - GObjectClass parent_class; - - GnomeVFSResult (*read)(CaptiveFileObject *captive_file_object, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return); - GnomeVFSResult (*write)(CaptiveFileObject *captive_file_object, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return); - GnomeVFSResult (*seek) - (CaptiveFileObject *captive_file_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset); - GnomeVFSResult (*tell)(CaptiveFileObject *captive_file_object,GnomeVFSFileOffset *offset_return); - GnomeVFSResult (*remove)(CaptiveFileObject *captive_file_object); - GnomeVFSResult (*file_info_get)(CaptiveFileObject *captive_file_object, - GnomeVFSFileInfo *file_info); - GnomeVFSResult (*file_info_set)(CaptiveFileObject *captive_file_object, - const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask); - GnomeVFSResult (*truncate)(CaptiveFileObject *captive_file_object,GnomeVFSFileSize file_size); - GnomeVFSResult (*move)(CaptiveFileObject *captive_file_object_old,const gchar *pathname_new,gboolean force_replace); - }; - -GnomeVFSResult captive_file_init(CaptiveFileObject *captive_file_object,CaptiveVfsObject *captive_vfs_object); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_FILE_H */ diff --git a/src/libcaptive/client/giochannel-blind.c b/src/libcaptive/client/giochannel-blind.c deleted file mode 100644 index e96b904..0000000 --- a/src/libcaptive/client/giochannel-blind.c +++ /dev/null @@ -1,798 +0,0 @@ -/* $Id$ - * glib r/w GIOChannel buffered-over r/o GIOChannel for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "giochannel-blind.h" -#include "reactos/internal/mm.h" /* for PAGE_SIZE */ -#include -#include -#include "captive/macros.h" -#include "captive/storage.h" -#include -#include -#include -#include "captive/libxml.h" -#include -#ifdef HAVE_LIBXML_BUFFERING -#include -#endif -#include "lib.h" /* for captive_giochannel_setup(); FIXME: pathname */ - - -/* CONFIG: */ -/* It should be the divisor of all offsets/sizes written by W32 filesystems. - */ -#define GIOCHANNEL_BLIND_BLOCK_SIZE 512 - - -/* FIXME: fill 'err' */ - -struct captive_giochannel_blind { - GIOChannel iochannel; - GIOChannel *giochannel_orig; /* reffed by us */ - guint64 offset; /* gint64 range */ - guint64 size; - GHashTable *buffer_hash; /* (guint64 *) -> (struct blind_block *) (guint8[GIOCHANNEL_BLIND_BLOCK_SIZE]) */ - }; - -struct blind_block { - guint64 offset; - gboolean was_read,was_written; - guint8 *data_written; /* [GIOCHANNEL_BLIND_BLOCK_SIZE] */ - }; - - -G_LOCK_DEFINE_STATIC(giochannel_blind_funcs); -static GIOFuncs giochannel_blind_funcs; - - -static guint captive_giochannel_blind_hash_func(const guint64 *keyp) -{ - g_return_val_if_fail(keyp!=NULL,0); - - return (*keyp)^((*keyp)>>23); -} - -static gboolean captive_giochannel_blind_equal_func(const guint64 *ap,const guint64 *bp) -{ - g_return_val_if_fail(ap!=NULL,FALSE); - g_return_val_if_fail(bp!=NULL,FALSE); - - return (*ap)==(*bp); -} - -static void captive_giochannel_blind_key_destroy_func(guint64 *keyp) -{ - g_return_if_fail(keyp!=NULL); - - g_free(keyp); -} - -static void captive_giochannel_blind_value_destroy_func(struct blind_block *blind_block) -{ - g_return_if_fail(blind_block!=NULL); - - g_free(blind_block->data_written); - g_free(blind_block); -} - - -static gboolean validate_giochannel_blind(struct captive_giochannel_blind *giochannel_blind) -{ - g_return_val_if_fail(giochannel_blind->iochannel.funcs==&giochannel_blind_funcs,FALSE); - g_return_val_if_fail(giochannel_blind!=NULL,FALSE); - /* 'giochannel_blind->giochannel_orig' may be NULL. */ - g_return_val_if_fail((gint64)giochannel_blind->offset>=0,FALSE); /* gint64 overflow stored in guint64 */ - g_return_val_if_fail(giochannel_blind->buffer_hash!=NULL,FALSE); - - return TRUE; -} - - -static GIOStatus captive_giochannel_blind_io_read - (GIOChannel *channel,gchar *buf,gsize count,gsize *bytes_read,GError **err) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)channel; -guint64 window_bottom,window_top,window_now; -guint64 transfer_bottom,transfer_top; -GIOStatus errgiostatus; -guint64 maxread; /* maximum offset of end of data we successfuly read */ -struct blind_block *blind_block; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),G_IO_STATUS_ERROR); - g_return_val_if_fail(buf!=NULL,G_IO_STATUS_ERROR); - g_return_val_if_fail(bytes_read!=NULL,G_IO_STATUS_ERROR); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: read(offset=0x%llX,count=0x%lX)",G_STRLOC, - giochannel_blind->offset,(gulong)count); - - window_bottom=CAPTIVE_ROUND_DOWN64(giochannel_blind->offset,GIOCHANNEL_BLIND_BLOCK_SIZE); - window_top=CAPTIVE_ROUND_UP64(giochannel_blind->offset+count,GIOCHANNEL_BLIND_BLOCK_SIZE); - maxread=giochannel_blind->offset; - - for (window_now=window_bottom;window_nowoffset); - transfer_top=MIN(window_now+GIOCHANNEL_BLIND_BLOCK_SIZE,giochannel_blind->offset+count); - if ((blind_block=g_hash_table_lookup(giochannel_blind->buffer_hash,&window_now)) && blind_block->data_written) { - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: read-from-memcpy(window_now=0x%llX,dest=buf+0x%lX,src=data+0x%lX,n=0x%lX)", - G_STRLOC, - (guint64)window_now,(gulong)(transfer_bottom-giochannel_blind->offset),(gulong)(transfer_bottom-window_now), - (gulong)(transfer_top-transfer_bottom)); - memcpy( - buf+transfer_bottom-giochannel_blind->offset, /* dest */ - blind_block->data_written+transfer_bottom-window_now, /* src */ - transfer_top-transfer_bottom); /* n */ - blind_block->was_read=TRUE; - maxread=transfer_top; - continue; - } - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: read-from-io(window_now=0x%llX,buf=buf+0x%lX,seek=0x%llX,count=0x%lX)",G_STRLOC, - (guint64)window_now,(gulong)(transfer_bottom-giochannel_blind->offset),(guint64)transfer_bottom, - (gulong)(transfer_top-transfer_bottom)); - if (!giochannel_blind->giochannel_orig) { - g_error("%s: Missing block at offset 0x%llX",G_STRLOC,(unsigned long long)window_now); - g_return_val_if_reached(G_IO_STATUS_ERROR); - } - errgiostatus=g_io_channel_seek_position( - giochannel_blind->giochannel_orig, /* channel */ - transfer_bottom, /* offset */ - G_SEEK_SET, /* type */ - err); /* error */ - /* During seek in block device such as on URL file:///dev/hda1#captive-fastfat.sys-ro:/ - * we will do llseek(2) on "/dev/hda1" device from captive_giochannel_size(). - * Although we are allowed to seek behind EOF on regular files - * at least linux-kernel-2.4.19-ac4/fs/block_dev.c/block_llseek() will give - * EINVAL on seek behind EOF therefore it must be accepted without complaints by us. - */ - if (errgiostatus!=G_IO_STATUS_NORMAL) { - errgiostatus=G_IO_STATUS_EOF; - bytes_read=0; - } - else { - errgiostatus=g_io_channel_read_chars( - giochannel_blind->giochannel_orig, /* channel */ - buf+transfer_bottom-giochannel_blind->offset, /* buf */ - transfer_top-transfer_bottom, /* count */ - &bytes_read, /* bytes_read */ - err); /* error */ - } - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL || errgiostatus==G_IO_STATUS_EOF,errgiostatus); - g_return_val_if_fail(bytes_read<=(transfer_top-transfer_bottom),G_IO_STATUS_ERROR); - g_return_val_if_fail((errgiostatus==G_IO_STATUS_EOF)==(bytes_read==0),G_IO_STATUS_ERROR); - if (bytes_read) { - if (!blind_block) { -guint64 *keyp; - - captive_new(blind_block); - blind_block->offset=window_now; - blind_block->was_read=FALSE; - blind_block->was_written=FALSE; - blind_block->data_written=NULL; - captive_new(keyp); - *keyp=window_now; - g_hash_table_insert( - giochannel_blind->buffer_hash, /* hash_table */ - keyp, /* key */ - blind_block); /* value */ - } - blind_block->was_read=TRUE; - } - maxread=transfer_bottom+bytes_read; - if (bytes_read==transfer_top-transfer_bottom) - g_return_val_if_fail(transfer_bottom+bytes_read<=giochannel_blind->size,G_IO_STATUS_ERROR); - else - break; - } - - *bytes_read=maxread-giochannel_blind->offset; - giochannel_blind->offset=maxread; - return (*bytes_read == 0 ? G_IO_STATUS_EOF : G_IO_STATUS_NORMAL); -} - - -static GIOStatus captive_giochannel_blind_io_write - (GIOChannel *channel,const gchar *buf,gsize count,gsize *bytes_written,GError **err) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)channel; -guint64 window_bottom,window_top,window_now; -guint64 transfer_bottom,transfer_top; -GIOStatus errgiostatus; -struct blind_block *blind_block; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),G_IO_STATUS_ERROR); - g_return_val_if_fail(buf!=NULL,G_IO_STATUS_ERROR); - g_return_val_if_fail(bytes_written!=NULL,G_IO_STATUS_ERROR); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: write(offset=0x%llX,count=0x%lX)",G_STRLOC, - giochannel_blind->offset,(gulong)count); - - g_return_val_if_fail(giochannel_blind->offset+count<=giochannel_blind->size,G_IO_STATUS_ERROR); - - g_return_val_if_fail(giochannel_blind->iochannel.is_writeable==TRUE,G_IO_STATUS_ERROR); - - window_bottom=CAPTIVE_ROUND_DOWN64(giochannel_blind->offset,GIOCHANNEL_BLIND_BLOCK_SIZE); - window_top=CAPTIVE_ROUND_UP64(giochannel_blind->offset+count,GIOCHANNEL_BLIND_BLOCK_SIZE); - - for (window_now=window_bottom;window_nowoffset); - transfer_top=MIN(window_now+GIOCHANNEL_BLIND_BLOCK_SIZE,giochannel_blind->offset+count); - if (!(blind_block=g_hash_table_lookup(giochannel_blind->buffer_hash,&window_now)) || !blind_block->data_written) { - if (!blind_block) { -guint64 *keyp; - - captive_new(blind_block); - blind_block->offset=window_now; - blind_block->was_read=FALSE; - blind_block->was_written=FALSE; - captive_new(keyp); - *keyp=window_now; - g_hash_table_insert( - giochannel_blind->buffer_hash, /* hash_table */ - keyp, /* key */ - blind_block); /* value */ - } - blind_block->data_written=g_malloc(GIOCHANNEL_BLIND_BLOCK_SIZE); - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: write-new-mem(window_now=0x%llX)",G_STRLOC, - (guint64)window_now); - - /* Missing lower part of buffer? */ - if (transfer_bottom>window_now) { - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: write-mem-read-lower(seek=0x%llX,count=0x%lX)",G_STRLOC, - (guint64)window_now,(gulong)(transfer_bottom-window_now)); - if (!giochannel_blind->giochannel_orig) { - g_error("Missing block for partial read at offset 0x%llX",(unsigned long long)window_now); - g_assert_not_reached(); - } - errgiostatus=g_io_channel_seek_position( - giochannel_blind->giochannel_orig, /* channel */ - window_now, /* offset */ - G_SEEK_SET, /* type */ - err); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,errgiostatus); - errgiostatus=g_io_channel_read_chars( - giochannel_blind->giochannel_orig, /* channel */ - (gchar *)blind_block->data_written, /* buf */ - transfer_bottom-window_now, /* count */ - &bytes_read, /* bytes_read */ - err); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,errgiostatus); - g_return_val_if_fail(bytes_read==(transfer_bottom-window_now),G_IO_STATUS_ERROR); - blind_block->was_read=TRUE; /* FIXME: Support non-block-aligned buffers. */ - } - - /* Missing upper part of buffer? */ - if (transfer_topgiochannel_orig) { - g_error("Missing block for partial read at offset 0x%llX",(unsigned long long)window_now); - g_assert_not_reached(); - } - errgiostatus=g_io_channel_seek_position( - giochannel_blind->giochannel_orig, /* channel */ - transfer_top, /* offset */ - G_SEEK_SET, /* type */ - err); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,errgiostatus); - errgiostatus=g_io_channel_read_chars( - giochannel_blind->giochannel_orig, /* channel */ - (gchar *)(blind_block->data_written+transfer_top-window_now), /* buf */ - window_now+GIOCHANNEL_BLIND_BLOCK_SIZE-transfer_top, /* count */ - &bytes_read, /* bytes_read */ - err); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL || errgiostatus==G_IO_STATUS_EOF,errgiostatus); - g_return_val_if_fail(bytes_read<=(window_now+GIOCHANNEL_BLIND_BLOCK_SIZE-transfer_top),G_IO_STATUS_ERROR); - g_return_val_if_fail((errgiostatus==G_IO_STATUS_EOF)==(bytes_read==0),G_IO_STATUS_ERROR); - if (bytes_read==window_now+GIOCHANNEL_BLIND_BLOCK_SIZE-transfer_top) - g_return_val_if_fail(transfer_top+bytes_read<=giochannel_blind->size,G_IO_STATUS_ERROR); - else - g_return_val_if_fail(transfer_top+bytes_read==giochannel_blind->size,G_IO_STATUS_ERROR); /* EOF hit */ - blind_block->was_read=TRUE; /* FIXME: Support non-block-aligned buffers. */ - } - - } - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: write-by-memcpy(window_now=0x%llX,dest=data+0x%lX,src=buf+0x%lX,n=0x%lX)", - G_STRLOC, - (guint64)window_now,(gulong)(transfer_bottom-window_now),(gulong)(transfer_bottom-giochannel_blind->offset), - (gulong)(transfer_top-transfer_bottom)); - g_assert(blind_block); g_assert(blind_block->data_written); - memcpy( - ((char *)blind_block->data_written)+transfer_bottom-window_now, /* dest */ - buf+transfer_bottom-giochannel_blind->offset, /* src */ - transfer_top-transfer_bottom); /* n */ - blind_block->was_written=TRUE; - } - - *bytes_written=count; - giochannel_blind->offset+=(*bytes_written); - return G_IO_STATUS_NORMAL; -} - - -static GIOStatus captive_giochannel_blind_io_seek(GIOChannel *channel,gint64 offset,GSeekType type,GError **err) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)channel; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),G_IO_STATUS_ERROR); - - switch (type) { - case G_SEEK_CUR: giochannel_blind->offset+= offset; break; - case G_SEEK_SET: giochannel_blind->offset = offset; break; - case G_SEEK_END: giochannel_blind->offset =giochannel_blind->size+offset; break; - default: g_return_val_if_reached(G_IO_STATUS_ERROR); - } - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),G_IO_STATUS_ERROR); /* 'offset' overflow? */ - - return G_IO_STATUS_NORMAL; -} - - -static GIOStatus captive_giochannel_blind_io_close(GIOChannel *channel,GError **err) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)channel; -GIOStatus erriostatus; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),G_IO_STATUS_ERROR); - - if (giochannel_blind->giochannel_orig) { - /* Just a sanity if 'giochannel_orig' is already falsely reffed a bit more... */ - erriostatus=g_io_channel_flush( - giochannel_blind->giochannel_orig, /* channel */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - - g_io_channel_unref(giochannel_blind->giochannel_orig); - giochannel_blind->giochannel_orig=NULL; - } - - g_hash_table_destroy(giochannel_blind->buffer_hash); - giochannel_blind->buffer_hash=NULL; - - return G_IO_STATUS_NORMAL; -} - - -static GSource* captive_giochannel_blind_io_create_watch(GIOChannel *channel,GIOCondition condition) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)channel; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),NULL); - - g_return_val_if_reached(NULL); /* FIXME: NOT IMPLEMENTED YET */ -} - - -static void captive_giochannel_blind_io_free(GIOChannel *channel) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)channel; - - /* After captive_giochannel_blind_io_close() 'giochannel_blind' - * may be no longer valid for validate_giochannel_blind(giochannel_blind). - */ - g_return_if_fail(giochannel_blind!=NULL); - - g_assert(giochannel_blind->giochannel_orig==NULL); - g_assert(giochannel_blind->buffer_hash==NULL); - - g_free(giochannel_blind); -} - - -static GIOStatus captive_giochannel_blind_io_set_flags(GIOChannel *channel,GIOFlags flags,GError **err) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)channel; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),G_IO_STATUS_ERROR); - - if (!giochannel_blind->giochannel_orig) - return G_IO_STATUS_NORMAL; - - return g_io_channel_set_flags(giochannel_blind->giochannel_orig,(flags&~G_IO_FLAG_IS_WRITEABLE),err); -} - - -static GIOFlags captive_giochannel_blind_io_get_flags(GIOChannel *channel) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)channel; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),0); - - if (!giochannel_blind->giochannel_orig) - return G_IO_FLAG_IS_READABLE | G_IO_FLAG_IS_WRITEABLE | G_IO_FLAG_IS_SEEKABLE; - - return g_io_channel_get_flags(giochannel_blind->giochannel_orig) | G_IO_FLAG_IS_WRITEABLE; -} - - -struct captive_giochannel_blind *captive_giochannel_blind_new(GIOChannel *giochannel_orig,gboolean writeable) -{ -struct captive_giochannel_blind *giochannel_blind; - - /* 'giochannel_orig' may be NULL if no fallback capability exists. */ - - G_LOCK(giochannel_blind_funcs); - giochannel_blind_funcs.io_read =captive_giochannel_blind_io_read; - giochannel_blind_funcs.io_write =captive_giochannel_blind_io_write; - giochannel_blind_funcs.io_seek =captive_giochannel_blind_io_seek; - giochannel_blind_funcs.io_close =captive_giochannel_blind_io_close; - giochannel_blind_funcs.io_create_watch=captive_giochannel_blind_io_create_watch; - giochannel_blind_funcs.io_free =captive_giochannel_blind_io_free; - giochannel_blind_funcs.io_set_flags =captive_giochannel_blind_io_set_flags; - giochannel_blind_funcs.io_get_flags =captive_giochannel_blind_io_get_flags; - G_UNLOCK(giochannel_blind_funcs); - - if (giochannel_orig) - captive_giochannel_setup(giochannel_orig); - - g_io_channel_ref(giochannel_orig); - - captive_new(giochannel_blind); - g_assert(G_STRUCT_OFFSET(struct captive_giochannel_blind,iochannel)==0); /* safely re-type-able */ - g_io_channel_init(&giochannel_blind->iochannel); - giochannel_blind->iochannel.funcs=&giochannel_blind_funcs; - giochannel_blind->iochannel.is_seekable=TRUE; - giochannel_blind->iochannel.is_readable=TRUE; - /* readonly captive_giochannel_blind can be used to track read access. */ - giochannel_blind->iochannel.is_writeable=writeable; - giochannel_blind->iochannel.close_on_unref=TRUE; /* run g_io_channel_shutdown() flush on last unref */ - giochannel_blind->giochannel_orig=giochannel_orig; - giochannel_blind->offset=0; - giochannel_blind->size=(!giochannel_orig ? 0 : captive_giochannel_size(giochannel_orig)); - giochannel_blind->buffer_hash=g_hash_table_new_full( - (GHashFunc)captive_giochannel_blind_hash_func, /* hash_func */ - (GEqualFunc)captive_giochannel_blind_equal_func, /* key_equal_func */ - (GDestroyNotify)captive_giochannel_blind_key_destroy_func, /* key_destroy_func */ - (GDestroyNotify)captive_giochannel_blind_value_destroy_func); /* value_destroy_func */ - - captive_giochannel_setup(&giochannel_blind->iochannel); - - return giochannel_blind; -} - - -gboolean captive_giochannel_blind_get_size(GIOChannel *giochannel,guint64 *size_return) -{ -struct captive_giochannel_blind *giochannel_blind; - - g_return_val_if_fail(giochannel!=NULL,FALSE); - g_return_val_if_fail(size_return!=NULL,FALSE); - - if (giochannel->funcs!=&giochannel_blind_funcs) - return FALSE; - giochannel_blind=(struct captive_giochannel_blind *)giochannel; - - *size_return=giochannel_blind->size; - return TRUE; -} - - -typedef void (*sorted_array_filter) - (const guint64 *keyp,const struct blind_block *blind_block,const struct blind_block ***rpp /* user_data */); - -static void captive_giochannel_blind_written_as_sorted_array_foreach - (const guint64 *keyp,const struct blind_block *blind_block,const struct blind_block ***rpp /* user_data */) -{ - g_return_if_fail(keyp!=NULL); - g_return_if_fail(blind_block!=NULL); - g_return_if_fail(rpp!=NULL); - - if (!blind_block->data_written) - return; - - *((*rpp)++)=blind_block; -} - -static void captive_giochannel_blind_read_as_sorted_array_foreach - (const guint64 *keyp,const struct blind_block *blind_block,const struct blind_block ***rpp /* user_data */) -{ - g_return_if_fail(keyp!=NULL); - g_return_if_fail(blind_block!=NULL); - g_return_if_fail(rpp!=NULL); - - if (!blind_block->was_read) - return; - - *((*rpp)++)=blind_block; -} - -static int captive_giochannel_blind_as_sorted_array_compat - (const struct blind_block *const *ap,const struct blind_block *const *bp) -{ - g_return_val_if_fail(ap!=NULL,0); - g_return_val_if_fail(*ap!=NULL,0); - g_return_val_if_fail(bp!=NULL,0); - g_return_val_if_fail(*bp!=NULL,0); - - return ((*ap)->offset>(*bp)->offset) - ((*bp)->offset>(*ap)->offset); -} - -static struct blind_block **captive_giochannel_blind_as_sorted_array - (struct captive_giochannel_blind *giochannel_blind,sorted_array_filter filter_func) -{ -guint hash_size; -struct blind_block **r,**rp; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),G_IO_STATUS_ERROR); - - hash_size=g_hash_table_size(giochannel_blind->buffer_hash); - captive_newn(r,hash_size+1); - rp=r; - g_hash_table_foreach(giochannel_blind->buffer_hash,(GHFunc)filter_func,&rp); - g_assert(rp<=r+hash_size); - *rp=NULL; - qsort(r,rp-r,sizeof(*r),(int (*)(const void *,const void *))captive_giochannel_blind_as_sorted_array_compat); - - return r; -} - -GIOStatus captive_giochannel_blind_commit(GIOChannel *giochannel) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)giochannel; -struct blind_block **blind_block_array,**blind_blockp; -GIOStatus errgiostatus; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),G_IO_STATUS_ERROR); - g_return_val_if_fail(giochannel_blind->giochannel_orig!=NULL,G_IO_STATUS_ERROR); - - errgiostatus=g_io_channel_flush( - giochannel, /* channel */ - NULL); /* error */ - g_assert(errgiostatus==G_IO_STATUS_NORMAL); - - blind_block_array=captive_giochannel_blind_as_sorted_array - (giochannel_blind,captive_giochannel_blind_written_as_sorted_array_foreach); - - for (blind_blockp=blind_block_array;*blind_blockp;blind_blockp++) { -struct blind_block *blind_block=*blind_blockp; -gsize bytes_written; - - g_assert(blind_block->data_written!=NULL); - - errgiostatus=g_io_channel_seek_position( - giochannel_blind->giochannel_orig, /* channel */ - blind_block->offset, /* offset */ - G_SEEK_SET, /* type */ - NULL); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,errgiostatus); - errgiostatus=g_io_channel_write_chars( - giochannel_blind->giochannel_orig, /* channel */ - (const gchar *)blind_block->data_written, /* buf */ - GIOCHANNEL_BLIND_BLOCK_SIZE, /* count */ - &bytes_written, /* bytes_written */ - NULL); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,errgiostatus); - g_return_val_if_fail(bytes_written==GIOCHANNEL_BLIND_BLOCK_SIZE,G_IO_STATUS_ERROR); - - g_free(blind_block->data_written); - blind_block->data_written=NULL; - } - - g_free(blind_block_array); - - errgiostatus=g_io_channel_flush( - giochannel_blind->giochannel_orig, /* channel */ - NULL); /* error */ - g_assert(errgiostatus==G_IO_STATUS_NORMAL); - - return G_IO_STATUS_NORMAL; -} - - -xmlNode *captive_giochannel_blind_readreport_to_xml(xmlNode *xml_parent,GIOChannel *giochannel) -{ -struct captive_giochannel_blind *giochannel_blind=(struct captive_giochannel_blind *)giochannel; -struct blind_block **blind_block_array,**blind_blockp; -GIOStatus errgiostatus; -guint8 data_read[1+GIOCHANNEL_BLIND_BLOCK_SIZE]; /* '1+' for leading stub to prevent shorter output of BN_bn2hex() */ -xmlNode *xml_media; - - g_return_val_if_fail(validate_giochannel_blind(giochannel_blind),NULL); - g_return_val_if_fail(giochannel_blind->giochannel_orig!=NULL,G_IO_STATUS_ERROR); - - errgiostatus=g_io_channel_flush( - giochannel, /* channel */ - NULL); /* error */ - g_assert(errgiostatus==G_IO_STATUS_NORMAL); - - xml_media=xmlNewTextChild(xml_parent,NULL,BAD_CAST "media",NULL); - xmlNewProp(xml_media,BAD_CAST "size",BAD_CAST captive_printf_alloca("%" G_GUINT64_FORMAT,giochannel_blind->size)); - - blind_block_array=captive_giochannel_blind_as_sorted_array - (giochannel_blind,captive_giochannel_blind_read_as_sorted_array_foreach); - - for (blind_blockp=blind_block_array;*blind_blockp;blind_blockp++) { -struct blind_block *blind_block=*blind_blockp; -gsize bytes_read; -xmlNode *xml_media_read; -gchar offset_string[64]; -BIGNUM *bignum; -char *hex,*s; -gchar hex_out[0 - +1 /* leading '\n' */ - +GIOCHANNEL_BLIND_BLOCK_SIZE*2/64*(64+1) /* each line of 64 characters has EOL '\n' */ - +1],*gd; /* terminating '\0' */ - - errgiostatus=g_io_channel_seek_position( - giochannel_blind->giochannel_orig, /* channel */ - blind_block->offset, /* offset */ - G_SEEK_SET, /* type */ - NULL); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,NULL); - errgiostatus=g_io_channel_read_chars( - giochannel_blind->giochannel_orig, /* channel */ - (gchar *)(data_read+1), /* buf */ - GIOCHANNEL_BLIND_BLOCK_SIZE, /* count */ - &bytes_read, /* bytes_read */ - NULL); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,NULL); - g_return_val_if_fail(bytes_read==GIOCHANNEL_BLIND_BLOCK_SIZE,NULL); - - /* Convert binary block to 'hex' and reformat line-wrap it to 'hex_out'. */ - data_read[0]=0xFF; /* stub to prevent shorter output of BN_bn2hex() */ - bignum=BN_bin2bn(data_read,1+GIOCHANNEL_BLIND_BLOCK_SIZE,NULL); - hex=BN_bn2hex(bignum); - BN_free(bignum); - g_assert(strlen(hex)==2*(1+GIOCHANNEL_BLIND_BLOCK_SIZE)); - gd=hex_out; - *gd++='\n'; - for (s=hex+2;soffset); - xmlNewProp(xml_media_read,BAD_CAST "offset",BAD_CAST offset_string); - } - } - - g_free(blind_block_array); - - return xml_media; -} - -#ifdef HAVE_LIBXML_BUFFERING -struct captive_giochannel_blind *captive_giochannel_blind_new_from_xml(xmlTextReader *xml_reader) -{ -struct captive_giochannel_blind *r; -const gchar *xml_name; -int errint; -GIOStatus erriostatus; -gboolean scan_end; -struct captive_libxml_string_drop_stack *drop_stack=NULL; - - g_return_val_if_fail(xml_reader!=NULL,NULL); - g_return_val_if_fail(xmlTextReaderNodeType(xml_reader)==CAPTIVE_XML_TEXT_READER_NODE_TYPE_START,NULL); - xml_name=captive_libxml_string_drop(&drop_stack,xmlTextReaderName(xml_reader)); - g_return_val_if_fail(xml_name!=NULL,NULL); - g_return_val_if_fail(!strcmp(xml_name,"media"),NULL); - - r=captive_giochannel_blind_new( - NULL, /* giochannel_orig */ - TRUE); /* writeable */ - r->size=captive_libxml_sscanf_gint64(captive_libxml_string_drop(&drop_stack,xmlTextReaderGetAttribute(xml_reader,BAD_CAST "size"))); - - scan_end=FALSE; - do { -int got_type; - - errint=xmlTextReaderRead(xml_reader); - g_assert(errint==1); - switch ((got_type=xmlTextReaderNodeType(xml_reader))) { - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_COMMENT: - break; - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_SIGNIFICANT_WHITESPACE: - break; - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_TEXT: /* Even empty nodes have some '#text'. */ - break; - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_START: { -const gchar *xml_name; - - xml_name=captive_libxml_string_drop(&drop_stack,xmlTextReaderName(xml_reader)); - g_assert(xml_name!=NULL); - if (!strcmp(xml_name,"block")) { -guint64 offset; -gsize bytes_written; -const gchar *xml_text_hex_in,*xml_char_s; -BIGNUM *bignum; -int bignum_num_bytes; -gchar bin_hex[2*GIOCHANNEL_BLIND_BLOCK_SIZE+1],*gd; -unsigned char bin_out[GIOCHANNEL_BLIND_BLOCK_SIZE]; - - offset=captive_libxml_sscanf_gint64( - captive_libxml_string_drop(&drop_stack,xmlTextReaderGetAttribute(xml_reader,BAD_CAST "offset"))); - - errint=xmlTextReaderRead(xml_reader); - g_assert(errint==1); - errint=xmlTextReaderNodeType(xml_reader); - g_assert(errint==CAPTIVE_XML_TEXT_READER_NODE_TYPE_TEXT); - xml_text_hex_in=captive_libxml_string_drop(&drop_stack,xmlTextReaderValue(xml_reader)); - g_assert(xml_text_hex_in!=NULL); - - /* Convert binary block from hex line-wrapped 'xml_text_hex_in'. */ - gd=bin_hex; - for (xml_char_s=xml_text_hex_in;*xml_char_s;xml_char_s++) - if (!isspace(*xml_char_s)) { - g_assert(gdiochannel, /* channel */ - offset, /* offset */ - G_SEEK_SET, /* type */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - erriostatus=g_io_channel_write_chars( - &r->iochannel, /* channel */ - (const gchar *)bin_out, /* buf */ - GIOCHANNEL_BLIND_BLOCK_SIZE, /* count */ - &bytes_written, /* bytes_written */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - g_assert(bytes_written==GIOCHANNEL_BLIND_BLOCK_SIZE); - } - else g_error("Unknown START node: %s",xml_name); - } break; - case CAPTIVE_XML_TEXT_READER_NODE_TYPE_END: { -const gchar *xml_name; - - xml_name=captive_libxml_string_drop(&drop_stack,xmlTextReaderName(xml_reader)); - /**/ if (!strcmp(xml_name,"media")) { - scan_end=TRUE; /* proper cleanup */ - } - else if (!strcmp(xml_name,"block")) { - } - else g_error("Unknown END node: %s",xml_name); - } break; - default: - g_error("Unexpected xmlTextReaderNodeType() type %d",got_type); - g_assert_not_reached(); - } - captive_libxml_string_drop_flush(&drop_stack); - } while (!scan_end); - - g_assert(drop_stack==NULL); - - return r; -} -#endif /* HAVE_LIBXML_BUFFERING */ diff --git a/src/libcaptive/client/giochannel-blind.h b/src/libcaptive/client/giochannel-blind.h deleted file mode 100644 index b97ca7e..0000000 --- a/src/libcaptive/client/giochannel-blind.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * Include file for glib r/w GIOChannel buffered-over r/o GIOChannel for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_GNOMEVFS_GIOCHANNEL_BLIND_H -#define _CAPTIVE_GNOMEVFS_GIOCHANNEL_BLIND_H 1 - - -#include -#include -#ifdef HAVE_LIBXML_BUFFERING -#include -#endif - - -G_BEGIN_DECLS - -struct captive_giochannel_blind; - -struct captive_giochannel_blind *captive_giochannel_blind_new(GIOChannel *giochannel_ro,gboolean writeable); -gboolean captive_giochannel_blind_get_size(GIOChannel *giochannel,guint64 *size_return); -GIOStatus captive_giochannel_blind_commit(GIOChannel *giochannel_blind); -xmlNode *captive_giochannel_blind_readreport_to_xml(xmlNode *xml_parent,GIOChannel *giochannel); -#ifdef HAVE_LIBXML_BUFFERING -struct captive_giochannel_blind *captive_giochannel_blind_new_from_xml(xmlTextReader *xml_reader); -#endif - -G_END_DECLS - - -#endif /* _CAPTIVE_GNOMEVFS_GIOCHANNEL_BLIND_H */ diff --git a/src/libcaptive/client/giochannel-subrange.c b/src/libcaptive/client/giochannel-subrange.c deleted file mode 100644 index 3f34516..0000000 --- a/src/libcaptive/client/giochannel-subrange.c +++ /dev/null @@ -1,277 +0,0 @@ -/* $Id$ - * glib GIOChannel mapping subrange of parent GIOChannel for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "giochannel-subrange.h" -#include -#include "captive/macros.h" -#include "captive/storage.h" -#include -#include "lib.h" /* for captive_giochannel_setup() */ - - -/* FIXME: fill 'err' */ - -struct captive_giochannel_subrange { - GIOChannel iochannel; - GIOChannel *giochannel_orig; /* reffed by us */ - guint64 offset; /* gint64 range; read start+offset from 'giochannel_orig' */ - guint64 start,end; - }; - - -G_LOCK_DEFINE_STATIC(giochannel_subrange_funcs); -static GIOFuncs giochannel_subrange_funcs; - - -static gboolean validate_giochannel_subrange(struct captive_giochannel_subrange *giochannel_subrange) -{ - g_return_val_if_fail(giochannel_subrange->iochannel.funcs==&giochannel_subrange_funcs,FALSE); - g_return_val_if_fail(giochannel_subrange!=NULL,FALSE); - g_return_val_if_fail(giochannel_subrange->giochannel_orig!=NULL,FALSE); - g_return_val_if_fail((gint64)giochannel_subrange->offset>=0,FALSE); /* gint64 overflow stored in guint64 */ - g_return_val_if_fail(giochannel_subrange->start<=giochannel_subrange->end,FALSE); - g_return_val_if_fail(giochannel_subrange->offset<=(giochannel_subrange->end-giochannel_subrange->start),FALSE); - - return TRUE; -} - - -static GIOStatus captive_giochannel_subrange_io_read - (GIOChannel *channel,gchar *buf,gsize count,gsize *bytes_read,GError **err) -{ -struct captive_giochannel_subrange *giochannel_subrange=(struct captive_giochannel_subrange *)channel; -GIOStatus errgiostatus; - - g_return_val_if_fail(validate_giochannel_subrange(giochannel_subrange),G_IO_STATUS_ERROR); - g_return_val_if_fail(buf!=NULL,G_IO_STATUS_ERROR); - g_return_val_if_fail(bytes_read!=NULL,G_IO_STATUS_ERROR); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: read(offset=0x%llX,count=0x%lX)",G_STRLOC, - giochannel_subrange->offset,(gulong)count); - - errgiostatus=g_io_channel_seek_position( - giochannel_subrange->giochannel_orig, /* channel */ - giochannel_subrange->start+giochannel_subrange->offset, /* offset */ - G_SEEK_SET, /* type */ - err); /* error */ - /* During seek in block device such as on URL file:///dev/hda1#captive-fastfat.sys-ro:/ - * we will do llseek(2) on "/dev/hda1" device from captive_giochannel_size(). - * Although we are allowed to seek behind EOF on regular files - * at least linux-kernel-2.4.19-ac4/fs/block_dev.c/block_llseek() will give - * EINVAL on seek behind EOF therefore it must be accepted without complaints by us. - */ - if (errgiostatus!=G_IO_STATUS_NORMAL) { - errgiostatus=G_IO_STATUS_EOF; - *bytes_read=0; - } - else { - errgiostatus=g_io_channel_read_chars( - giochannel_subrange->giochannel_orig, /* channel */ - buf, /* buf */ - count, /* count */ - bytes_read, /* bytes_read */ - err); /* error */ - } - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL || errgiostatus==G_IO_STATUS_EOF,errgiostatus); - g_return_val_if_fail(*bytes_read<=count,G_IO_STATUS_ERROR); - g_return_val_if_fail((errgiostatus==G_IO_STATUS_EOF)==(bytes_read==0),G_IO_STATUS_ERROR); - - giochannel_subrange->offset+=*bytes_read; - return (*bytes_read == 0 ? G_IO_STATUS_EOF : G_IO_STATUS_NORMAL); -} - - -static GIOStatus captive_giochannel_subrange_io_write - (GIOChannel *channel,const gchar *buf,gsize count,gsize *bytes_written,GError **err) -{ -struct captive_giochannel_subrange *giochannel_subrange=(struct captive_giochannel_subrange *)channel; -GIOStatus errgiostatus; - - g_return_val_if_fail(validate_giochannel_subrange(giochannel_subrange),G_IO_STATUS_ERROR); - g_return_val_if_fail(buf!=NULL,G_IO_STATUS_ERROR); - g_return_val_if_fail(bytes_written!=NULL,G_IO_STATUS_ERROR); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: write(offset=0x%llX,count=0x%lX)",G_STRLOC, - giochannel_subrange->offset,(gulong)count); - - g_return_val_if_fail(giochannel_subrange->start+giochannel_subrange->offset+count<=giochannel_subrange->end, - G_IO_STATUS_ERROR); - - errgiostatus=g_io_channel_seek_position( - giochannel_subrange->giochannel_orig, /* channel */ - giochannel_subrange->start+giochannel_subrange->offset, /* offset */ - G_SEEK_SET, /* type */ - err); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,errgiostatus); - errgiostatus=g_io_channel_write_chars( - giochannel_subrange->giochannel_orig, /* channel */ - buf, /* buf */ - count, /* count */ - bytes_written, /* bytes_written */ - err); /* error */ - g_return_val_if_fail(errgiostatus==G_IO_STATUS_NORMAL,errgiostatus); - g_return_val_if_fail(*bytes_written==count,G_IO_STATUS_ERROR); - - giochannel_subrange->offset+=(*bytes_written); - return G_IO_STATUS_NORMAL; -} - - -static GIOStatus captive_giochannel_subrange_io_seek(GIOChannel *channel,gint64 offset,GSeekType type,GError **err) -{ -struct captive_giochannel_subrange *giochannel_subrange=(struct captive_giochannel_subrange *)channel; - - g_return_val_if_fail(validate_giochannel_subrange(giochannel_subrange),G_IO_STATUS_ERROR); - - switch (type) { - case G_SEEK_CUR: giochannel_subrange->offset+=offset; break; - case G_SEEK_SET: giochannel_subrange->offset =offset; break; - case G_SEEK_END: giochannel_subrange->offset =(giochannel_subrange->end-giochannel_subrange->start)+offset; break; - default: g_return_val_if_reached(G_IO_STATUS_ERROR); - } - g_return_val_if_fail(validate_giochannel_subrange(giochannel_subrange),G_IO_STATUS_ERROR); /* 'offset' overflow? */ - - return G_IO_STATUS_NORMAL; -} - - -static GIOStatus captive_giochannel_subrange_io_close(GIOChannel *channel,GError **err) -{ -struct captive_giochannel_subrange *giochannel_subrange=(struct captive_giochannel_subrange *)channel; -GIOStatus erriostatus; - - g_return_val_if_fail(validate_giochannel_subrange(giochannel_subrange),G_IO_STATUS_ERROR); - - if (giochannel_subrange->giochannel_orig) { - /* Just a sanity if 'giochannel_orig' is already falsely reffed a bit more... */ - erriostatus=g_io_channel_flush( - giochannel_subrange->giochannel_orig, /* channel */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - - g_io_channel_unref(giochannel_subrange->giochannel_orig); - giochannel_subrange->giochannel_orig=NULL; - } - - return G_IO_STATUS_NORMAL; -} - - -static GSource* captive_giochannel_subrange_io_create_watch(GIOChannel *channel,GIOCondition condition) -{ -struct captive_giochannel_subrange *giochannel_subrange=(struct captive_giochannel_subrange *)channel; - - g_return_val_if_fail(validate_giochannel_subrange(giochannel_subrange),NULL); - - g_return_val_if_reached(NULL); /* FIXME: NOT IMPLEMENTED YET */ -} - - -static void captive_giochannel_subrange_io_free(GIOChannel *channel) -{ -struct captive_giochannel_subrange *giochannel_subrange=(struct captive_giochannel_subrange *)channel; - - /* After captive_giochannel_subrange_io_close() 'giochannel_subrange' - * may be no longer valid for validate_giochannel_subrange(giochannel_subrange). - */ - g_return_if_fail(giochannel_subrange!=NULL); - - g_assert(giochannel_subrange->giochannel_orig==NULL); - - g_free(giochannel_subrange); -} - - -static GIOStatus captive_giochannel_subrange_io_set_flags(GIOChannel *channel,GIOFlags flags,GError **err) -{ -struct captive_giochannel_subrange *giochannel_subrange=(struct captive_giochannel_subrange *)channel; - - g_return_val_if_fail(validate_giochannel_subrange(giochannel_subrange),G_IO_STATUS_ERROR); - - return g_io_channel_set_flags(giochannel_subrange->giochannel_orig,flags,err); -} - - -static GIOFlags captive_giochannel_subrange_io_get_flags(GIOChannel *channel) -{ -struct captive_giochannel_subrange *giochannel_subrange=(struct captive_giochannel_subrange *)channel; - - g_return_val_if_fail(validate_giochannel_subrange(giochannel_subrange),0); - - return g_io_channel_get_flags(giochannel_subrange->giochannel_orig); -} - - -struct captive_giochannel_subrange *captive_giochannel_subrange_new(GIOChannel *giochannel_orig,guint64 start,guint64 end) -{ -struct captive_giochannel_subrange *giochannel_subrange; - - g_return_val_if_fail(giochannel_orig!=NULL,NULL); - g_return_val_if_fail(start<=end,NULL); - - G_LOCK(giochannel_subrange_funcs); - giochannel_subrange_funcs.io_read =captive_giochannel_subrange_io_read; - giochannel_subrange_funcs.io_write =captive_giochannel_subrange_io_write; - giochannel_subrange_funcs.io_seek =captive_giochannel_subrange_io_seek; - giochannel_subrange_funcs.io_close =captive_giochannel_subrange_io_close; - giochannel_subrange_funcs.io_create_watch=captive_giochannel_subrange_io_create_watch; - giochannel_subrange_funcs.io_free =captive_giochannel_subrange_io_free; - giochannel_subrange_funcs.io_set_flags =captive_giochannel_subrange_io_set_flags; - giochannel_subrange_funcs.io_get_flags =captive_giochannel_subrange_io_get_flags; - G_UNLOCK(giochannel_subrange_funcs); - - captive_giochannel_setup(giochannel_orig); - - g_io_channel_ref(giochannel_orig); - - captive_new(giochannel_subrange); - g_assert(G_STRUCT_OFFSET(struct captive_giochannel_subrange,iochannel)==0); /* safely re-type-able */ - g_io_channel_init(&giochannel_subrange->iochannel); - giochannel_subrange->iochannel.funcs=&giochannel_subrange_funcs; - giochannel_subrange->iochannel.is_seekable =!!(g_io_channel_get_flags(giochannel_orig) & G_IO_FLAG_IS_SEEKABLE); - giochannel_subrange->iochannel.is_readable =!!(g_io_channel_get_flags(giochannel_orig) & G_IO_FLAG_IS_READABLE); - giochannel_subrange->iochannel.is_writeable=!!(g_io_channel_get_flags(giochannel_orig) & G_IO_FLAG_IS_WRITEABLE); - giochannel_subrange->iochannel.close_on_unref=TRUE; /* run g_io_channel_shutdown() flush on last unref */ - giochannel_subrange->giochannel_orig=giochannel_orig; - giochannel_subrange->offset=0; - giochannel_subrange->start=start; - giochannel_subrange->end=end; - - captive_giochannel_setup(&giochannel_subrange->iochannel); - - return giochannel_subrange; -} - - -gboolean captive_giochannel_subrange_get_size(GIOChannel *giochannel,guint64 *size_return) -{ -struct captive_giochannel_subrange *giochannel_subrange; - - g_return_val_if_fail(giochannel!=NULL,FALSE); - g_return_val_if_fail(size_return!=NULL,FALSE); - - if (giochannel->funcs!=&giochannel_subrange_funcs) - return FALSE; - giochannel_subrange=(struct captive_giochannel_subrange *)giochannel; - - *size_return=giochannel_subrange->end-giochannel_subrange->start; - return TRUE; -} diff --git a/src/libcaptive/client/giochannel-subrange.h b/src/libcaptive/client/giochannel-subrange.h deleted file mode 100644 index 314fccf..0000000 --- a/src/libcaptive/client/giochannel-subrange.h +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ - * Include file for glib GIOChannel mapping subrange of parent GIOChannel for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_GNOMEVFS_GIOCHANNEL_SUBRANGE_H -#define _CAPTIVE_GNOMEVFS_GIOCHANNEL_SUBRANGE_H 1 - - -#include - - -G_BEGIN_DECLS - -struct captive_giochannel_subrange; - -struct captive_giochannel_subrange *captive_giochannel_subrange_new(GIOChannel *giochannel_orig,guint64 start,guint64 end); -gboolean captive_giochannel_subrange_get_size(GIOChannel *giochannel,guint64 *size_return); - -G_END_DECLS - - -#endif /* _CAPTIVE_GNOMEVFS_GIOCHANNEL_SUBRANGE_H */ diff --git a/src/libcaptive/client/init.c b/src/libcaptive/client/init.c deleted file mode 100644 index 43eb22b..0000000 --- a/src/libcaptive/client/init.c +++ /dev/null @@ -1,597 +0,0 @@ -/* $Id$ - * Init and cleanup code of libcaptive to be called by client application - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "init.h" /* self */ -#include "captive/ldr.h" -#include "captive/ldr_exports.h" -#include "captive/unicode.h" -#include "captive/rtl-file.h" -#include -#include -#include "reactos/internal/ldr.h" -#include "reactos/napi/types.h" -#include "reactos/internal/kd.h" /* for KDB_LOADDRIVER_HOOK */ -#include -#include /* for PROT_READ, MAP_SHARED */ -#include "reactos/ddk/kefuncs.h" /* for KeInitializeSpinLock() */ -#include "reactos/internal/ntoskrnl.h" /* for IoInit() */ -#include "reactos/internal/ps.h" /* for PsInitProcessManagment() and PsInitThreadManagment() */ -#include "reactos/ddk/iofuncs.h" /* for IoCreateFile() */ -#include "captive/storage.h" -#include "captive/signal.h" /* for captive_signal_init() */ -#include "reactos/ddk/psfuncs.h" /* for PsGetCurrentThread() */ -#include -#include -#include -#include -#include "giochannel-blind.h" -#include -#include "reactos/internal/se.h" /* for SeInit2() */ -#include "captive/leave.h" -#include "captive/options.h" -#include -#include "lib.h" -#include -#include -#include "captive/macros.h" -#include "../storage/relastblock.h" /* for captive_storage_relastblock() */ -#include "../cc/sharedcachemap.h" /* for captive_shared_cache_map_flush_all() */ -#include "standalone.h" - - -struct captive_options *captive_options; - -/* Are we initialized? */ -static gboolean active; - -/* Module of fs module itself loaded by captive_w32_init() */ -static PMODULE_OBJECT ModuleObject; - -/* Driver in fs module loaded by captive_w32_init() */ -DRIVER_OBJECT captive_DriverObject; -PDRIVER_REINITIALIZE captive_DriverObject_ReinitRoutine; -PVOID captive_DriverObject_ReinitRoutine_Context; - -/* Structure holding the pointer to the toplevel IRP */ -static TOP_LEVEL_IRP TopLevelIrp; /* TODO:thread */ - - -void *_local_unwind2_addr; - - -gboolean captive_debug_messages_disabled=FALSE; - -static gboolean captive_w32_init(void) -{ -NTSTATUS err; -gboolean errbool; - - g_return_val_if_fail(captive_options!=NULL,FALSE); - g_return_val_if_fail(captive_options->filesystem.type!=CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY,FALSE); - - /* captive_giochannel_size() only _after_ g_io_channel_set_encoding() ! */ - captive_image_size=captive_giochannel_size(captive_image_iochannel); - g_return_val_if_fail(captive_image_size>0,FALSE); - - /* Part of reactos/ntoskrnl/ke/main.c/KiSystemStartup() begins. */ - /* ExpInitializeExecutive(); */ - /* Part of reactos/ntoskrnl/ke/main.c/ExpInitializeExecutive() begins - * here as the rest of the function does a lot of hardware initializations. - */ - /* LdrInit1(); */ - /* Part of reactos/ntoskrnl/ldr/loader.c/LdrInit1() begins. */ - InitializeListHead(&ModuleTextListHead); - /* Part of reactos/ntoskrnl/ldr/loader.c/LdrInit1() ends. */ - KeLowerIrql(DISPATCH_LEVEL); - /*...*/ - /* FIXME: create default nls tables? Really still needed? */ - /* Obsolete: RtlpInitNlsTables(); */ - /*...*/ - /* KeInit2() */ - /*...*/ - KeInitializeDispatcher(); - /*...*/ - KeLowerIrql(PASSIVE_LEVEL); - errbool=SeInit1(); - g_assert(errbool==TRUE); - ObInit(); - errbool=SeInit2(); - g_assert(errbool==TRUE); - /* PiInitProcessManager(); */ - /* Part of reactos/ntoskrnl/ps/psmgr.c/PiInitProcessManager() begins. */ - PsInitProcessManagment(); - PsInitThreadManagment(); - /* Part of reactos/ntoskrnl/ps/psmgr.c/PiInitProcessManager() ends. */ - /*...*/ - IoInit(); - /*...*/ - /* LdrInitModuleManagement(); */ - /* Part of reactos/ntoskrnl/ldr/loader.c/LdrInitModuleManagement() begins - * here as the rest "Create module object for {NTOSKRNL,HAL}" - * is dependent on {NTOSKRNL,HAL} PE image headers not provided by libcaptive. - */ - /* Initialize the module list and spinlock */ - InitializeListHead(&ModuleListHead); - KeInitializeSpinLock(&ModuleListLock); - /* Part of reactos/ntoskrnl/ldr/loader.c/LdrInitModuleManagement ends. */ - /*...*/ - /* Ntinit(); */ - NtInitializeEventImplementation(); - /*...*/ - /* Part of reactos/ntoskrnl/ke/main.c/ExpInitializeExecutive() ends. */ - /* Part of reactos/ntoskrnl/ke/main.c/KiSystemStartup() ends. */ - - /* Simulate our PE headers and export the symbols of our complete libraries */ - captive_kernel_exports(); - - errbool=captive_cdrom_init(); - g_return_val_if_fail(errbool==TRUE,FALSE); - errbool=captive_disk_init(); - g_return_val_if_fail(errbool==TRUE,FALSE); - - while (captive_options->load_module) { -PMODULE_OBJECT ModuleObject_tmp; -NTSTATUS err; - - /* load the module */ - err=captive_LdrLoadModule( - captive_options->load_module->data, - &ModuleObject_tmp); /* ModuleObjectp */ - g_return_val_if_fail(NT_SUCCESS(err),FALSE); - - captive_options_module_free(captive_options->load_module->data); - /* also frees 'options->load_module->data' */ - captive_options->load_module=g_list_delete_link(captive_options->load_module,captive_options->load_module); - } - - /* Patch 'ntoskrnl.exe' loaded by 'captive_options->load_module' above. */ - { - CHAR *KeNumberProcessorsp=captive_Module_GetExportAddress("ntoskrnl.exe","KeNumberProcessors"); - - g_assert(*KeNumberProcessorsp==0); - *KeNumberProcessorsp=KeNumberProcessors; - g_assert(*KeNumberProcessorsp==1); - } - /* Apply AFTER any symbols sanity checks above! */ - if (captive_options->debug_messages) - captive_kernel_patches_debug(); - else - captive_kernel_patches_nondebug(); - - _local_unwind2_addr=captive_Module_GetExportAddress("ntoskrnl.exe","_local_unwind2"); - - /* Initialize 'FsRtlLegalAnsiCharacterArray'. - * It requires 'ntoskrnl.exe' loaded by 'captive_options->load_module' above; - * captive_kernel_patches_debug()/captive_kernel_patches_nondebug() should not be needed. - */ - captive_FsRtlLegalAnsiCharacterArray_init(); - - /* set TopLevelIrp() - FIXME: where is it set by native reactos? */ - PsGetCurrentThread()->TopLevelIrp=&TopLevelIrp; /* otherwise Io{Get,Set}TopLevelIrp() would SIGSEGV */ - - /* Begin possible handling of foreign W32 binary code here */ - /* If you want to disable SIGSEGV handler if not needed: - * if (ModuleObject->Flags & MODULE_FLAG_PE) - */ - captive_signal_init(); - - /* You must have already captive_signal_init() passed here as the module may - * call some functions from W32 ntoskrnl.exe. - */ - captive_DriverObject_ReinitRoutine=NULL; - err=captive_LdrpLoadAndCallImage( - &ModuleObject, /* ModuleObjectp */ - &captive_options->filesystem, /* options_module */ - &captive_DriverObject, /* DriverEntry_DriverObject */ - captive_utf8_to_UnicodeString_alloca("\\captive\\filesystem")); /* DriverEntry_RegistryPath */ - g_return_val_if_fail(NT_SUCCESS(err),FALSE); - if (captive_DriverObject_ReinitRoutine) { - captive_stdcall_call_12((CaptiveStdCallFunc12)captive_DriverObject_ReinitRoutine, - &captive_DriverObject, /* DriverObject */ - captive_DriverObject_ReinitRoutine_Context, /* Context */ - (gpointer)1); /* Count: # of calls of ReinitRoutine incl. the current one */ - } - - return TRUE; -} - - -static void captive_log_init_g_log_func_discard - (const gchar *log_domain,GLogLevelFlags log_level,const gchar *message,gpointer user_data) -{ - g_return_if_fail(message!=NULL); - - /* NOP */ -} - -static void captive_log_init_g_log_func - (const gchar *log_domain,GLogLevelFlags log_level,const gchar *message,gpointer user_data /* unused */) -{ -int priority; - - g_return_if_fail(message!=NULL); - - /* unused: LOG_EMERG */ - /* unused: LOG_ALERT */ - /**/ if (log_level&G_LOG_LEVEL_ERROR) - priority=LOG_CRIT; - else if (log_level&G_LOG_LEVEL_CRITICAL) - priority=LOG_ERR; - else if (log_level&G_LOG_LEVEL_WARNING) - priority=LOG_WARNING; - else if (log_level&G_LOG_LEVEL_MESSAGE) - priority=LOG_NOTICE; - else if (log_level&G_LOG_LEVEL_INFO) - priority=LOG_INFO; - else if (log_level&G_LOG_LEVEL_DEBUG) - priority=LOG_DEBUG; - else /* bogus? */ - priority=LOG_WARNING; - - syslog(priority,"%s%s%s", - (!(log_level&G_LOG_FLAG_RECURSION) ? "" : "RECURSION: "), - (!(log_level&G_LOG_FLAG_FATAL ) ? "" : "FATAL: "), - message); -} - -void captive_log_init(const struct captive_options *captive_options) -{ - g_return_if_fail(captive_options!=NULL); - - /* FIXME: Fix sharing of different 'debug_messages' for various sandboxes. */ - captive_debug_messages_disabled=!captive_options->debug_messages; - - /* FIXME: Fix sharing of different 'debug_messages' for various sandboxes. */ - if (!captive_options->debug_messages) { - /* FIXME: Save handler_id and destroy it in captive_vfs_close(). */ - g_log_set_handler( - G_LOG_DOMAIN, /* log_domain; "Captive" */ - 0 /* log_levels */ - | G_LOG_FLAG_RECURSION - | G_LOG_FLAG_FATAL - /* The same mask is in: - * libcaptive/sandbox/server-GLogFunc.c - * libcaptive/client/init.c - */ - | G_LOG_LEVEL_MESSAGE - | G_LOG_LEVEL_INFO - | G_LOG_LEVEL_DEBUG, - captive_log_init_g_log_func_discard, /* log_func */ - NULL); /* user_data */ - } - /* We are not the sandboxed slave; - * 'syslog_facility' would be '-1' in slave anyway as it is not transferred through CORBA. - */ - if (!captive_options->sandbox || (captive_options->sandbox_server_argv || captive_options->sandbox_server_ior)) { - if (captive_options->syslog_facility!=-1) { - openlog( - /* FIXME: Prefix 'ident' by device/mountpoint. */ - G_LOG_DOMAIN, /* ident; "Captive"; FIXME: lowercase it for syslog(3)? */ - LOG_CONS|LOG_PID, /* options */ - captive_options->syslog_facility); /* facility */ - /* FIXME: Save handler_id and destroy it in captive_vfs_close(). */ - g_log_set_handler( - G_LOG_DOMAIN, /* log_domain; "Captive" */ - 0 /* log_levels */ - | 0 /* !G_LOG_FLAG_RECURSION */ - | G_LOG_FLAG_FATAL - | (G_LOG_LEVEL_MASK & ~(captive_options->debug_messages ? 0 : 0 - /* The same mask is in: - * libcaptive/sandbox/server-GLogFunc.c - * libcaptive/client/init.c - */ - | G_LOG_LEVEL_MESSAGE - | G_LOG_LEVEL_INFO - | G_LOG_LEVEL_DEBUG)), - (GLogFunc)captive_log_init_g_log_func, /* log_func */ - NULL); /* user_data */ - } - } -} - -/** - * captive_init: - * - * Expects #captive_options: Parsed by captive_options_parse(). - * %NULL value is forbidden. Field #image_iochannel %NULL value is forbidden. - * - * Initializes %libcaptive and loads the specified filesystem. - * - * Returns: %TRUE if successfuly initialized. - */ -gboolean captive_init(void) -{ -gboolean errbool; - - /* We are in sandbox child and we have the right to fail. */ - g_log_set_always_fatal(~(0 - |G_LOG_LEVEL_MESSAGE - |G_LOG_LEVEL_INFO - |G_LOG_LEVEL_DEBUG - )); - - g_return_val_if_fail(captive_standalone_init_done==TRUE,FALSE); - g_return_val_if_fail(active==FALSE,FALSE); - - g_return_val_if_fail(captive_options!=NULL,FALSE); - g_return_val_if_fail(captive_options->image_iochannel!=NULL,FALSE); - - /* Do not: g_type_init(); - * as it is done by: captive_standalone_init() - */ - - captive_log_init(captive_options); - - if (captive_options->rwmode==CAPTIVE_OPTION_RWMODE_RW && !captive_options->sandbox) - g_error(_("Rejecting --rw --no-sandbox operation as too dangerous - use --blind or --sandbox")); - - captive_image_iochannel=captive_options->image_iochannel; - g_io_channel_ref(captive_image_iochannel); - - captive_image_iochannel=captive_storage_relastblock(captive_image_iochannel); - - if (captive_options->rwmode==CAPTIVE_OPTION_RWMODE_BLIND) { - GIOChannel *captive_image_iochannel_orig; - - captive_image_iochannel_orig=captive_image_iochannel; - captive_image_iochannel=(GIOChannel *)captive_giochannel_blind_new(captive_image_iochannel, - TRUE); /* writeable */ - g_io_channel_unref(captive_image_iochannel_orig); /* reffed by captive_giochannel_blind_new() */ - } - - /* Do not initialize 'captive_image_size' by captive_giochannel_size() here - * as we yet need to do g_io_channel_set_encoding(). - */ - - errbool=captive_w32_init(); - g_return_val_if_fail(errbool==TRUE,FALSE); - - active=TRUE; - return TRUE; -} - - -static void dismount_volume(void) -{ -IO_STATUS_BLOCK IoStatusBlock; -PEXTENDED_IO_STACK_LOCATION StackPtr; -PIRP Irp; -NTSTATUS Status; -DEVICE_OBJECT *DeviceObject=captive_DriverObject.DeviceObject; -OBJECT_ATTRIBUTES dir_ObjectAttributes; -HANDLE dir_Handle; -FILE_OBJECT *FileObject; -GnomeVFSResult errvfsresult; -NTSTATUS err; -IO_STATUS_BLOCK dir_IoStatusBlock; -/* - * TraceFS reported only IRP_MJ_FLUSH_BUFFERS - * and IRP_MJ_SHUTDOWN. - * Apparently it is not enough, FSCTL_DISMOUNT_VOLUME is needed, - * otherwise NT-5.1 autochkdsks the disk and W2000 may give BSOD during boot. - */ -enum step { - /* First item value assumed to be 0. */ - STEP_IRP_MJ_FLUSH_BUFFERS_PRE, -#if 0 - /* DISABLED: STATUS_ACCESS_DENIED; FIXME: Why? - * The official way of device modification is: LOCK,DISMOUNT - * but LOCK fails for Captive if any file was written (and closed). - */ - STEP_FSCTL_LOCK_VOLUME, -#endif - STEP_FSCTL_DISMOUNT_VOLUME, - STEP_IRP_MJ_FLUSH_BUFFERS_POST, - STEP_MAX=3, - } stepi; -WCHAR wzero; - - errvfsresult=captive_ObjectAttributes_init("/!Captive!del",&dir_ObjectAttributes); - g_return_if_fail(errvfsresult==GNOME_VFS_OK); - - /* wanted: * IoCreateFile()->ObCreateObject(,,,IoFileObjectType)-> - * ->(IoFileObjectType->Create==IopCreateFile)()->IoMountVolume() - */ - CAPTIVE_MEMZERO(&dir_IoStatusBlock); /* FIXME: Try to pre-clear it - uninitialized otherwise? */ - dir_IoStatusBlock.Information=FILE_OPENED; /* FIXME: Try to pre-set it - uninitialized otherwise? */ - err=IoCreateFile( - &dir_Handle, /* FileHandle */ - GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE|0x80, /* DesiredAccess; 0xC0100080=GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE|0x80 */ - &dir_ObjectAttributes, /* ObjectAttributes */ - &dir_IoStatusBlock, /* IoStatusBlock */ - NULL, /* AllocationSize; ignored for open */ - FILE_ATTRIBUTE_NORMAL, /* FileAttributes; ignored for open */ - (FILE_SHARE_READ | FILE_SHARE_WRITE), /* ShareAccess; 0 means exclusive */ - FILE_OPEN, /* CreateDisposition */ - /* FILE_SYNCHRONOUS_IO_{,NON}ALERT: We need to allow W32 filesystem - * any waits to not to let it return STATUS_CANT_WAIT us. - * Alertability should have only effect on asynchronous events - * from KeWaitForSingleObject() by setting/clearing its parameter 'Alertable'. - */ - FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE, /* CreateOptions; FILE_DIRECTORY_FILE is forbidden */ - NULL, /* EaBuffer */ - 0, /* EaLength */ - CreateFileTypeNone, /* CreateFileType */ - NULL, /* ExtraCreateParameters */ - 0); /* Options */ - g_free(dir_ObjectAttributes.ObjectName); /* left from captive_gnomevfs_uri_parent_init() */ - g_return_if_fail(NT_SUCCESS(err)); - g_return_if_fail(NT_SUCCESS(err)==NT_SUCCESS(dir_IoStatusBlock.Status)); - g_return_if_fail(dir_IoStatusBlock.Information==FILE_OPENED); - - Status=ObReferenceObjectByHandle(dir_Handle,FILE_LIST_DIRECTORY,IoFileObjectType,UserMode,(PVOID *)&FileObject,NULL); - g_assert(NT_SUCCESS(Status)); - - g_assert(FileObject->FileName.Length==0); - /* 'FileObject->FileName.MaximumLength' is not reset by IoCreateFile(). */ - g_assert(FileObject->FileName.Buffer==NULL); - FileObject->FileName.MaximumLength=2; - FileObject->FileName.Buffer=&wzero; - - for (stepi=0;stepiStackSize,TRUE); - g_return_if_fail(Irp!=NULL); - - Irp->UserIosb=&IoStatusBlock; - Irp->UserEvent=&FileObject->Event; - Irp->Tail.Overlay.Thread=PsGetCurrentThread(); - - StackPtr=(EXTENDED_IO_STACK_LOCATION *)IoGetNextIrpStackLocation(Irp); - switch (stepi) { - case STEP_IRP_MJ_FLUSH_BUFFERS_PRE: - StackPtr->MajorFunction=IRP_MJ_FLUSH_BUFFERS; - break; -#if 0 /* Disabled, see 'STEP_FSCTL_LOCK_VOLUME'. */ - case STEP_FSCTL_LOCK_VOLUME: - StackPtr->MajorFunction=IRP_MJ_FILE_SYSTEM_CONTROL; - StackPtr->MinorFunction=IRP_MN_USER_FS_REQUEST; - StackPtr->Parameters.FileSystemControl.OutputBufferLength=0; - StackPtr->Parameters.FileSystemControl.InputBufferLength=0; - StackPtr->Parameters.FileSystemControl.FsControlCode=FSCTL_LOCK_VOLUME; - StackPtr->Parameters.FileSystemControl.Type3InputBuffer=NULL; - break; -#endif - case STEP_FSCTL_DISMOUNT_VOLUME: - StackPtr->MajorFunction=IRP_MJ_FILE_SYSTEM_CONTROL; - StackPtr->MinorFunction=IRP_MN_USER_FS_REQUEST; - StackPtr->Parameters.FileSystemControl.OutputBufferLength=0; - StackPtr->Parameters.FileSystemControl.InputBufferLength=0; - StackPtr->Parameters.FileSystemControl.FsControlCode=FSCTL_DISMOUNT_VOLUME; - StackPtr->Parameters.FileSystemControl.Type3InputBuffer=NULL; - break; - case STEP_IRP_MJ_FLUSH_BUFFERS_POST: - StackPtr->MajorFunction=IRP_MJ_FLUSH_BUFFERS; - break; - default: g_assert_not_reached(); - } - StackPtr->Flags=0; - StackPtr->Control=0; - StackPtr->DeviceObject=DeviceObject; /* FIXME: FileObject->Vpb->DeviceObject ? */ - StackPtr->FileObject=FileObject; - StackPtr->CompletionRoutine=NULL; - - /* IoCallDriver() will do one ObDereferenceObject(FileObject) - * in its IoSecondStageCompletion(). - * Do not leave to dereference it itself as we need its 'FileObject->Event'. - */ - ObReferenceObject(FileObject); - - Status=IoCallDriver(DeviceObject,Irp); - if (Status==STATUS_PENDING) { - KeWaitForSingleObject(&FileObject->Event,Executive,KernelMode,FALSE,NULL); - Status=IoStatusBlock.Status; - } - g_assert(NT_SUCCESS(Status) - || (Status==STATUS_MEDIA_WRITE_PROTECTED && captive_options->rwmode==CAPTIVE_OPTION_RWMODE_RO)); - } - - ObDereferenceObject(FileObject); -} - - -BOOLEAN captive_cc_FileObject_delete(FILE_OBJECT *FileObject); -void captive_cc_flush(void); - -/** - * captive_shutdown: - * - * Closes down %libcaptive. It should flush all pending buffers and successfuly - * close the filesystem. Variable #captive_options->image_iochannel will not be set to %NULL, - * you should close such channel yourself. - * - * Returns: %TRUE if successfuly shutdown. - */ -gboolean captive_shutdown(void) -{ -GIOStatus erriostatus; - - g_return_val_if_fail(active==TRUE,FALSE); - g_return_val_if_fail(captive_image_iochannel!=NULL,FALSE); - g_return_val_if_fail(captive_options->image_iochannel!=NULL,FALSE); - - /* Invoke all pending idle functions just to not to forget for anything... */ - while (g_main_context_iteration( - NULL, /* context; NULL means default one */ - FALSE)) /* may_block */ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: g_main_context_iteration() proceeded",G_STRLOC); - - /* Do not: captive_cc_flush(); * based on captive_leave(), not g_main idle * - * replaced by IRP_MJ_FLUSH_BUFFERS. - */ - - /* Probably not needed: captive_shared_cache_map_flush_all(); - */ - - dismount_volume(); - - /* Probably not needed: captive_shared_cache_map_flush_all(); - */ - - /* Invoke all pending idle functions just to not to forget for anything... */ - while (g_main_context_iteration( - NULL, /* context; NULL means default one */ - FALSE)) /* may_block */ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: g_main_context_iteration() proceeded",G_STRLOC); - -#if 0 - captive_PoQueueShutdownWorkItem_hooklist_invoke(); -#endif - - /* Do not: captive_cc_flush(); - * as the dirty blocks should have been already commited by dismount_volume(), - * any further commits would get us just STATUS_VOLUME_DISMOUNTED. - */ - - /* Do not: captive_cc_unmounting=TRUE; - * Without dismount_volume() it was: - * During IoShutdownRegisteredFileSystems() - IRP_MJ_SHUTDOWN to be specific - * some buffers will be written but after the IofCallDriver() it will be - * no longer possible to flush such buffers to their DeviceVolumeFile. - * Therefore we must flush such buffers on the fly although such behaviour - * would crash us in regular case as filesystems access BCBs even after their - * CcUnpinData(). - * Currently the dirty blocks should have been already commited by dismount_volume(), - */ - - /* FIXME: ntoskrnl/ex/power.c/NtShutdownSystem() does - * IoShutdownRegistered{Devices,FileSystems} order; is it correct? - */ - IoShutdownRegisteredFileSystems(); - - /* Do not: captive_cc_FileObject_delete(NULL); - * as the dirty blocks should have been already commited by dismount_volume(), - * any further commits would get us just STATUS_VOLUME_DISMOUNTED. - */ - - IoShutdownRegisteredDevices(); - - /* Just a sanity if 'captive_image_iochannel' is already reffed a bit more... */ - erriostatus=g_io_channel_flush( - captive_image_iochannel, /* channel */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - - g_io_channel_unref(captive_image_iochannel); - captive_image_iochannel=NULL; - - active=FALSE; - return TRUE; -} diff --git a/src/libcaptive/client/init.h b/src/libcaptive/client/init.h deleted file mode 100644 index 197ccde..0000000 --- a/src/libcaptive/client/init.h +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ - * Include file for init and cleanup code of libcaptive to be called by client application - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_INIT_H -#define _CAPTIVE_CLIENT_INIT_H 1 - - -#include -#include "captive/options.h" - - -G_BEGIN_DECLS - -gboolean captive_init(void); -gboolean captive_shutdown(void); -void captive_log_init(const struct captive_options *captive_options); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_INIT_H */ diff --git a/src/libcaptive/client/leave.c b/src/libcaptive/client/leave.c deleted file mode 100644 index 1b492f9..0000000 --- a/src/libcaptive/client/leave.c +++ /dev/null @@ -1,73 +0,0 @@ -/* $Id$ - * Code of leaving libcaptive to be called to cleanup W32 fs state - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/leave.h" /* self */ -#include -#include -#include "captive/macros.h" -#include - - - -static GHookList captive_leave_hooklist; - - -static void captive_leave_hooklist_init(void) -{ - if (captive_leave_hooklist.is_setup) - return; - - g_hook_list_init(&captive_leave_hooklist,sizeof(GHook)); -} - - -void captive_leave(void) -{ -GHookList captive_leave_hooklist_local; - - for (;;) { - captive_leave_hooklist_init(); - if (!captive_leave_hooklist.hooks) - break; - - captive_leave_hooklist_local=captive_leave_hooklist; - captive_leave_hooklist.is_setup=FALSE; - - g_hook_list_invoke(&captive_leave_hooklist_local, - FALSE); /* may_recurse */ - g_hook_list_clear(&captive_leave_hooklist_local); - } -} - - -void captive_leave_register(captive_leave_func func,gpointer data) -{ -GHook *ghook; - - g_return_if_fail(func!=NULL); - - captive_leave_hooklist_init(); - - ghook=g_hook_alloc(&captive_leave_hooklist); - ghook->func=func; - ghook->data=data; - g_hook_append(&captive_leave_hooklist,ghook); -} diff --git a/src/libcaptive/client/lib.c b/src/libcaptive/client/lib.c deleted file mode 100644 index 01bc7bf..0000000 --- a/src/libcaptive/client/lib.c +++ /dev/null @@ -1,157 +0,0 @@ -/* $Id$ - * captive vfs utility functions for interface to reactos - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "lib.h" /* self */ -#include -#include -#include "captive/macros.h" -#include "reactos/ntos/rtl.h" /* for InitializeObjectAttributes() */ -#include "captive/unicode.h" -#include /* for gnome_vfs_unescape_string() */ -#include "captive/options.h" -#include - - -/* Returns: g_malloc() allocated absolute pathname string */ -gchar *captive_path_normalize(const gchar *raw_pathname) -{ -gchar *r,*r_end,*s,*d; - - g_return_val_if_fail(raw_pathname!=NULL,NULL); - g_return_val_if_fail(g_path_is_absolute(raw_pathname),NULL); - - r=g_strdup(raw_pathname); - - /* coalesce '/'es */ - for (d=s=r;*s;s++) { - if (*s==G_DIR_SEPARATOR && d>r && d[-1]==G_DIR_SEPARATOR) - continue; - *d++=*s; - } - g_assert(d>r); - if (d>(r+1) && d[-1]==G_DIR_SEPARATOR) - d--; - *d++=G_DIR_SEPARATOR; - r_end=d; - - /* 'r' is NOT NULL-terminated here! */ - - for (d=s=r+1;sr+1) { - do { - d--; - } while (d[-1]!=G_DIR_SEPARATOR); - } - continue; - } - *d++=*s++; - } - g_assert(d[-1]==G_DIR_SEPARATOR); /* trailing '/' */ - if (d>r+1) /* leave at least "/" */ - d--; - *d='\0'; - - g_assert(g_path_is_absolute(r)); - - return r; -} - -/* function will leave g_malloc()ed 'ObjectAttributes->ObjectName'! - */ -GnomeVFSResult captive_ObjectAttributes_init(const gchar *pathname,OBJECT_ATTRIBUTES *ObjectAttributes) -{ -gchar *w32_path,*s,*d; -const gchar *media_root; -gchar *pathname_normalized; - - g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(ObjectAttributes!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - /* Do not open "\Cdfs"(anything) as it is just the filesystem implementation. - * ntoskrnl/io/fs.c/IoMountVolume() will map - * FILE_DEVICE_CD_ROM -> FILE_DEVICE_CD_ROM_FILE_SYSTEM - * for us automatically when opening the device itself. - * If you put some trailing content (such as "\\.") there - * IoCreateFile()->ObCreateObject()->ObFindObject() - * will not leave 'ObCreateObject::RemainingPath' as NULL - * and later IopCreateFile() would not consider it FO_DIRECT_DEVICE_OPEN (e.g. w/o any direct mount!). - * On the other side it will somehow get managed automatically and it works even - * without the trailing "\\." for root directory open - don't ask me why. :-) - * Tested: \\Device\\CaptiveHarddisk0\\. FAIL - * \\Device\\CaptiveHarddisk0\\ OK - */ - switch (captive_options->media) { - case CAPTIVE_OPTION_MEDIA_CDROM: media_root="\\Device\\CdRom0"; break; /* libcaptive/storage/cdrom.c */ - case CAPTIVE_OPTION_MEDIA_DISK: media_root="\\Device\\CaptiveHarddisk0"; break; /* libcaptive/storage/disk.c */ - default: - g_assert_not_reached(); - media_root=""; - } - - pathname_normalized=captive_path_normalize(pathname); - w32_path=(gchar *)/* de-const it as we can modify it but we must not free() it */ - captive_printf_alloca("%s\\%s",media_root,pathname_normalized); - g_free(pathname_normalized); - /* translate '/' -> '\' */ - for (s=w32_path;(s=strchr(s,'/'));s++) - *s='\\'; - /* collapse multiple sequences of '\' as it is a no-no for W32 */ - for (s=d=w32_path;*s;s++) - if (d==w32_path || !(*s=='\\' && d[-1]=='\\')) - *d++=*s; - *d=0; - InitializeObjectAttributes( - ObjectAttributes, /* InitializedAttributes */ - captive_utf8_to_UnicodeString_malloc(w32_path), /* ObjectName */ - 0, /* Attributes; I hope no OBJ_KERNEL_HANDLE as we are 'system process' */ - NULL, /* RootDirectory */ - NULL); /* SecurityDescriptor; ignored */ - - return GNOME_VFS_OK; -} - - -void captive_giochannel_setup(GIOChannel *giochannel) -{ -GIOStatus erriostatus; - - g_return_if_fail(giochannel!=NULL); - - if (g_io_channel_get_encoding(giochannel)) { - if (!g_io_channel_get_buffered(giochannel)) /* Prevent: Need to have NULL encoding to set the buffering state ... */ - g_io_channel_set_buffered(giochannel,TRUE); /* Prevent: Need to set the channel buffered before setting the encoding. */ - erriostatus=g_io_channel_set_encoding(giochannel, - NULL, /* encoding; force binary data */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - } - erriostatus=g_io_channel_flush(giochannel, - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - g_io_channel_set_buffered(giochannel,FALSE); -} diff --git a/src/libcaptive/client/lib.h b/src/libcaptive/client/lib.h deleted file mode 100644 index fa1fe6d..0000000 --- a/src/libcaptive/client/lib.h +++ /dev/null @@ -1,38 +0,0 @@ -/* $Id$ - * Include file for captive vfs utility functions for interface to reactos - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_LIB_H -#define _CAPTIVE_CLIENT_LIB_H 1 - - -#include -#include "reactos/ntos/obtypes.h" /* for OBJECT_ATTRIBUTES */ -#include -#include - - -G_BEGIN_DECLS - -GnomeVFSResult captive_ObjectAttributes_init(const gchar *pathname,OBJECT_ATTRIBUTES *ObjectAttributes); -void captive_giochannel_setup(GIOChannel *giochannel); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_LIB_H */ diff --git a/src/libcaptive/client/libxml.c b/src/libcaptive/client/libxml.c deleted file mode 100644 index 5203650..0000000 --- a/src/libcaptive/client/libxml.c +++ /dev/null @@ -1,95 +0,0 @@ -/* $Id$ - * Supplementary captive utilities for libxml2 - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/libxml.h" /* self */ -#include -#include -#include -#include "captive/macros.h" - - -struct captive_libxml_string_drop_stack { - GHookList g_hook_list; - }; - - -gint64 captive_libxml_sscanf_gint64(const gchar *gint64_string) -{ -int errint; -gint64 r; -int gint64_string_len; - - g_return_val_if_fail(gint64_string!=NULL,0); - - errint=sscanf(gint64_string,"%" G_GINT64_FORMAT "%n",&r,&gint64_string_len); - g_assert(errint==1 || errint==2 /* %n */); - g_assert(gint64_string_len==(int)strlen(gint64_string)); - - return r; -} - - -static void captive_libxml_string_drop_hook_func(const xmlChar *xml_string /* data */) -{ - g_return_if_fail(xml_string!=NULL); - - xmlFree((xmlChar *)xml_string); -} - -G_CONST_RETURN gchar *captive_libxml_string_drop(struct captive_libxml_string_drop_stack **drop_stackp,const xmlChar *xml_string) -{ -GHook *g_hook; - - g_return_val_if_fail(drop_stackp!=NULL,NULL); - - if (!xml_string) - return NULL; - - if (!*drop_stackp) { - captive_new(*drop_stackp); - g_hook_list_init(&(*drop_stackp)->g_hook_list,sizeof(GHook)); - } - - g_hook=g_hook_alloc(&(*drop_stackp)->g_hook_list); - g_hook->func=(GHookFunc)captive_libxml_string_drop_hook_func; - g_hook->data=(xmlChar *)xml_string; - g_hook_append(&(*drop_stackp)->g_hook_list,g_hook); - - return (const gchar *)xml_string; -} - - -void captive_libxml_string_drop_flush(struct captive_libxml_string_drop_stack **drop_stackp) -{ -struct captive_libxml_string_drop_stack *drop_stack; - - g_return_if_fail(drop_stackp!=NULL); - - if (!(drop_stack=*drop_stackp)) - return; - *drop_stackp=NULL; - - g_hook_list_invoke(&drop_stack->g_hook_list, - FALSE); /* may_recurse */ - g_hook_list_clear(&drop_stack->g_hook_list); - - g_free(drop_stack); -} diff --git a/src/libcaptive/client/marshallers.list b/src/libcaptive/client/marshallers.list deleted file mode 100644 index 0d00eeb..0000000 --- a/src/libcaptive/client/marshallers.list +++ /dev/null @@ -1,19 +0,0 @@ -# $Id$ -# Mashallers for GObject based CaptiveParentConnector of libcaptive -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -VOID:VOID diff --git a/src/libcaptive/client/options-module.c b/src/libcaptive/client/options-module.c deleted file mode 100644 index a81c2e5..0000000 --- a/src/libcaptive/client/options-module.c +++ /dev/null @@ -1,141 +0,0 @@ -/* $Id$ - * User options handling code of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/options.h" /* self */ -#include -#include "captive/macros.h" -#include -#include -#include "captive/rtl-file.h" -#include -#include -#include -#include -#include -#include -#include -#include - - -gboolean captive_options_module_load(struct captive_options_module *options_module,const gchar *pathname_utf8) -{ - g_return_val_if_fail(options_module!=NULL,FALSE); - g_return_val_if_fail(pathname_utf8!=NULL,FALSE); - - /* Open the Module */ - options_module->type=CAPTIVE_OPTIONS_MODULE_TYPE_PE32; - options_module->pathname_utf8=g_strdup(pathname_utf8); - options_module->u.pe32.mapped=TRUE; - options_module->u.pe32.base=captive_rtl_file_mmap( - &options_module->u.pe32.length, /* lenp */ - pathname_utf8, /* path */ - O_RDONLY, /* open_flags */ - PROT_READ, /* mmap_prot */ - MAP_SHARED); /* mmap_flags */ - /* FIXME: convert errno instead of STATUS_INSUFFICIENT_RESOURCES */ - g_return_val_if_fail(options_module->u.pe32.base!=NULL,FALSE); - - if (options_module->u.pe32.length>=2 - && (('M'<<8U)|('Z'<<0U))==GUINT16_FROM_BE(*(const guint16 *)options_module->u.pe32.base)) { -unsigned char md5_bin[1+128/8]; /* 128 bits==16 bytes; '1+' for leading stub to prevent shorter output of BN_bn2hex() */ -BIGNUM *bignum; -char *hex,*s; - - /* already done above */ - /* Calculate MD5 sum and convert it to hex string: */ - MD5(options_module->u.pe32.base,options_module->u.pe32.length,md5_bin+1); - md5_bin[0]=0xFF; /* stub to prevent shorter output of BN_bn2hex() */ - bignum=BN_bin2bn(md5_bin,1+128/8,NULL); - hex=BN_bn2hex(bignum); - g_assert(strlen(hex)==2*(1+128/8)); - options_module->u.pe32.md5=g_strdup(hex+2); - OPENSSL_free(hex); - BN_free(bignum); - /* BN_bn2hex() returns uppercased string: */ - g_assert(strlen(options_module->u.pe32.md5)==32); - for (s=options_module->u.pe32.md5;*s;s++) { - g_assert(isxdigit(*s)); - *s=tolower(*s); - g_assert(isxdigit(*s)); - } - } - else { - captive_rtl_file_munmap(options_module->u.pe32.base); - options_module->type=CAPTIVE_OPTIONS_MODULE_TYPE_GMODULE; - options_module->u.gmodule.pathname=g_strdup(pathname_utf8); - } - - return TRUE; -} - - -void captive_options_module_copy(struct captive_options_module *dest,const struct captive_options_module *src) -{ - g_return_if_fail(dest!=NULL); - g_return_if_fail(src!=NULL); - - dest->pathname_utf8=g_strdup(src->pathname_utf8); - - dest->type=src->type; - switch (src->type) { - case CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY: g_assert_not_reached(); - - case CAPTIVE_OPTIONS_MODULE_TYPE_PE32: - dest->u.pe32.base=g_memdup(src->u.pe32.base,src->u.pe32.length); - dest->u.pe32.length=src->u.pe32.length; - dest->u.pe32.mapped=FALSE; - dest->u.pe32.md5=g_strdup(src->u.pe32.md5); - break; - - case CAPTIVE_OPTIONS_MODULE_TYPE_GMODULE: - dest->u.gmodule.pathname=g_strdup(src->u.gmodule.pathname); - break; - - default: g_assert_not_reached(); - } -} - - -void captive_options_module_free(struct captive_options_module *options_module) -{ - g_return_if_fail(options_module!=NULL); - - g_free(options_module->pathname_utf8); - - switch (options_module->type) { - case CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY: - break; - - case CAPTIVE_OPTIONS_MODULE_TYPE_PE32: - if (options_module->u.pe32.mapped) - captive_rtl_file_munmap(options_module->u.pe32.base); - else - g_free(options_module->u.pe32.base); - g_free(options_module->u.pe32.md5); - break; - - case CAPTIVE_OPTIONS_MODULE_TYPE_GMODULE: - g_free(options_module->u.gmodule.pathname); - break; - - default: g_assert_not_reached(); - } -} diff --git a/src/libcaptive/client/options.c b/src/libcaptive/client/options.c deleted file mode 100644 index ff2d6ed..0000000 --- a/src/libcaptive/client/options.c +++ /dev/null @@ -1,475 +0,0 @@ -/* $Id$ - * User options handling code of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/options.h" /* self */ -#include -#include "captive/macros.h" -#include -#include -#include - - -/* Config: */ -#define DEFAULT_SYSLOG_FACILITY LOG_DAEMON - - -void captive_options_init(struct captive_options *options) -{ - g_return_if_fail(options!=NULL); - - CAPTIVE_MEMZERO(options); - options->filesystem.type=CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY; - options->rwmode=CAPTIVE_OPTION_RWMODE_BLIND; - options->media=CAPTIVE_OPTION_MEDIA_DISK; - options->debug_messages=FALSE; - options->load_module=NULL; - options->sandbox=FALSE; - options->syslog_facility=-1; -} - - -void captive_options_copy(struct captive_options *dest,const struct captive_options *src) -{ -GList *load_module_node; - - g_return_if_fail(dest!=NULL); - g_return_if_fail(src!=NULL); - g_return_if_fail(dest!=src); - - memcpy(dest,src,sizeof(*dest)); - - captive_options_module_copy(&dest->filesystem,&src->filesystem); - if (dest->image_iochannel) - g_io_channel_ref(dest->image_iochannel); - - dest->load_module=NULL; - for (load_module_node=src->load_module;load_module_node;load_module_node=load_module_node->next) { -struct captive_options_module *options_module_src=load_module_node->data; -struct captive_options_module *options_module_dest; - - captive_new(options_module_dest); - captive_options_module_copy(options_module_dest,options_module_src); - dest->load_module=g_list_append(dest->load_module,options_module_dest); - } - - if (src->sandbox_server_argv) { -char **sp; - - for (sp=src->sandbox_server_argv;*sp;sp++) { - if (sp>src->sandbox_server_argv) - g_assert(*sp>=sp[-1]); - } - dest->sandbox_server_argv=g_memdup(src->sandbox_server_argv, - (sp==src->sandbox_server_argv ? (char *)(sp+1) : sp[-1]+strlen(sp[-1])+1) - (char *)src->sandbox_server_argv); - /* Really update the pointers inside the copied array block. :-) */ - for (sp=src->sandbox_server_argv;*sp;sp++) { - dest->sandbox_server_argv[sp-src->sandbox_server_argv]=(gpointer)((char *)dest->sandbox_server_argv - +(src->sandbox_server_argv[sp-src->sandbox_server_argv]-(char *)src->sandbox_server_argv)); - } - } - - if (src->sandbox_server_ior) - dest->sandbox_server_ior=g_strdup(src->sandbox_server_ior); - - if (src->bug_pathname) - dest->bug_pathname=g_strdup(src->bug_pathname); -} - - -void captive_options_free(struct captive_options *options) -{ - g_return_if_fail(options!=NULL); - - captive_options_module_free(&options->filesystem); - if (options->image_iochannel) - g_io_channel_unref(options->image_iochannel); - - while (options->load_module) { - captive_options_module_free(options->load_module->data); - options->load_module=g_list_delete_link(options->load_module,options->load_module); /* also frees 'options->load_module->data' */ - } - - g_free(options->sandbox_server_argv); - g_free(options->sandbox_server_ior); - g_free(options->bug_pathname); -} - - -static gchar *captive_popt_optarg; - - -static void arg_filesystem(void) -{ -gboolean errbool; - - captive_options_module_free(&captive_options->filesystem); - errbool=captive_options_module_load(&captive_options->filesystem,captive_popt_optarg); - g_assert(errbool==TRUE); -} - -static void arg_load_module(void) -{ -struct captive_options_module *options_module; -gboolean errbool; - - captive_new(options_module); - errbool=captive_options_module_load(options_module,captive_popt_optarg); - g_assert(errbool==TRUE); - - captive_options->load_module=g_list_append(captive_options->load_module,options_module); -} - -static void arg_ro(void) -{ - captive_options->rwmode=CAPTIVE_OPTION_RWMODE_RO; -} -static void arg_blind(void) -{ - captive_options->rwmode=CAPTIVE_OPTION_RWMODE_BLIND; -} -static void arg_rw(void) -{ - captive_options->rwmode=CAPTIVE_OPTION_RWMODE_RW; -} - -static void arg_cdrom(void) -{ - captive_options->media=CAPTIVE_OPTION_MEDIA_CDROM; -} -static void arg_disk(void) -{ - captive_options->media=CAPTIVE_OPTION_MEDIA_DISK; -} - -static void arg_debug_messages(void) -{ - captive_options->debug_messages=TRUE; -} - -static void sandbox_args_clear(void) -{ - free(captive_options->sandbox_server_argv); - captive_options->sandbox_server_argv=NULL; - - g_free(captive_options->sandbox_server_ior); - captive_options->sandbox_server_ior=NULL; - - captive_options->sandbox=FALSE; -} - -static void arg_sandbox_server(void) -{ -int errint; -int trash_argc; - - sandbox_args_clear(); - - /* 'argcPtr' is forbidden to be NULL at least by popt of rpm-3.0.6. */ - errint=poptParseArgvString( - captive_popt_optarg, /* s */ - &trash_argc, /* argcPtr */ - (const char ***)&captive_options->sandbox_server_argv); /* argvPtr */ - g_assert(errint==0); - - captive_options->sandbox=TRUE; -} - -static void arg_sandbox_server_ior(void) -{ - sandbox_args_clear(); - - captive_options->sandbox_server_ior=g_strdup(captive_popt_optarg); - captive_options->sandbox=TRUE; -} - -static void arg_no_sandbox(void) -{ - sandbox_args_clear(); -} - -static void arg_bug_pathname(void) -{ - g_free(captive_options->bug_pathname); - captive_options->bug_pathname=g_strdup(captive_popt_optarg); -} - -/* Do not: #define SYSLOG_NAMES 1 - * to enable /facilitynames[] as such array is global (non-static) - * and it is likely it would conflict with facilitynames[] defined elsewhere - * (such as even conflicts by libcaptive.so). - */ -static const struct syslog_facility { - const gchar *name; - int value; - } syslog_facility[]={ -#ifdef LOG_AUTHPRIV - { "authpriv", LOG_AUTHPRIV }, -#endif -#ifdef LOG_CRON - { "cron" , LOG_CRON }, -#endif -#ifdef LOG_DAEMON - { "daemon" , LOG_DAEMON }, -#endif -#ifdef LOG_FTP - { "ftp" , LOG_FTP }, -#endif -#ifdef LOG_KERN - { "kern" , LOG_KERN }, -#endif -#ifdef LOG_LPR - { "lpr" , LOG_LPR }, -#endif -#ifdef LOG_MAIL - { "mail" , LOG_MAIL }, -#endif -#ifdef LOG_NEWS - { "news" , LOG_NEWS }, -#endif -#ifdef LOG_SYSLOG - { "syslog" , LOG_SYSLOG }, -#endif -#ifdef LOG_USER - { "user" , LOG_USER }, -#endif -#ifdef LOG_UUCP - { "uucp" , LOG_UUCP }, -#endif -#ifdef LOG_LOCAL0 - { "local0" , LOG_LOCAL0 }, -#endif -#ifdef LOG_LOCAL1 - { "local1" , LOG_LOCAL1 }, -#endif -#ifdef LOG_LOCAL2 - { "local2" , LOG_LOCAL2 }, -#endif -#ifdef LOG_LOCAL3 - { "local3" , LOG_LOCAL3 }, -#endif -#ifdef LOG_LOCAL4 - { "local4" , LOG_LOCAL4 }, -#endif -#ifdef LOG_LOCAL5 - { "local5" , LOG_LOCAL5 }, -#endif -#ifdef LOG_LOCAL6 - { "local6" , LOG_LOCAL6 }, -#endif -#ifdef LOG_LOCAL7 - { "local7" , LOG_LOCAL7 }, -#endif - }; - -static void arg_syslog(void) -{ - captive_options->syslog_facility=DEFAULT_SYSLOG_FACILITY; -} - -static int arg_syslog_facility_value; - -static void arg_syslog_facility(void) -{ -const struct syslog_facility *facility; -GString *gstring; -gchar *gs; - - for (facility=syslog_facility;facilityname)) { - arg_syslog_facility_value=facility->value; - return; - } - - gstring=g_string_new(captive_printf_alloca(_("Unknown '--syslog' facility '%s'; known:"),captive_popt_optarg)); - for (facility=syslog_facility;facilityname); - } - gs=g_string_free(gstring, - FALSE); /* free_segment */ - g_warning(gs); - g_free(gs); -} - - -static void captive_popt_callback - (poptContext con,enum poptCallbackReason reason,const struct poptOption *opt,const char *arg,const void *data); - -const struct poptOption captive_popt[]={ - { argInfo:POPT_ARG_INTL_DOMAIN,arg:(void *)PACKAGE }, - { argInfo:POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST,arg:(void *)captive_popt_callback }, -#define POPT_OFFSET 2 -#define CAPTIVE_POPT(longname,argInfoP,argP,descripP,argDescripP) \ - { \ - longName: (longname), \ - shortName: 0, \ - argInfo: (argInfoP), \ - arg: (void *)argP, \ - val: 0, \ - descrip: (descripP), \ - argDescrip: (argDescripP), \ - } -#define CAPTIVE_POPT_STRING(longname,descripP,argDescripP) \ - CAPTIVE_POPT(longname,POPT_ARG_STRING,&captive_popt_optarg,descripP,argDescripP) -#define CAPTIVE_POPT_NONE(longname,descripP) \ - CAPTIVE_POPT(longname,POPT_ARG_NONE ,NULL ,descripP,NULL ) - - CAPTIVE_POPT_STRING("filesystem" ,N_("Pathname to .sys or .so filesystem module file"),N_("pathname")), - CAPTIVE_POPT_STRING("load-module" ,N_("Pathname to any W32 module to load w/o initialization"),N_("pathname")), - CAPTIVE_POPT_NONE( "ro" ,N_("Read/write mode: Any write access will be forbidden")), - CAPTIVE_POPT_NONE( "blind" ,N_("Read/write mode: All writes are just simulated in memory (default)")), - CAPTIVE_POPT_NONE( "rw" ,N_("Read/write mode: Write directly to the image file/device")), - CAPTIVE_POPT_NONE( "cdrom" ,N_("Media type: CD-ROM")), - CAPTIVE_POPT_NONE( "disk" ,N_("Media type: Disk (default)")), - CAPTIVE_POPT_NONE( "debug-messages" ,N_("Turn on debugging messages")), - CAPTIVE_POPT_STRING("sandbox-server" ,N_("Pathname to 'captive-sandbox-server', turns on sandboxing"),N_("pathname")), - CAPTIVE_POPT_STRING("sandbox-server-ior",N_("CORBA IOR of 'captive-sandbox-server', turns on sandboxing"),N_("IOR")), - CAPTIVE_POPT_NONE( "no-sandbox" ,N_("Turn off sandboxing feature")), - CAPTIVE_POPT_STRING("bug-pathname" ,N_("Pathname to strftime(3) for .captivebug.xml.gz bugreports"),N_("pathname")), - /* Do not: POPT_ARGFLAG_OPTIONAL - * as it always eats one argument unless it is at end of argv[]. - */ - CAPTIVE_POPT_NONE( "syslog" ,N_("Messages sent to syslog(3) instead of stderr")), - CAPTIVE_POPT_STRING("syslog-facility" ,N_("openlog(3) facility for --syslog"),N_("facility")), - -#undef CAPTIVE_POPT_NONE -#undef CAPTIVE_POPT_STRING -#undef CAPTIVE_POPT - POPT_TABLEEND - }; - -static const struct poptOption captive_popt_standalone[]={ - CAPTIVE_POPT_INCLUDE, - POPT_AUTOHELP - POPT_TABLEEND - }; - - -static void (*const popt_func_table[])(void)={ - arg_filesystem, - arg_load_module, - arg_ro, - arg_blind, - arg_rw, - arg_cdrom, - arg_disk, - arg_debug_messages, - arg_sandbox_server, - arg_sandbox_server_ior, - arg_no_sandbox, - arg_bug_pathname, - arg_syslog, - arg_syslog_facility, - }; - - -/* poptCallbackType captive_popt_callback */ -static void captive_popt_callback - (poptContext con,enum poptCallbackReason reason,const struct poptOption *opt,const char *arg,const void *data) -{ -gint funci; - - switch (reason) { - case POPT_CALLBACK_REASON_PRE: - arg_syslog_facility_value=-1; - break; - - case POPT_CALLBACK_REASON_OPTION: - funci=(opt-(captive_popt+POPT_OFFSET)); - g_return_if_fail(funci>=0); - g_return_if_fail(funci<(gint)G_N_ELEMENTS(popt_func_table)); - if (popt_func_table[funci]) - (*popt_func_table[funci])(); - free(captive_popt_optarg); - break; - - case POPT_CALLBACK_REASON_POST: - if (captive_options->syslog_facility!=-1 && arg_syslog_facility_value!=-1) - captive_options->syslog_facility=arg_syslog_facility_value; - - break; - - default: g_assert_not_reached(); - } - - captive_popt_optarg=NULL; /* sanity */ -} - - -gboolean captive_options_parse(struct captive_options *options,const gchar *captive_args) -{ -int errint; -int captive_args_argc; -const char **captive_args_argv=NULL; -poptContext context; -gboolean r=FALSE; - - g_return_val_if_fail(options!=NULL,FALSE); - g_return_val_if_fail(captive_args!=NULL,FALSE); - - g_assert(captive_options==NULL); - captive_options=options; - - errint=poptParseArgvString(captive_args,&captive_args_argc,&captive_args_argv); - if (errint!=0) { - g_warning("argument parsing args error: %s",captive_args); - goto args_err; - } - context=poptGetContext( - PACKAGE, /* name */ - captive_args_argc,captive_args_argv, /* argc,argv */ - captive_popt_standalone, /* options */ - POPT_CONTEXT_KEEP_FIRST); - if (context==NULL) { - g_warning("argument recognization args error: %s",captive_args); - goto args_err_argv; - } - errint=poptReadDefaultConfig(context, - TRUE); /* useEnv */ - if (errint!=0) { - g_warning("argument recognization args error: %s",captive_args); - goto args_err_context; - } - errint=poptGetNextOpt(context); - if (errint!=-1) { - g_warning("some non-callbacked argument reached: %s",captive_args); - goto args_err_context; - } - if (poptPeekArg(context)) { - g_warning("some non-option argument reached: %s",captive_args); - goto args_err_context; - } - r=TRUE; /* success */ -args_err_context: - poptFreeContext(context); -args_err_argv: - free(captive_args_argv); /* may be NULL here */ -args_err: - if (!r) { - captive_options=NULL; - return FALSE; - } - - g_assert(captive_options!=NULL); - captive_options=NULL; - - return TRUE; -} diff --git a/src/libcaptive/client/options.pod.pl.in b/src/libcaptive/client/options.pod.pl.in deleted file mode 100644 index f7d2f4f..0000000 --- a/src/libcaptive/client/options.pod.pl.in +++ /dev/null @@ -1,185 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# perlpod(1) source for captive(7) options part of man page -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -my $vardir='@localstatedir@/lib/@PACKAGE@'; -$vardir=~s#\$\Q{prefix}\E#'@prefix@';#ge; -$vardir="/var/lib/@PACKAGE@" if $vardir=~/^@/; -my $sbindir='@sbindir@'; -$sbindir=~s#\$\Q{exec_prefix}\E#'@exec_prefix@';#ge; -$sbindir=~s#\$\Q{prefix}\E#'@prefix@';#ge; -$sbindir="/usr/sbin" if $sbindir=~/^@/; - -print <<'POD_EOF'; -=head1 OPTIONS - -All programs using B<@PACKAGE@>(7) library share the common set of configuration -options: - -=over - -=item B<--filesystem>=B - -Pathname to B<.sys> or B<.so> filesystem module file. You will use exactly -once this option. Possible choices are -POD_EOF -print "B<$vardir/ntfs.sys>\n"; -print <<'POD_EOF'; -etc. - - -=item B<--load-module>=B - -Pathname to any W32 module to load w/o initialization. Multiple modules can be -loaded although in common case you will use just -POD_EOF -print "B<$vardir/ntoskrnl.exe>\n"; -print <<'POD_EOF'; -here. - - -=item B<--ro> - -Read/write mode: Any write access will be forbidden. You should set this mode -for B (I filesystem). This option is mutually exclusive with -B<--blind> and B<--rw>. - - -=item B<--blind> - -Read/write mode: All writes are just simulated in memory (default). Microsoft -Windows filesystem driver will see no difference between B<--blind> and B<--rw> -although the UNIX image file/device will be open read/only as for B<--ro>. -All the changes get 'written' as long as B(7) program runs - all the -changes will be lost afterwards. This mode is the most suitable for debugging. -This option is mutually exclusive with B<--ro> and B<--rw>. - - -=item B<--rw> - -Read/write mode: Write directly to the image file/device. Standard read/write -disk mode. You should use B<--sandbox-server> option in this case to have the -disk protected against Microsoft Windows filesystem driver crashes. Modified -disk image blocks are in B<--sandbox-server> B<--rw> mode buffered in the -memory and they get reflected to the disk only after successful completion -of all filesystem operations including filesystem unmount. -This option is mutually exclusive with B<--ro> and B<--blind>. - - -=item B<--cdrom> - -Media type: CD-ROM. You must set this media type for B. -Virtual Microsoft Windows block device driver used by Captive maps to -B<\Device\CdRom0>. This option is mutually exclusive with B<--disk>. - - -=item B<--disk> - -Media type: Disk (default). You must set this media type for all the Microsoft -Windows filesystem drivers except B. Virtual Microsoft Windows block -device driver used by Captive maps to B<\Device\CaptiveHarddisk0>. -This option is mutually exclusive with B<--cdrom>. - - -=item B<--debug-messages> - -Turn on debugging messages. Be prepared for substation debug output. -Use of B<--syslog> feature is not recommended in this case. - - -=item B<--sandbox-server>=B - -Pathname to -POD_EOF -print "B<$sbindir/captive-sandbox-server>\n"; -print <<'POD_EOF'; -program, turns on sandboxing. -You should always use this option in conjunction with B<--rw>, see it for -details. Although this program is I and it drops it privileges -to B<@CAPTIVE_SANDBOX_SETUID@> user. Your system gets protected by -B(2), B(2), B(2) and B(2) UNIX security -features against malicious Microsoft Windows drivers. You should never use this -option during debugging. - -This option is turned on automatically during the mount operation by -B(8). -Option needs to be used by hand for the B(2) client. - - -=item B<--sandbox-server-ior>=B - -Specify I of -POD_EOF -print "B<$sbindir/captive-sandbox-server>\n"; -print <<'POD_EOF'; -program, turns on -sandboxing. Specified I should be the string starting by "B" -text. This option is useful only for debugging. No sandbox restarting is -possible in this case. - - -=item B<--no-sandbox> - -Turn off sandboxing feature (default). No -POD_EOF -print "B<$sbindir/captive-sandbox-server>\n"; -print <<'POD_EOF'; -is run. Microsoft Windows filesystem driver is run in native UNIX environment -without any I separation. This option is recommended only for debugging. -It is dangerous to use B<--rw> together, see its description for the details. - - -=item B<--bug-pathname>=B - -Pathname to B(3) for B<.captivebug.xml.gz> bugreports. Every crash of -sandbox child gets bugreported to the specified file. You should attempt to -minimize the number of operations from the mount operation till the expected -crash to minimize the snapshot file size. B<--sandbox-server> option is -required for B<--bug-pathname>. - -B - - -=item B<--syslog> - -Messages sent to B(3) instead of I. This option gets handy -for B(8) operation as the messages would be lost otherway. -Watch our for possible "B" messages where -some written filesystem data got lost in the case of Microsoft Windows -filesystem driver crash. - - -=item B<--syslog-facility>=B - -B(3) facility for B<--syslog>. See B section of -B(3) man page for details. Lowercased values such as B or -B are supported. - - -=back - - -POD_EOF -1; diff --git a/src/libcaptive/client/parent-connector.c b/src/libcaptive/client/parent-connector.c deleted file mode 100644 index 3de15e1..0000000 --- a/src/libcaptive/client/parent-connector.c +++ /dev/null @@ -1,530 +0,0 @@ -/* $Id$ - * fs object sandbox parents reconnections to their sandbox slave peers - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "parent-connector.h" /* self */ -#include - - -/* g_object_get_data() 'key': */ -#define CAPTIVE_PARENT_CONNECTOR_CORBA_OBJECTP "captive_parent_connector-corba_objectp" /* &CORBA_Object */ -#define CAPTIVE_PARENT_CONNECTOR_CAPTIVE_VFS_PARENT_OBJECT "captive_parent_connector-captive_vfs_parent_object" /* &CaptiveVfsParentObject */ -#define CAPTIVE_PARENT_CONNECTOR_DIRTY "captive_parent_connector-dirty" /* GINT_TO_POINTER(0/1) */ -#define CAPTIVE_PARENT_CONNECTOR_BROKEN "captive_parent_connector-broken" /* GINT_TO_POINTER(0/1) */ -#define CAPTIVE_PARENT_CONNECTOR_SELF_REFS "captive_parent_connector-self_refs" /* GINT_TO_POINTER(count) */ - - -/* - * vfs signal - * vfs signal - * vfs signal - * - * connector state vfs yes/no - * connector state corba_object yes/no - * connector state dirty yes/no - * - * vfs handle dirty oper. detach cease abort - * disconnected N N N opn_* discon. discon. discon. - * broken N N Y broken broken broken broken - * N/A N Y N - * N/A N Y Y - * closed_clean Y N N X X discon. discon. - * closed_dirty Y N Y X X discon. broken - * opened_clean Y Y N opn_* cls_cln X discon. - * opened_dirty Y Y Y opn_drt cls_drt X broken - * - * init->disconnected - * - * [VFS shutdown] - * [failure] - * [failure] - * - * - * sandbox master GObject hierarchy (horizontal=dervived): - * DirectoryParent----------------------------------->Directory->GObject - * \->ParentConnector->GTypeInterface | - * | [ref.] | [reference] - * VfsParent----------------->Vfs->GObject - * - * sandbox master GObject reconnections signalling: - * VfsParent -> ParentConnector - * ParentConnector -> DirectoryParent - * sandbox master reconnection requests: - * DirectoryParent -> ParentConnector - * ParentConnector -> VfsParent - * - * CORBA/ORBit connections: - * sandbox master | sandbox slave (restartable) - * ---------------------------------|----------------------------------- - * DirectoryParent--Directory_stub <-> Directory_servant--DirectorySlave - * VfsParent--------Vfs_stub <-> Vfs_servant--VfsSlave - * - * sandbox slave GObject hierarchy (horizontal=dervived): - * DirectorySlave->Directory->GObject - * | [reference] - * VfsSlave->Vfs->GObject - */ - - -static GnomeVFSResult captive_parent_connector_handler_open(CaptiveParentConnector *captive_parent_connector); -static GnomeVFSResult captive_parent_connector_handler_close(CaptiveParentConnector *captive_parent_connector); - - -static void captive_parent_connector_iface_init(CaptiveParentConnectorIface *captive_parent_connector_iface) -{ - captive_parent_connector_iface->open=captive_parent_connector_handler_open; - captive_parent_connector_iface->close=captive_parent_connector_handler_close; -} - - -GType captive_parent_connector_get_type(void) -{ -static GType captive_parent_connector_type=0; - - if (!captive_parent_connector_type) { -static const GTypeInfo captive_parent_connector_info={ - sizeof(CaptiveParentConnectorIface), - (GBaseInitFunc)captive_parent_connector_iface_init, /* base_init */ - NULL, /* base_finalize */ - NULL, /* iface_init */ - NULL, /* iface_finalize */ - NULL, /* iface_data */ - 0, /* instance_size */ - 0, /* n_preallocs */ - NULL, /* instance_init */ - }; - - captive_parent_connector_type=g_type_register_static(G_TYPE_INTERFACE, - "CaptiveParentConnector",&captive_parent_connector_info,0); - } - - return captive_parent_connector_type; -} - -static void captive_parent_connector_vfs_signals_disconnect(CaptiveParentConnector *captive_parent_connector); - -static void captive_parent_connector_vfs_detach(CaptiveVfsParentObject *captive_vfs_parent_object, - CaptiveParentConnector *captive_parent_connector) -{ - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector)); - g_return_if_fail(NULL==captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector) - || captive_vfs_parent_object==captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector)); - - /**/ if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) - /* NOP */; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN)) - /* NOP */; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)) - /* NOP */; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) { - (*CAPTIVE_PARENT_CONNECTOR_GET_IFACE(captive_parent_connector)->close)(captive_parent_connector); /* errors ignored */ - g_assert(captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)); - } - else g_assert_not_reached(); -} - -static void captive_parent_connector_vfs_cease(CaptiveVfsParentObject *captive_vfs_parent_object, - CaptiveParentConnector *captive_parent_connector) -{ - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector)); - g_return_if_fail(NULL==captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector) - || captive_vfs_parent_object==captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector)); - - /**/ if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) - /* NOP */; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN)) - /* NOP */; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)) { - g_object_set_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_DIRTY, - GINT_TO_POINTER(FALSE)); - } - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) - g_assert_not_reached(); - else g_assert_not_reached(); - - captive_parent_connector_vfs_signals_disconnect(captive_parent_connector); -} - -static void captive_parent_connector_vfs_abort(CaptiveVfsParentObject *captive_vfs_parent_object, - CaptiveParentConnector *captive_parent_connector) -{ - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector)); - g_return_if_fail(NULL==captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector) - || captive_vfs_parent_object==captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector)); - - if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_DIRTY_OR_OPENED_DIRTY)) - g_warning(_("Filesystem crash broke dirty object: %s"), - (*CAPTIVE_PARENT_CONNECTOR_GET_IFACE(captive_parent_connector)->get_pathname)(captive_parent_connector)); - - /**/ if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) - /* NOP */; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN)) - /* NOP */; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_CLEAN)) - /* NOP */; /* -> DISCONNECTED */ - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_DIRTY)) { - /* -> BROKEN */ - /* Ensure to never become VFS-capable Connector from BROKEN state. */ - g_object_set_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_BROKEN, - GINT_TO_POINTER(TRUE)); - } - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) { - (*CAPTIVE_PARENT_CONNECTOR_GET_IFACE(captive_parent_connector)->close)(captive_parent_connector); /* errors ignored */ - g_assert(captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)); - } - else g_assert_not_reached(); - - captive_parent_connector_vfs_signals_disconnect(captive_parent_connector); -} - -static void captive_parent_connector_vfs_signals_connect(CaptiveParentConnector *captive_parent_connector) -{ -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector)); - - captive_vfs_parent_object=captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector); - - /* Prevent multiple equivalent signal handlers. */ - captive_parent_connector_vfs_signals_disconnect(captive_parent_connector); - - g_signal_connect(captive_vfs_parent_object,"detach", - G_CALLBACK(captive_parent_connector_vfs_detach),captive_parent_connector); /* c_handler,data */ - g_signal_connect(captive_vfs_parent_object,"cease", - G_CALLBACK(captive_parent_connector_vfs_cease),captive_parent_connector); /* c_handler,data */ - g_signal_connect(captive_vfs_parent_object,"abort", - G_CALLBACK(captive_parent_connector_vfs_abort),captive_parent_connector); /* c_handler,data */ -} - -static void captive_parent_connector_vfs_signals_disconnect(CaptiveParentConnector *captive_parent_connector) -{ -CaptiveVfsParentObject *captive_vfs_parent_object; -gint self_refs; - - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector)); - - captive_vfs_parent_object=captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector); - - g_signal_handlers_disconnect_by_func(captive_vfs_parent_object, - G_CALLBACK(captive_parent_connector_vfs_detach),captive_parent_connector); /* func,data */ - g_signal_handlers_disconnect_by_func(captive_vfs_parent_object, - G_CALLBACK(captive_parent_connector_vfs_cease),captive_parent_connector); /* func,data */ - g_signal_handlers_disconnect_by_func(captive_vfs_parent_object, - G_CALLBACK(captive_parent_connector_vfs_abort),captive_parent_connector); /* func,data */ - - /* Do not 'while'-cycle the loop by 1-decreasing as we cannot g_object_get_data() - * on fully unreffed GObject. - */ - if ((self_refs=GPOINTER_TO_INT( - g_object_get_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_SELF_REFS)))) { - g_assert(self_refs>0); - g_object_set_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_SELF_REFS, - GINT_TO_POINTER(0)); - while (self_refs--) { - /* Undo captive_directory_close() / captive_file_close(): */ - g_object_ref(captive_vfs_parent_object); - /* Cause g_object_last_unref(): */ - g_object_unref(captive_parent_connector); - } - } -} - - -void captive_parent_connector_init(CaptiveParentConnector *captive_parent_connector, - CORBA_Object *corba_objectp,CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector)); - g_return_if_fail(corba_objectp!=NULL); - g_return_if_fail(/* CORBA_Object_is_nil() */ *corba_objectp==CORBA_OBJECT_NIL); - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); - - g_object_set_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_CORBA_OBJECTP, - corba_objectp); - g_object_set_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_CAPTIVE_VFS_PARENT_OBJECT, - captive_vfs_parent_object); - g_object_set_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_DIRTY, - GINT_TO_POINTER(FALSE)); - - g_assert( - captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED_OR_CLOSED_CLEAN)); -} - - -/* Abort dispose()? */ -gboolean captive_parent_connector_dispose(CaptiveParentConnector *captive_parent_connector) -{ - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),FALSE); - - if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_DIRTY)) { -CaptiveVfsParentObject *captive_vfs_parent_object; - - captive_vfs_parent_object=captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector); - - /* Cancel g_object_last_unref(): */ - g_object_ref(captive_parent_connector); - /* Simulate captive_directory_close() / captive_file_close(): */ - g_object_unref(captive_vfs_parent_object); - g_object_set_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_SELF_REFS, - GINT_TO_POINTER(1+GPOINTER_TO_INT( - g_object_get_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_SELF_REFS)))); - return TRUE; /* abort dispose() */ - } - - captive_parent_connector_vfs_signals_disconnect(captive_parent_connector); - return FALSE; /* continue dispose() */ -} - - -void captive_parent_connector_finalize(CaptiveParentConnector *captive_parent_connector) -{ - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector)); - - g_assert(captive_parent_connector_is_state( - captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED_OR_BROKEN_OR_CLOSED)); - /* Should have been catched by captive_parent_connector_dispose(): */ - g_assert(!captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_DIRTY)); - - captive_parent_connector_vfs_signals_disconnect(captive_parent_connector); -} - - -GnomeVFSResult captive_parent_connector_connect(CaptiveParentConnector *captive_parent_connector) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) { - if (GNOME_VFS_OK!=(r=captive_vfs_parent_object_connect( - captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector)))) - return r; - g_assert(captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_CLEAN)); - } - - /**/ if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) - g_assert_not_reached(); - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN)) - return GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)) - return GNOME_VFS_OK; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) - return GNOME_VFS_OK; - else g_assert_not_reached(); - - /* NOTREACHED */ - return GNOME_VFS_ERROR_INTERNAL; -} - - -GnomeVFSResult captive_parent_connector_open(CaptiveParentConnector *captive_parent_connector) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (GNOME_VFS_OK!=(r=captive_parent_connector_connect(captive_parent_connector))) - return r; - - if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)) { - if (GNOME_VFS_OK!=(r=(*CAPTIVE_PARENT_CONNECTOR_GET_IFACE(captive_parent_connector)->open)(captive_parent_connector))) - return r; - g_assert(captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)); - } - - /**/ if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) - g_assert_not_reached(); - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN)) - g_assert_not_reached(); - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)) - g_assert_not_reached(); - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) - return GNOME_VFS_OK; - else g_assert_not_reached(); - - /* NOTREACHED */ - return GNOME_VFS_ERROR_INTERNAL; -} - - -GnomeVFSResult captive_parent_connector_close(CaptiveParentConnector *captive_parent_connector) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) { - if (GNOME_VFS_OK!=(r=(*CAPTIVE_PARENT_CONNECTOR_GET_IFACE(captive_parent_connector)->close)(captive_parent_connector))) - return r; - g_assert(captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)); - } - - /**/ if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) - return GNOME_VFS_OK; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN)) - return GNOME_VFS_OK; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)) - return GNOME_VFS_OK; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) - g_assert_not_reached(); - else g_assert_not_reached(); - - /* NOTREACHED */ - return GNOME_VFS_ERROR_INTERNAL; -} - - -void captive_parent_connector_set_dirty(CaptiveParentConnector *captive_parent_connector) -{ - g_return_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector)); - - g_return_if_fail(captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)); - - g_object_set_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_DIRTY, - GINT_TO_POINTER(TRUE)); -} - - -static GnomeVFSResult captive_parent_connector_handler_open(CaptiveParentConnector *captive_parent_connector) -{ - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - /* Handler should have 'opened' us. */ - - /**/ if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) - g_assert_not_reached(); - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN)) - g_assert_not_reached(); - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)) - g_assert_not_reached(); /* Parent handler failed. */ - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) { - captive_parent_connector_vfs_signals_connect(captive_parent_connector); - return GNOME_VFS_OK; - } - else g_assert_not_reached(); - - /* NOTREACHED */ - return GNOME_VFS_ERROR_INTERNAL; -} - - -static GnomeVFSResult captive_parent_connector_handler_close(CaptiveParentConnector *captive_parent_connector) -{ - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),GNOME_VFS_ERROR_BAD_PARAMETERS); - - /* Handler should have 'closed' us. */ - - /**/ if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED)) - return GNOME_VFS_OK; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN)) - return GNOME_VFS_OK; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED)) - return GNOME_VFS_OK; - else if (captive_parent_connector_is_state(captive_parent_connector,CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED)) - g_assert_not_reached(); - else g_assert_not_reached(); - - /* NOTREACHED */ - return GNOME_VFS_ERROR_INTERNAL; -} - - -CaptiveVfsParentObject *captive_parent_connector_get_captive_vfs_parent_object - (CaptiveParentConnector *captive_parent_connector) -{ -CaptiveVfsParentObject *r; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),NULL); - - r=g_object_get_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_CAPTIVE_VFS_PARENT_OBJECT); - g_assert(CAPTIVE_VFS_PARENT_IS_OBJECT(r)); - - return r; -} - - -CORBA_Object captive_parent_connector_get_corba_object(CaptiveParentConnector *captive_parent_connector) -{ -CORBA_Object *rp; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),NULL); - - rp=g_object_get_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_CORBA_OBJECTP); - g_assert(rp!=NULL); - /* '*rp' may be NULL */ - - return *rp; -} - - -gboolean captive_parent_connector_get_dirty(CaptiveParentConnector *captive_parent_connector) -{ -gpointer r_gpointer; -gint r_gint; - - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),FALSE); - - r_gpointer=g_object_get_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_DIRTY); - r_gint=GPOINTER_TO_INT(r_gpointer); - g_assert(r_gint==TRUE || r_gint==FALSE); - - return r_gint; -} - - -gboolean captive_parent_connector_is_state(CaptiveParentConnector *captive_parent_connector, - CaptiveParentConnectorFlagWant vfs_want, - CaptiveParentConnectorFlagWant corba_object_want,CaptiveParentConnectorFlagWant dirty_want) -{ - g_return_val_if_fail(CAPTIVE_IS_PARENT_CONNECTOR(captive_parent_connector),FALSE); - - if (vfs_want!=CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY) { -CaptiveVfsParentObject *captive_vfs_parent_object; - - captive_vfs_parent_object=captive_parent_connector_get_captive_vfs_parent_object(captive_parent_connector); - if ((vfs_want==CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON)!= - (!GPOINTER_TO_INT(g_object_get_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_BROKEN)) - && /* !CORBA_Object_is_nil() */ captive_vfs_parent_object->corba_Vfs_object!=CORBA_OBJECT_NIL)) - return FALSE; - } - if (corba_object_want!=CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY) { -CORBA_Object corba_object; - - corba_object=captive_parent_connector_get_corba_object(captive_parent_connector); - g_assert(!GPOINTER_TO_INT(g_object_get_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_BROKEN)) - || corba_object==CORBA_OBJECT_NIL); - if ((corba_object_want==CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON)!= - (/* !CORBA_Object_is_nil() */ corba_object!=CORBA_OBJECT_NIL)) - return FALSE; - } - if (dirty_want!=CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY) { -gboolean dirty; - - dirty=captive_parent_connector_get_dirty(captive_parent_connector); - g_assert(!GPOINTER_TO_INT(g_object_get_data(G_OBJECT(captive_parent_connector),CAPTIVE_PARENT_CONNECTOR_BROKEN)) - || dirty==TRUE); - if ((dirty_want==CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON)!=dirty) - return FALSE; - } - - return TRUE; -} diff --git a/src/libcaptive/client/parent-connector.h b/src/libcaptive/client/parent-connector.h deleted file mode 100644 index b7defb1..0000000 --- a/src/libcaptive/client/parent-connector.h +++ /dev/null @@ -1,123 +0,0 @@ -/* $Id$ - * Include file for fs object sandbox parents reconnections to their sandbox slave peers - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_PARENT_CONNECTOR_H -#define _CAPTIVE_CLIENT_PRIV_PARENT_CONNECTOR_H 1 - - -#include -#include -#include -#include -#include "vfs-parent.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_TYPE_PARENT_CONNECTOR (captive_parent_connector_get_type ()) -#define CAPTIVE_PARENT_CONNECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR, CaptiveParentConnector)) -#define CAPTIVE_PARENT_CONNECTOR_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR, CaptiveParentConnectorIface)) -#define CAPTIVE_IS_PARENT_CONNECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR)) -#define CAPTIVE_IS_PARENT_CONNECTOR_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR)) -#define CAPTIVE_PARENT_CONNECTOR_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR, CaptiveParentConnectorIface)) -typedef struct _CaptiveParentConnector CaptiveParentConnector; -typedef struct _CaptiveParentConnectorIface CaptiveParentConnectorIface; - - -GType captive_parent_connector_get_type(void); - -struct _CaptiveParentConnectorIface { - GTypeInterface g_iface; - - GnomeVFSResult (*open)(CaptiveParentConnector *captive_parent_connector); - GnomeVFSResult (*close)(CaptiveParentConnector *captive_parent_connector); - G_CONST_RETURN gchar *(*get_pathname)(CaptiveParentConnector *captive_parent_connector); - }; - -typedef enum { - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY, - } CaptiveParentConnectorFlagWant; - -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_CLEAN \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_DIRTY \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_DIRTY_OR_OPENED_DIRTY \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED_OR_CLOSED_CLEAN \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED_OR_BROKEN_OR_CLOSED \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED_CLEAN \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF /* dirty */ -#define CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED_DIRTY \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* vfs */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON, /* corba_object */ \ - CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON /* dirty */ - -void captive_parent_connector_init(CaptiveParentConnector *captive_parent_connector, - CORBA_Object *corba_objectp,CaptiveVfsParentObject *captive_vfs_parent_object); -gboolean captive_parent_connector_dispose(CaptiveParentConnector *captive_parent_connector); -void captive_parent_connector_finalize(CaptiveParentConnector *captive_parent_connector); -GnomeVFSResult captive_parent_connector_connect(CaptiveParentConnector *captive_parent_connector); -GnomeVFSResult captive_parent_connector_open(CaptiveParentConnector *captive_parent_connector); -GnomeVFSResult captive_parent_connector_close(CaptiveParentConnector *captive_parent_connector); -void captive_parent_connector_set_dirty(CaptiveParentConnector *captive_parent_connector); -CaptiveVfsParentObject *captive_parent_connector_get_captive_vfs_parent_object - (CaptiveParentConnector *captive_parent_connector); -CORBA_Object captive_parent_connector_get_corba_object(CaptiveParentConnector *captive_parent_connector); -gboolean captive_parent_connector_get_dirty(CaptiveParentConnector *captive_parent_connector); -gboolean captive_parent_connector_is_state(CaptiveParentConnector *captive_parent_connector, - CaptiveParentConnectorFlagWant vfs_want, - CaptiveParentConnectorFlagWant corba_object_want,CaptiveParentConnectorFlagWant dirty_want); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_PARENT_CONNECTOR_H */ diff --git a/src/libcaptive/client/result.c b/src/libcaptive/client/result.c deleted file mode 100644 index b6a9dc8..0000000 --- a/src/libcaptive/client/result.c +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * captive vfs result code translation for Gnome-VFS-2.0 - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "result.h" /* self */ -#include -#include "reactos/ddk/status.h" /* for STATUS_* */ -#include /* for GnomeVFSResult */ - - -GnomeVFSResult captive_NTSTATUS_to_GnomeVFSResult(NTSTATUS err) -{ - switch (err) { - case STATUS_NO_SUCH_FILE: return GNOME_VFS_ERROR_EOF; /* ==0 files found */ - case STATUS_NO_MORE_FILES: return GNOME_VFS_ERROR_EOF; /* >=1 files found */ - case STATUS_OBJECT_NAME_COLLISION: return GNOME_VFS_ERROR_FILE_EXISTS; - case STATUS_OBJECT_NAME_NOT_FOUND: return GNOME_VFS_ERROR_NOT_FOUND; - case STATUS_UNRECOGNIZED_VOLUME: return GNOME_VFS_ERROR_WRONG_FORMAT; - case STATUS_OBJECT_NAME_INVALID: return GNOME_VFS_ERROR_INVALID_URI; - case STATUS_DIRECTORY_NOT_EMPTY: return GNOME_VFS_ERROR_DIRECTORY_NOT_EMPTY; - case STATUS_NOT_A_DIRECTORY: return GNOME_VFS_ERROR_NOT_A_DIRECTORY; - case STATUS_INVALID_PARAMETER: return GNOME_VFS_ERROR_BAD_PARAMETERS; /* read() of directory handle */ - case STATUS_CANNOT_DELETE: return GNOME_VFS_ERROR_GENERIC; /* unlink() of '/' */ - case STATUS_ACCESS_DENIED: return GNOME_VFS_ERROR_ACCESS_DENIED; /* mkdir() on r/o device */ - case STATUS_OBJECT_PATH_NOT_FOUND: return GNOME_VFS_ERROR_NOT_FOUND; /* rename() to nonexist/smth */ - case STATUS_MEDIA_WRITE_PROTECTED: return GNOME_VFS_ERROR_READ_ONLY; - case STATUS_SHARING_VIOLATION: return GNOME_VFS_ERROR_DIRECTORY_BUSY; /* errno EBUSY */ - default:; /* PASSTHRU */ - } - return GNOME_VFS_OK; /* undetected */ -} diff --git a/src/libcaptive/client/result.h b/src/libcaptive/client/result.h deleted file mode 100644 index d77bf4a..0000000 --- a/src/libcaptive/client/result.h +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id$ - * Include file for captive vfs result code translation for Gnome-VFS-2.0 - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_RESULT_H -#define _CAPTIVE_CLIENT_RESULT_H 1 - - -#include -#include "reactos/napi/types.h" /* for NTSTATUS */ -#include - - -G_BEGIN_DECLS - -GnomeVFSResult captive_NTSTATUS_to_GnomeVFSResult(NTSTATUS err); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_RESULT_H */ diff --git a/src/libcaptive/client/standalone-gnome.c b/src/libcaptive/client/standalone-gnome.c deleted file mode 100644 index 6c23ebf..0000000 --- a/src/libcaptive/client/standalone-gnome.c +++ /dev/null @@ -1,70 +0,0 @@ -/* $Id$ - * --enable-standalone optional Gnome init for static builds of captive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "standalone-gnome.h" /* self */ -#include -#include "standalone.h" -#include - - -void captive_standalone_gnome_init(void) -{ -static gboolean done=FALSE; - - if (done) - return; - - captive_standalone_init(); - -#ifdef HAVE_GNOMEUI - -#ifdef ENABLE_STANDALONE - - /* Prevent loading of custom theme needing icons which may - * be problematic to be loaded by our static binary. - * However user still may have specified his/her theme in $HOME. - */ - setenv("GTK2_RC_FILES","", - 1); /* overwrite */ - - /* Prevent: Cannot open Input Method ... - */ - setenv("GTK_IM_MODULE_FILE","/dev/null", - 1); /* overwrite */ - -#endif /* ENABLE_STANDALONE */ - -#ifdef STANDALONE_FONTSDIR - - /* Prevent handling (even writing!): ~/.fonts.cache-1 */ - FcConfigEnableHome(FcFalse); - - /* Prevent fontconfig loading: /etc/fonts/fonts.conf */ - /* 'fonts_conf_dir' is created by: bundle_files_write() */ - setenv("FONTCONFIG_PATH",STANDALONE_FONTSDIR, - 1); /* overwrite */ - -#endif /* STANDALONE_FONTSDIR */ - -#endif /* HAVE_GNOMEUI */ - - done=TRUE; -} diff --git a/src/libcaptive/client/standalone-gnome.h b/src/libcaptive/client/standalone-gnome.h deleted file mode 100644 index 6c52586..0000000 --- a/src/libcaptive/client/standalone-gnome.h +++ /dev/null @@ -1,35 +0,0 @@ -/* $Id$ - * Include file for --enable-standalone optional Gnome init for static builds of captive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_STANDALONE_GNOME_H -#define _CAPTIVE_CLIENT_STANDALONE_GNOME_H 1 - - -#include -#include "captive/client.h" /* self */ - - -G_BEGIN_DECLS - -void captive_standalone_gnome_init(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_STANDALONE_GNOME_H */ diff --git a/src/libcaptive/client/standalone.c b/src/libcaptive/client/standalone.c deleted file mode 100644 index b859013..0000000 --- a/src/libcaptive/client/standalone.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id$ - * General + --enable-standalone optional init for static builds of captive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "standalone.h" /* self */ -#include -#include -#include -#include - - -gboolean captive_standalone_init_done=FALSE; - -void captive_standalone_init(void) -{ - if (captive_standalone_init_done) - return; - -#ifdef ENABLE_STANDALONE - - /* Prevent glibc loading: /usr/lib/gconv/gconv-modules.cache */ - setenv("GCONV_PATH","/foobar", - 1); /* overwrite */ - - /* Not needed: "LIBCHARSET_ALIAS_DIR" - * as prevented by: glib-2.6.4-noaliases.patch - */ - - if (getenv("LC_ALL")) - setenv("LC_MESSAGES",getenv("LC_ALL"), - 1); /* overwrite */ - if (!getenv("LC_MESSAGES") && getenv("LANG")) - setenv("LC_MESSAGES",getenv("LANG"), - 1); /* overwrite */ - setenv("LC_CTYPE","en_US.utf8", - 1); /* overwrite */ - unsetenv("LANG"); - unsetenv("LC_COLLATE"); - unsetenv("LC_MONETARY"); - unsetenv("LC_NUMERIC"); - unsetenv("LC_TIME"); - - /* It may differ across distributions. Maybe - just expected. */ - setenv("LOCPATH",LOCALEDIR, - 1); /* overwrite */ - -#endif /* ENABLE_STANDALONE */ - - /* Prevent output block buffering if redirecting stdout to file. */ - setvbuf(stdout,(char *)NULL,_IONBF,0); - setvbuf(stderr,(char *)NULL,_IONBF,0); - - /* Initialize the i18n stuff */ - setlocale(LC_ALL,""); - bindtextdomain(PACKAGE,LOCALEDIR); - textdomain(PACKAGE); - - /* Initialize GObject subsystem of GLib. */ - g_type_init(); - - captive_standalone_init_done=TRUE; -} diff --git a/src/libcaptive/client/standalone.h b/src/libcaptive/client/standalone.h deleted file mode 100644 index 938f348..0000000 --- a/src/libcaptive/client/standalone.h +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ - * Include file for general + --enable-standalone optional init for static builds of captive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_STANDALONE_H -#define _CAPTIVE_CLIENT_STANDALONE_H 1 - - -#include -#include "captive/client.h" /* self */ - - -G_BEGIN_DECLS - -extern gboolean captive_standalone_init_done; - -void captive_standalone_init(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_STANDALONE_H */ diff --git a/src/libcaptive/client/usecount.c b/src/libcaptive/client/usecount.c deleted file mode 100644 index 9c6cdcd..0000000 --- a/src/libcaptive/client/usecount.c +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ - * Usecounting for regular disk commits of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/usecount.h" /* self */ -#include -#include - - -static gint captive_usecount_number=0; - -void captive_usecount(gint balance) -{ - g_assert(captive_usecount_number>=0); - - g_assert(captive_usecount_number+balance >= 0); - captive_usecount_number+=balance; - - g_assert(captive_usecount_number>=0); -} diff --git a/src/libcaptive/client/vfs-parent.c b/src/libcaptive/client/vfs-parent.c deleted file mode 100644 index 40801ef..0000000 --- a/src/libcaptive/client/vfs-parent.c +++ /dev/null @@ -1,322 +0,0 @@ -/* $Id$ - * captive vfs 'vfs' interface to reactos of sandbox parent - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "vfs-parent.h" /* self */ -#include -#include "captive/macros.h" -#include "../sandbox/parent-Vfs.h" -#include "directory-parent.h" -#include "file-parent.h" -#include "marshallers.h" - - -static gpointer captive_vfs_parent_object_parent_class=NULL; - - -static GnomeVFSResult captive_vfs_parent_init(CaptiveVfsObject *captive_vfs_object); -static void captive_vfs_parent_object_dispose(CaptiveVfsParentObject *captive_vfs_parent_object); -static void captive_vfs_parent_object_handler_detach(CaptiveVfsParentObject *captive_vfs_parent_object); -static void captive_vfs_parent_object_handler_cease(CaptiveVfsParentObject *captive_vfs_parent_object); -static void captive_vfs_parent_object_handler_abort(CaptiveVfsParentObject *captive_vfs_parent_object); -static GnomeVFSResult captive_vfs_parent_close(CaptiveVfsObject *captive_vfs_object); -static GnomeVFSResult captive_vfs_parent_commit(CaptiveVfsObject *captive_vfs_object); -static GnomeVFSResult captive_vfs_parent_volume_info_get - (CaptiveVfsObject *captive_vfs_object,CaptiveVfsVolumeInfo *volume_info); -static GnomeVFSResult captive_vfs_parent_object_connect_silent(CaptiveVfsParentObject *captive_vfs_parent_object); - - -/* We need to close the filesystem during custom 'dispose' - * as the default GObject g_object_real_dispose() destroys all the signals - * first and we would not notify our Connectors during captive_vfs_parent_object_finalize(). - */ -static void captive_vfs_parent_object_dispose(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_if_fail(captive_vfs_parent_object!=NULL); - - captive_vfs_parent_close(CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)); /* errors ignored */ - - G_OBJECT_CLASS(captive_vfs_parent_object_parent_class)->dispose((GObject *)captive_vfs_parent_object); -} - - -static void captive_vfs_parent_object_finalize(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_if_fail(captive_vfs_parent_object!=NULL); - - G_OBJECT_CLASS(captive_vfs_parent_object_parent_class)->finalize((GObject *)captive_vfs_parent_object); -} - - -static void captive_vfs_parent_object_class_init(CaptiveVfsParentObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); -CaptiveVfsObjectClass *captive_vfs_object_class=CAPTIVE_VFS_OBJECT_CLASS(class); - - captive_vfs_parent_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->dispose=(void (*)(GObject *object))captive_vfs_parent_object_dispose; - gobject_class->finalize=(void (*)(GObject *object))captive_vfs_parent_object_finalize; - - captive_vfs_object_class->init=captive_vfs_parent_init; - captive_vfs_object_class->commit=captive_vfs_parent_commit; - captive_vfs_object_class->volume_info_get=captive_vfs_parent_volume_info_get; - - captive_vfs_object_class->directory_new_open=captive_directory_parent_new_open; - captive_vfs_object_class->directory_new_make=captive_directory_parent_new_make; - - captive_vfs_object_class->file_new_open=captive_file_parent_new_open; - captive_vfs_object_class->file_new_create=captive_file_parent_new_create; - - class->detach=captive_vfs_parent_object_handler_detach; - g_signal_new( - "detach", /* signal_name */ - G_TYPE_FROM_CLASS(class), /* itype */ - G_SIGNAL_RUN_LAST, /* signal_flags */ - G_STRUCT_OFFSET(CaptiveVfsParentObjectClass,detach), /* class_offset */ - NULL,NULL, /* accumulator,accu_data */ - captive_client_VOID__VOID, /* c_marshaller */ - G_TYPE_NONE,0); /* return_type,n_params */ - class->cease=captive_vfs_parent_object_handler_cease; - g_signal_new( - "cease", /* signal_name */ - G_TYPE_FROM_CLASS(class), /* itype */ - G_SIGNAL_RUN_LAST, /* signal_flags */ - G_STRUCT_OFFSET(CaptiveVfsParentObjectClass,cease), /* class_offset */ - NULL,NULL, /* accumulator,accu_data */ - captive_client_VOID__VOID, /* c_marshaller */ - G_TYPE_NONE,0); /* return_type,n_params */ - class->abort=captive_vfs_parent_object_handler_abort; - g_signal_new( - "abort", /* signal_name */ - G_TYPE_FROM_CLASS(class), /* itype */ - G_SIGNAL_RUN_LAST, /* signal_flags */ - G_STRUCT_OFFSET(CaptiveVfsParentObjectClass,abort), /* class_offset */ - NULL,NULL, /* accumulator,accu_data */ - captive_client_VOID__VOID, /* c_marshaller */ - G_TYPE_NONE,0); /* return_type,n_params */ -} - - -static void captive_vfs_parent_object_init(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - captive_vfs_parent_object->corba_parent_giochanel_blind=NULL; -} - - -static void captive_vfs_parent_object_handler_detach(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); -} - -static void captive_vfs_parent_object_handler_cease(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); -} - -static void captive_vfs_parent_object_handler_abort(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); -} - - -GType captive_vfs_parent_object_get_type(void) -{ -static GType captive_vfs_parent_object_type=0; - - if (!captive_vfs_parent_object_type) { -static const GTypeInfo captive_vfs_parent_object_info={ - sizeof(CaptiveVfsParentObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_vfs_parent_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveVfsParentObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_vfs_parent_object_init, - }; - - captive_vfs_parent_object_type=g_type_register_static(CAPTIVE_VFS_TYPE_OBJECT, - "CaptiveVfsParentObject",&captive_vfs_parent_object_info,0); - } - - return captive_vfs_parent_object_type; -} - - -static GnomeVFSResult captive_vfs_parent_init(CaptiveVfsObject *captive_vfs_object) -{ -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(captive_vfs_object); - - return captive_sandbox_parent_vfs_new(captive_vfs_parent_object); -} - - -static GnomeVFSResult captive_vfs_parent_close(CaptiveVfsObject *captive_vfs_object) -{ -CaptiveVfsParentObject *captive_vfs_parent_object; -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(captive_vfs_object); - - if (captive_vfs_parent_object->corba_Vfs_object!=CORBA_OBJECT_NIL) { - r=captive_vfs_parent_object_disconnect(captive_vfs_parent_object); - g_assert(captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL); - } - else - r=GNOME_VFS_OK; - - if (captive_vfs_parent_object->corba_parent_giochanel_blind_source) { - g_io_channel_unref(captive_vfs_parent_object->corba_parent_giochanel_blind_source); - captive_vfs_parent_object->corba_parent_giochanel_blind_source=NULL; - } - - return r; -} - - -static GnomeVFSResult captive_vfs_parent_commit(CaptiveVfsObject *captive_vfs_object) -{ -CaptiveVfsParentObject *captive_vfs_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(captive_vfs_object); - - do { - if (captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL - && GNOME_VFS_OK!=(r=captive_vfs_parent_object_connect_silent(captive_vfs_parent_object))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_vfs_commit(captive_vfs_parent_object))) - return r; - } while (!retried++); - return r; -} - - -static GnomeVFSResult captive_vfs_parent_volume_info_get - (CaptiveVfsObject *captive_vfs_object,CaptiveVfsVolumeInfo *volume_info) -{ -CaptiveVfsParentObject *captive_vfs_parent_object; -GnomeVFSResult r; -gint retried=0; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(volume_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(captive_vfs_object); - - do { - if (captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL - && GNOME_VFS_OK!=(r=captive_vfs_parent_object_connect(captive_vfs_parent_object))) - return r; - if (GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE - !=(r=captive_sandbox_parent_vfs_volume_info_get(captive_vfs_parent_object,volume_info))) - return r; - } while (!retried++); - return r; -} - - -GnomeVFSResult captive_vfs_parent_object_connect(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return captive_sandbox_parent_vfs_new(captive_vfs_parent_object); -} - - -static GnomeVFSResult captive_vfs_parent_object_connect_silent(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return captive_sandbox_parent_vfs_new_silent(captive_vfs_parent_object); -} - - -GnomeVFSResult captive_vfs_parent_object_disconnect(CaptiveVfsParentObject *captive_vfs_parent_object) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object!=CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - /* Detach all connectors: */ - g_signal_emit_by_name(captive_vfs_parent_object,"detach"); - - /* Some connector detaching broke the connection? */ - if (captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL) { - /* "abort" should have been emitted by captive_vfs_parent_object_aborted() */ - return GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE; - } - - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_vfs_close(captive_vfs_parent_object))) { - /* Some non-ORBit shutdown error may have occured: */ - g_signal_emit_by_name(captive_vfs_parent_object,"abort"); - return r; - } - - /* success: */ - g_signal_emit_by_name(captive_vfs_parent_object,"cease"); - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_vfs_parent_object_aborted(CaptiveVfsParentObject *captive_vfs_parent_object) -{ -static gint inside=0; -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object!=CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - /* Prevent looping by COMM_FAILURE of 'unmount' operation - * by captive_sandbox_parent_vfs_close(). - */ - g_assert(inside>=0); - if (inside) - return GNOME_VFS_OK; - inside++; - - g_signal_emit_by_name(captive_vfs_parent_object,"abort"); - - r=captive_sandbox_parent_vfs_close(captive_vfs_parent_object); - - g_assert(inside==1); - inside--; - - return r; -} diff --git a/src/libcaptive/client/vfs-parent.h b/src/libcaptive/client/vfs-parent.h deleted file mode 100644 index 1ec1f38..0000000 --- a/src/libcaptive/client/vfs-parent.h +++ /dev/null @@ -1,86 +0,0 @@ -/* $Id$ - * Include vfs for captive 'vfs' private interface to reactos of sandbox parent - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_VFS_PARENT_H -#define _CAPTIVE_CLIENT_PRIV_VFS_PARENT_H 1 - - -#include -#include -#include -#include "captive/client-vfs.h" /* for CaptiveVfsObject */ -#include "vfs.h" /* for CaptiveVfsObject priv */ -#include "../sandbox/sandbox.h" -#include - - -G_BEGIN_DECLS - -#define CAPTIVE_VFS_PARENT_TYPE_OBJECT (captive_vfs_parent_object_get_type()) -#define CAPTIVE_VFS_PARENT_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_VFS_PARENT_TYPE_OBJECT,CaptiveVfsParentObject)) -#define CAPTIVE_VFS_PARENT_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_VFS_PARENT_TYPE_OBJECT,CaptiveVfsParentObjectClass)) -#define CAPTIVE_VFS_PARENT_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_VFS_PARENT_TYPE_OBJECT)) -#define CAPTIVE_VFS_PARENT_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_VFS_PARENT_TYPE_OBJECT)) -#define CAPTIVE_VFS_PARENT_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_VFS_PARENT_TYPE_OBJECT,CaptiveVfsParentObjectClass)) -typedef struct _CaptiveVfsParentObject CaptiveVfsParentObject; -typedef struct _CaptiveVfsParentObjectClass CaptiveVfsParentObjectClass; - - -GType captive_vfs_parent_object_get_type(void); - -struct _CaptiveVfsParentObject { - CaptiveVfsObject parent_instance; - - Captive_Vfs corba_Vfs_object; - Captive_GLogFunc corba_GLogFunc_object; - Captive_CaptiveIOChannel corba_CaptiveIOChannel_object; - /* It may corba_parent_giochanel_blind_source==options.image_iochannel ! - * 1st stage : corba_parent_giochanel_blind - * 2nd stage (optional): corba_parent_giochanel_blind_source - * 3rd stage (optional): captive_storage_relastblock(options.image_iochannel) - * 4rd stage : options.image_iochannel - */ - GIOChannel *corba_parent_giochanel_blind; - GIOChannel *corba_parent_giochanel_blind_source; - int corba_parentheart_fds_1; - gchar *corba_chrooted_orbit_dir; - gchar *corba_socketname; - pid_t corba_child_pid; - xmlDoc *corba_bug_doc; - xmlNode *corba_bug; - xmlNode *corba_bug_action; - xmlNode *corba_bug_log; - }; -struct _CaptiveVfsParentObjectClass { - CaptiveVfsObjectClass parent_class; - - /* signals */ - void (*detach)(CaptiveVfsParentObject *captive_vfs_parent_object); - void (*cease)(CaptiveVfsParentObject *captive_vfs_parent_object); - void (*abort)(CaptiveVfsParentObject *captive_vfs_parent_object); - }; - -GnomeVFSResult captive_vfs_parent_object_connect(CaptiveVfsParentObject *captive_vfs_parent_object); -GnomeVFSResult captive_vfs_parent_object_disconnect(CaptiveVfsParentObject *captive_vfs_parent_object); -GnomeVFSResult captive_vfs_parent_object_aborted(CaptiveVfsParentObject *captive_vfs_parent_object); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_VFS_PARENT_H */ diff --git a/src/libcaptive/client/vfs-slave.c b/src/libcaptive/client/vfs-slave.c deleted file mode 100644 index 5bb7a0a..0000000 --- a/src/libcaptive/client/vfs-slave.c +++ /dev/null @@ -1,210 +0,0 @@ -/* $Id$ - * captive vfs 'vfs' interface to reactos of sandbox slave - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "vfs-slave.h" /* self */ -#include -#include "captive/client-vfs.h" /* for CaptiveVfsObject */ -#include "vfs.h" /* for CaptiveVfsObject priv */ -#include "captive/macros.h" -#include "directory.h" -#include "reactos/ddk/iotypes.h" -#include "captive/client-directory.h" -#include "reactos/ntos/zw.h" /* for NtQueryVolumeInformationFile() */ -#include "result.h" -#include "init.h" -#include "directory-slave.h" -#include "file-slave.h" - - -struct _CaptiveVfsSlaveObject { - CaptiveVfsObject parent_instance; - }; -struct _CaptiveVfsSlaveObjectClass { - CaptiveVfsObjectClass parent_class; - }; - - -static gpointer captive_vfs_slave_object_parent_class=NULL; - - -static GnomeVFSResult captive_vfs_slave_init(CaptiveVfsObject *captive_vfs_object); -static GnomeVFSResult captive_vfs_slave_close(CaptiveVfsObject *captive_vfs_object); -static GnomeVFSResult captive_vfs_slave_commit(CaptiveVfsObject *captive_vfs_object); -static GnomeVFSResult captive_vfs_slave_volume_info_get - (CaptiveVfsObject *captive_vfs_object,CaptiveVfsVolumeInfo *volume_info); - - -static void captive_vfs_slave_object_finalize(CaptiveVfsSlaveObject *captive_vfs_slave_object) -{ - g_return_if_fail(captive_vfs_slave_object!=NULL); - - captive_vfs_slave_close(CAPTIVE_VFS_OBJECT(captive_vfs_slave_object)); /* errors ignored */ - - G_OBJECT_CLASS(captive_vfs_slave_object_parent_class)->finalize((GObject *)captive_vfs_slave_object); -} - - -static void captive_vfs_slave_object_class_init(CaptiveVfsSlaveObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); -CaptiveVfsObjectClass *captive_vfs_object_class=CAPTIVE_VFS_OBJECT_CLASS(class); - - captive_vfs_slave_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_vfs_slave_object_finalize; - - captive_vfs_object_class->init=captive_vfs_slave_init; - captive_vfs_object_class->commit=captive_vfs_slave_commit; - captive_vfs_object_class->volume_info_get=captive_vfs_slave_volume_info_get; - - captive_vfs_object_class->directory_new_open=captive_directory_slave_new_open; - captive_vfs_object_class->directory_new_make=captive_directory_slave_new_make; - - captive_vfs_object_class->file_new_open=captive_file_slave_new_open; - captive_vfs_object_class->file_new_create=captive_file_slave_new_create; -} - - -static void captive_vfs_slave_object_init(CaptiveVfsSlaveObject *captive_vfs_slave_object) -{ -} - - -GType captive_vfs_slave_object_get_type(void) -{ -static GType captive_vfs_slave_object_type=0; - - if (!captive_vfs_slave_object_type) { -static const GTypeInfo captive_vfs_slave_object_info={ - sizeof(CaptiveVfsSlaveObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_vfs_slave_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveVfsSlaveObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_vfs_slave_object_init, - }; - - captive_vfs_slave_object_type=g_type_register_static(CAPTIVE_VFS_TYPE_OBJECT, - "CaptiveVfsSlaveObject",&captive_vfs_slave_object_info,0); - } - - return captive_vfs_slave_object_type; -} - - -static GnomeVFSResult captive_vfs_slave_init(CaptiveVfsObject *captive_vfs_object) -{ -CaptiveVfsSlaveObject *captive_vfs_slave_object; -gboolean errbool; - - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_slave_object=CAPTIVE_VFS_SLAVE_OBJECT(captive_vfs_object); - - g_assert(captive_options==NULL); - captive_options=&captive_vfs_object->options; - - errbool=captive_init(); - g_assert(errbool==TRUE); - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_vfs_slave_close(CaptiveVfsObject *captive_vfs_object) -{ -CaptiveVfsSlaveObject *captive_vfs_slave_object; -gboolean errbool; - - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_slave_object=CAPTIVE_VFS_SLAVE_OBJECT(captive_vfs_object); - - g_assert(captive_options==&captive_vfs_object->options); - errbool=captive_shutdown(); - g_assert(errbool==TRUE); - - captive_options=NULL; - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_vfs_slave_commit(CaptiveVfsObject *captive_vfs_object) -{ -CaptiveVfsSlaveObject *captive_vfs_slave_object; - - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_slave_object=CAPTIVE_VFS_SLAVE_OBJECT(captive_vfs_object); - - /* We do not buffer any data if not in sandboxed mode. */ - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_vfs_slave_volume_info_get - (CaptiveVfsObject *captive_vfs_object,CaptiveVfsVolumeInfo *volume_info) -{ -CaptiveVfsSlaveObject *captive_vfs_slave_object; -FILE_FS_FULL_SIZE_INFORMATION FileFsFullSizeInformation_local; -NTSTATUS err; -IO_STATUS_BLOCK volume_IoStatusBlock; -GnomeVFSResult errvfsresult; -CaptiveDirectoryObject *captive_directory_object; - - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(volume_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_slave_object=CAPTIVE_VFS_SLAVE_OBJECT(captive_vfs_object); - - if (GNOME_VFS_OK!=(errvfsresult=captive_directory_new_open(&captive_directory_object,captive_vfs_object,"/"))) - return errvfsresult; - - err=NtQueryVolumeInformationFile( - CAPTIVE_DIRECTORY_SLAVE_OBJECT(captive_directory_object)->dir_Handle, /* FileHandle */ - &volume_IoStatusBlock, /* IoStatusBlock */ - &FileFsFullSizeInformation_local, /* FsInformation */ - sizeof(FileFsFullSizeInformation_local), /* Length */ - FileFsFullSizeInformation); /* FsInformationClass */ - if (NT_SUCCESS(err)!=NT_SUCCESS(volume_IoStatusBlock.Status)) { - g_assert_not_reached(); - goto err_unref_captive_directory_object; - } - if (GNOME_VFS_OK!=(errvfsresult=captive_NTSTATUS_to_GnomeVFSResult(err))) - goto err_unref_captive_directory_object; - - g_object_unref(captive_directory_object); - - volume_info->block_size=FileFsFullSizeInformation_local.BytesPerSector - *FileFsFullSizeInformation_local.SectorsPerAllocationUnit; - volume_info->bytes =FileFsFullSizeInformation_local.TotalAllocationUnits.QuadPart *volume_info->block_size; - volume_info->bytes_free =FileFsFullSizeInformation_local.ActualAvailableAllocationUnits.QuadPart*volume_info->block_size; - volume_info->bytes_available=FileFsFullSizeInformation_local.CallerAvailableAllocationUnits.QuadPart*volume_info->block_size; - - return GNOME_VFS_OK; - -err_unref_captive_directory_object: - g_object_unref(captive_directory_object); - return errvfsresult; -} diff --git a/src/libcaptive/client/vfs-slave.h b/src/libcaptive/client/vfs-slave.h deleted file mode 100644 index 45be1ec..0000000 --- a/src/libcaptive/client/vfs-slave.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * Include vfs for captive 'vfs' private interface to reactos of sandbox slave - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_VFS_SLAVE_H -#define _CAPTIVE_CLIENT_PRIV_VFS_SLAVE_H 1 - - -#include -#include -#include - - -G_BEGIN_DECLS - -#define CAPTIVE_VFS_SLAVE_TYPE_OBJECT (captive_vfs_slave_object_get_type()) -#define CAPTIVE_VFS_SLAVE_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_VFS_SLAVE_TYPE_OBJECT,CaptiveVfsSlaveObject)) -#define CAPTIVE_VFS_SLAVE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_VFS_SLAVE_TYPE_OBJECT,CaptiveVfsSlaveObjectClass)) -#define CAPTIVE_VFS_SLAVE_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_VFS_SLAVE_TYPE_OBJECT)) -#define CAPTIVE_VFS_SLAVE_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_VFS_SLAVE_TYPE_OBJECT)) -#define CAPTIVE_VFS_SLAVE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_VFS_SLAVE_TYPE_OBJECT,CaptiveVfsSlaveObjectClass)) -typedef struct _CaptiveVfsSlaveObject CaptiveVfsSlaveObject; -typedef struct _CaptiveVfsSlaveObjectClass CaptiveVfsSlaveObjectClass; - - -GType captive_vfs_slave_object_get_type(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_VFS_SLAVE_H */ diff --git a/src/libcaptive/client/vfs.c b/src/libcaptive/client/vfs.c deleted file mode 100644 index 180f389..0000000 --- a/src/libcaptive/client/vfs.c +++ /dev/null @@ -1,164 +0,0 @@ -/* $Id$ - * captive vfs 'vfs' interface to reactos - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/client-vfs.h" /* self */ -#include "vfs.h" /* self-priv */ -#include -#include "vfs-parent.h" -#include "vfs-slave.h" -#include "init.h" -#include "lib.h" /* for captive_giochannel_setup() */ -#include -#include - - -static gpointer captive_vfs_object_parent_class=NULL; - - -static GnomeVFSResult captive_vfs_close(CaptiveVfsObject *captive_vfs_object); - -static void captive_vfs_object_finalize(CaptiveVfsObject *captive_vfs_object) -{ - g_return_if_fail(captive_vfs_object!=NULL); - - captive_vfs_close(captive_vfs_object); /* errors ignored */ - - G_OBJECT_CLASS(captive_vfs_object_parent_class)->finalize((GObject *)captive_vfs_object); -} - - -static void captive_vfs_object_class_init(CaptiveVfsObjectClass *class) -{ -GObjectClass *gobject_class=G_OBJECT_CLASS(class); - - captive_vfs_object_parent_class=g_type_class_ref(g_type_parent(G_TYPE_FROM_CLASS(class))); - gobject_class->finalize=(void (*)(GObject *object))captive_vfs_object_finalize; -} - - -static void captive_vfs_object_init(CaptiveVfsObject *captive_vfs_object) -{ - captive_options_init(&captive_vfs_object->options); -} - - -GType captive_vfs_object_get_type(void) -{ -static GType captive_vfs_object_type=0; - - if (!captive_vfs_object_type) { -static const GTypeInfo captive_vfs_object_info={ - sizeof(CaptiveVfsObjectClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc)captive_vfs_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(CaptiveVfsObject), - 5, /* n_preallocs */ - (GInstanceInitFunc)captive_vfs_object_init, - }; - - captive_vfs_object_type=g_type_register_static(G_TYPE_OBJECT, - "CaptiveVfsObject",&captive_vfs_object_info,G_TYPE_FLAG_ABSTRACT); - } - - return captive_vfs_object_type; -} - - -GnomeVFSResult captive_vfs_new - (CaptiveVfsObject **captive_vfs_object_return,const struct captive_options *options) -{ -CaptiveVfsObject *captive_vfs_object; - - g_return_val_if_fail(captive_vfs_object_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(options!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - -#ifndef MAINTAINER_MODE - /* We are not sandboxing || we are the master */ - if (!options->sandbox || (options->sandbox_server_argv || options->sandbox_server_ior)) { -int fd; - - /* Shameless advertisement: */ - for (fd=2 /* STDERR */;fd>=1 /* STDOUT */;fd--) { - if (isatty(fd)) { -const gchar *msg="Captive NTFS v" VERSION ". Check a new version at: http://www.jankratochvil.net/\n"; - - /* Prevent: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result */ - if (strlen(msg)==write(fd,msg,strlen(msg))) - break; - } - } - } -#endif /* !MAINTAINER_MODE */ - - /* Here is the first initializaton point of parent in sandboxed mode. */ - captive_log_init(options); - - *captive_vfs_object_return=NULL; - - /* We are sandboxing && we are the master */ - if (options->sandbox && (options->sandbox_server_argv || options->sandbox_server_ior)) - captive_vfs_object=g_object_new( - CAPTIVE_VFS_PARENT_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - else - captive_vfs_object=g_object_new( - CAPTIVE_VFS_SLAVE_TYPE_OBJECT, /* object_type */ - NULL); /* first_property_name; FIXME: support properties */ - - captive_options_copy(&captive_vfs_object->options,options); - - if (captive_vfs_object->options.image_iochannel) - captive_giochannel_setup(captive_vfs_object->options.image_iochannel); - - *captive_vfs_object_return=captive_vfs_object; - - return (*CAPTIVE_VFS_OBJECT_GET_CLASS(captive_vfs_object)->init)(captive_vfs_object); -} - - -static GnomeVFSResult captive_vfs_close(CaptiveVfsObject *captive_vfs_object) -{ - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_options_free(&captive_vfs_object->options); - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_vfs_commit(CaptiveVfsObject *captive_vfs_object) -{ - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_VFS_OBJECT_GET_CLASS(captive_vfs_object)->commit)(captive_vfs_object); -} - - -GnomeVFSResult captive_vfs_volume_info_get(CaptiveVfsObject *captive_vfs_object,CaptiveVfsVolumeInfo *volume_info) -{ - g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(volume_info!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - return (*CAPTIVE_VFS_OBJECT_GET_CLASS(captive_vfs_object)->volume_info_get)(captive_vfs_object,volume_info); -} diff --git a/src/libcaptive/client/vfs.h b/src/libcaptive/client/vfs.h deleted file mode 100644 index a4efe4e..0000000 --- a/src/libcaptive/client/vfs.h +++ /dev/null @@ -1,64 +0,0 @@ -/* $Id$ - * Include vfs for captive 'vfs' private interface to reactos - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_PRIV_VFS_H -#define _CAPTIVE_CLIENT_PRIV_VFS_H 1 - - -#include -#include -#include -#include "../sandbox/sandbox.h" -#include -#include "captive/options.h" -#include "captive/client-vfs.h" -#include "captive/client-directory.h" -#include "captive/client-file.h" - - -G_BEGIN_DECLS - -struct _CaptiveVfsObject { - GObject parent_instance; - - /*< private >*/ - struct captive_options options; - }; -struct _CaptiveVfsObjectClass { - GObjectClass parent_class; - - GnomeVFSResult (*init)(CaptiveVfsObject *captive_vfs_object); - GnomeVFSResult (*commit)(CaptiveVfsObject *captive_vfs_object); - GnomeVFSResult (*volume_info_get)(CaptiveVfsObject *captive_vfs_object,CaptiveVfsVolumeInfo *volume_info); - - GnomeVFSResult (*directory_new_open)(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname); - GnomeVFSResult (*directory_new_make)(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,guint perm); - - GnomeVFSResult (*file_new_open)(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode); - GnomeVFSResult (*file_new_create)(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm); - }; - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_PRIV_VFS_H */ diff --git a/src/libcaptive/cm/Makefile.am b/src/libcaptive/cm/Makefile.am deleted file mode 100644 index 94317ff..0000000 --- a/src/libcaptive/cm/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# $Id$ -# automake source for the reactos's cm/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libcm.la -libcm_la_SOURCES= \ - ntfunc.c \ - rtlfunc.c diff --git a/src/libcaptive/cm/ntfunc.c b/src/libcaptive/cm/ntfunc.c deleted file mode 100644 index c7fcd81..0000000 --- a/src/libcaptive/cm/ntfunc.c +++ /dev/null @@ -1,43 +0,0 @@ -/* $Id$ - * reactos registry handling functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include - - -/** - * ZwOpenKey: - * @KeyHandle: Returns new opened #HANDLE. - * @DesiredAccess: Required access privileges to the created registry object handle. - * @ObjectAttributes: Registry object attributes by InitializeObjectAttributes(). - * %NULL value is forbidden. - * - * Opens specified key from the system registry database. - * libcaptive currently always returns %STATUS_OBJECT_NAME_NOT_FOUND. - * - * Returns: %STATUS_OBJECT_NAME_NOT_FOUND - */ -NTSTATUS ZwOpenKey(OUT PHANDLE KeyHandle,IN ACCESS_MASK DesiredAccess,IN POBJECT_ATTRIBUTES ObjectAttributes) -{ - g_return_val_if_fail(ObjectAttributes!=NULL,STATUS_INVALID_PARAMETER); - - return STATUS_OBJECT_NAME_NOT_FOUND; -} diff --git a/src/libcaptive/cm/rtlfunc.c b/src/libcaptive/cm/rtlfunc.c deleted file mode 100644 index 5b3a26f..0000000 --- a/src/libcaptive/cm/rtlfunc.c +++ /dev/null @@ -1,100 +0,0 @@ -/* $Id$ - * reactos registry handling functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include -#include "captive/unicode.h" -#include "captive/macros.h" - - -/** - * RtlQueryRegistryValues: - * @RelativeTo: Basedir type constant of relative @Path; ignored by libcaptive. - * @Path: String path or handle to retrieve; ignored by libcaptive. - * @QueryTable: Table of entries to retrieve; ignored by libcaptive. - * %NULL value is forbidden. - * @Context: Userdata to pass to QueryRoutine() (of @QueryTable); ignored by libcaptive. - * @Environment: Environment variable to use for key expansion; optional; ignored by libcaptive. - * - * Retrieves specified key from the system registry database. - * libcaptive currently always returns %STATUS_OBJECT_NAME_NOT_FOUND - * except #ULONG value 1 for the key "\captive\filesystem\Parameters\WritingSupport" - * (for ext2fsd.sys V0.10A). - * - * Returns: %STATUS_OBJECT_NAME_NOT_FOUND or %STATUS_SUCCESS if some result returned. - */ -NTSTATUS RtlQueryRegistryValues - (IN ULONG RelativeTo,IN PCWSTR Path,IN PRTL_QUERY_REGISTRY_TABLE QueryTable,IN PVOID Context,IN PVOID Environment) -{ -const WCHAR *Path__captive_filesystem_Parameters_ucs2= - captive_utf8_to_UnicodeString_alloca("\\captive\\filesystem\\Parameters")->Buffer; -const WCHAR *QueryTable_WritingSupport_Name_ucs2= - captive_utf8_to_UnicodeString_alloca("WritingSupport")->Buffer; -const WCHAR *QueryTable_CSDVersion_Name_ucs2= - captive_utf8_to_UnicodeString_alloca("CSDVersion")->Buffer; -const gchar *RelativeTo_table[]={ - "RTL_REGISTRY_ABSOLUTE", - "RTL_REGISTRY_SERVICES", - "RTL_REGISTRY_CONTROL", - "RTL_REGISTRY_WINDOWS_NT", - "RTL_REGISTRY_DEVICEMAP", - "RTL_REGISTRY_USER", - "RTL_REGISTRY_ENUM", - }; -UNICODE_STRING Path_UnicodeString; - - g_return_val_if_fail(Path!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(QueryTable!=NULL,STATUS_INVALID_PARAMETER); - - Path_UnicodeString.Length=captive_ucs2_strlen(Path)*sizeof(*Path_UnicodeString.Buffer); - Path_UnicodeString.MaximumLength=Path_UnicodeString.Length+sizeof(*Path_UnicodeString.Buffer); - Path_UnicodeString.Buffer=(/* de-const */ PWSTR)Path; - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: RelativeTo=%s,Path=%s",G_STRLOC, - (RelativeTo>=0 && RelativeTo 'EXT2_SUPPORT_WRITING' */ - return STATUS_SUCCESS; - } - - if (RelativeTo==RTL_REGISTRY_WINDOWS_NT - && *Path==0 - && QueryTable[0].Name!=NULL - && captive_ucs2_compare(QueryTable[0].Name,QueryTable_CSDVersion_Name_ucs2) - && QueryTable[0].Flags==RTL_QUERY_REGISTRY_DIRECT - && QueryTable[0].EntryContext!=NULL - && QueryTable[1].Name==NULL) { - RtlCopyUnicodeString( - (UNICODE_STRING *)QueryTable->EntryContext, /* DestinationString */ - captive_utf8_to_UnicodeString_alloca("Service Pack 1")); /* SourceString */ - return STATUS_SUCCESS; - } - - return STATUS_OBJECT_NAME_NOT_FOUND; -} diff --git a/src/libcaptive/ex/Makefile.am b/src/libcaptive/ex/Makefile.am deleted file mode 100644 index b6a4463..0000000 --- a/src/libcaptive/ex/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# $Id$ -# automake source for the reactos's ex/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libex.la -libex_la_SOURCES= \ - list.c \ - lookas.c \ - resource.c \ - time.c \ - work.c diff --git a/src/libcaptive/ex/list.c b/src/libcaptive/ex/list.c deleted file mode 100644 index 7f32dad..0000000 --- a/src/libcaptive/ex/list.c +++ /dev/null @@ -1,74 +0,0 @@ -/* $Id$ - * reactos list functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/exfuncs.h" -#include -#include "reactos/ntos/types.h" /* for PSLIST_ENTRY */ - - -/** - * InterlockedPopEntrySList: - * @ListHead: List to remove the first entry from. - * %NULL value is forbidden. - * - * Function will remove the first item of @ListHead list and returns its entry @PSLIST_ENTRY. - * Function should behave in multiprocessing safe way - not handled by libcaptive. - * - * Returns: The first entry item of @ListHead. Passed @ListHead will have the first item removed. - * %NULL value if the list was empty. - */ -PSLIST_ENTRY InterlockedPopEntrySList(IN PSLIST_HEADER ListHead) -{ -KSPIN_LOCK SpinLock; - - g_return_val_if_fail(ListHead!=NULL,NULL); - - /* TODO:thread */ - KeInitializeSpinLock(&SpinLock); - return ExInterlockedPopEntrySList(ListHead,&SpinLock); -} - - -/** - * InterlockedPushEntrySList: - * @ListHead: List to insert @ListEntry item to its start. - * %NULL value is forbidden. - * @ListEntry: List item to insert to @ListHead. - * %NULL value is forbidden. - * - * Function will insert @ListEntry as the first item of @ListHead list. - * Function should behave in multiprocessing safe way - not handled by libcaptive. - * - * Returns: The previous first entry item of @ListHead (currently the second one). - * Passed @ListHead will have the first item @ListEntry. - * Returns %NULL value if the list was empty. - */ -PSLIST_ENTRY InterlockedPushEntrySList(IN PSLIST_HEADER ListHead,IN PSLIST_ENTRY ListEntry) -{ -KSPIN_LOCK SpinLock; - - g_return_val_if_fail(ListHead!=NULL,NULL); - g_return_val_if_fail(ListEntry!=NULL,NULL); - - /* TODO:thread */ - KeInitializeSpinLock(&SpinLock); - return ExInterlockedPushEntrySList(ListHead,ListEntry,&SpinLock); -} diff --git a/src/libcaptive/ex/lookas.c b/src/libcaptive/ex/lookas.c deleted file mode 100644 index 5f176d8..0000000 --- a/src/libcaptive/ex/lookas.c +++ /dev/null @@ -1,180 +0,0 @@ -/* $Id$ - * reactos lookaside list functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/exfuncs.h" -#include -#include "reactos/internal/module.h" /* for MODULE_OBJECT */ -#include "reactos/internal/ldr.h" /* for LdrGetModuleObject() */ -#include "captive/unicode.h" -#include "captive/ldr_exports.h" /* for captive_ModuleList_patchpoint */ - - -static G_CONST_RETURN guint8 *binary_defined_find(gconstpointer binary_base,gsize binary_length, - const guint8 *code,const guint8 *code_defined,gsize code_length,gssize call_offset) -{ -const guint8 *base,*r; -guint resti; - - g_return_val_if_fail(binary_base!=NULL,NULL); - g_return_val_if_fail(binary_length>=code_length,NULL); - g_return_val_if_fail(code!=NULL,NULL); - g_return_val_if_fail(code_defined!=NULL,NULL); - g_return_val_if_fail(code_length>0,NULL); - - g_return_val_if_fail(code_defined[0],NULL); /* NOT SUPPORTED */ - - r=NULL; - for (base=binary_base;(char *)base<((char *)binary_base)+binary_length-code_length;base++) { -gpointer call_orig=NULL; /* Prevent: ... might be used uninitialized in this function */ - - base=memchr(base,code[0],(((char *)binary_base)+binary_length-code_length)-((char *)base)); - if (!base) - break; - if (call_offset>=0) { - g_assert(call_offset+1+4<=(gssize)code_length); - g_assert(code[call_offset]==0xE8); /* call $quad-immediate */ - g_assert(code_defined[call_offset+0] - && code_defined[call_offset+1] - && code_defined[call_offset+2] - && code_defined[call_offset+3] - && code_defined[call_offset+4]); - call_orig=*(gpointer *)(code+call_offset+1); - *(gint32 *)(code+call_offset+1)=((char *)call_orig)-(((char *)base)+call_offset+1+4); /* make it relative */ - } - for (resti=1;resti=0) - *(gpointer *)(code+call_offset+1)=call_orig; - if (restiTextSection!=NULL); - - g_assert(patchpoint->orig_w32_func!=NULL); - g_assert(initcode[20]==0xE8); *(void **)(initcode+20+1)=patchpoint->orig_w32_func; - - if (!(initcode_found=binary_defined_find( - (void *)ntoskrnl_exe_ModuleObject->TextSection->Base, /* binary_base */ - ntoskrnl_exe_ModuleObject->TextSection->Length, /* binary_length */ - initcode, /* code */ - initcode_defined, /* code_defined */ - sizeof(initcode), /* code_length */ - 20))) /* call_offset */ - return FALSE; - - g_assert(Lookaside==*(gpointer *)(initcode_found+15+1)); - - /**/ if (patchpoint==&ExInitializeNPagedLookasideList_patchpoint) - ExInitializeNPagedLookasideList( - (NPAGED_LOOKASIDE_LIST *)Lookaside, /* Lookaside */ - NULL, /* Allocate; NULL as there is only guint8 in the code */ - NULL, /* Free; NULL as there is only guint8 in the code */ - *(guint8 *)(initcode_found+9+1), /* Flags; undocumented by W32 doc (reserved) */ - *(guint8 *)(initcode_found+7+1), /* Size; FIXME: ? node size */ - *(guint32 *)(initcode_found+2+1), /* Tag; 'FSfm' */ - *(guint8 *)(initcode_found+0+1)); /* Depth; undocumented by W32 doc (reserved) */ - else if (patchpoint==&ExInitializePagedLookasideList_patchpoint) - ExInitializePagedLookasideList( - (PAGED_LOOKASIDE_LIST *)Lookaside, /* Lookaside */ - NULL, /* Allocate; NULL as there is only guint8 in the code */ - NULL, /* Free; NULL as there is only guint8 in the code */ - *(guint8 *)(initcode_found+9+1), /* Flags; undocumented by W32 doc (reserved) */ - *(guint8 *)(initcode_found+7+1), /* Size; FIXME: ? node size */ - *(guint32 *)(initcode_found+2+1), /* Tag; 'FSfm' */ - *(guint8 *)(initcode_found+0+1)); /* Depth; undocumented by W32 doc (reserved) */ - else g_assert_not_reached(); - - return TRUE; -} - - -PVOID ExAllocateFromPagedLookasideList_orig(PPAGED_LOOKASIDE_LIST Lookaside); - -PVOID ExAllocateFromPagedLookasideList_wrap(PAGED_LOOKASIDE_LIST *Lookaside) -{ -static PAGED_LOOKASIDE_LIST Lookaside_zero; - - g_return_val_if_fail(Lookaside!=NULL,NULL); - - if (!memcmp(Lookaside,&Lookaside_zero,sizeof(Lookaside_zero))) { - if (1 - && !ExAllocateFromPagedLookasideList_findinit(Lookaside,&ExInitializeNPagedLookasideList_patchpoint) - && !ExAllocateFromPagedLookasideList_findinit(Lookaside,&ExInitializePagedLookasideList_patchpoint)) - g_assert_not_reached(); /* failed to patch it */ - } - - return ExAllocateFromPagedLookasideList_orig(Lookaside); -} diff --git a/src/libcaptive/ex/resource.c b/src/libcaptive/ex/resource.c deleted file mode 100644 index 2ecbd55..0000000 --- a/src/libcaptive/ex/resource.c +++ /dev/null @@ -1,341 +0,0 @@ -/* $Id$ - * reactos ERESOURCE handling by libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/exfuncs.h" /* self */ -#include -#include "reactos/ddk/extypes.h" /* for ERESOURCE */ -#include "captive/macros.h" - - -#define ERESOURCE_OWNING_COUNT_SHARED(Resource) ((Resource)->OwnerThreads[0].OwnerCount) -#define ERESOURCE_OWNING_COUNT_EXCLUSIVE(Resource) ((Resource)->OwnerThreads[1].OwnerCount) - - -static gboolean PERESOURE_validate(PERESOURCE Resource) -{ - g_return_val_if_fail(Resource!=NULL,FALSE); - - g_return_val_if_fail(Resource->ActiveCount - ==ERESOURCE_OWNING_COUNT_SHARED(Resource)+ERESOURCE_OWNING_COUNT_EXCLUSIVE(Resource),FALSE); - - return TRUE; -} - - -/** - * ExAcquireResourceExclusiveLite: - * @Resource: Resource to acquire for exclusive access. - * %NULL value is forbidden. - * @Wait: %TRUE if the caller may wait to acquire @Resource. - * - * Acquires a resource exclusively for the calling thread. - * - * Returns: %TRUE if the resource was acquired. - * libcaptive always returns %TRUE. - */ -BOOLEAN ExAcquireResourceExclusiveLite(PERESOURCE Resource,BOOLEAN Wait) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),FALSE); - - Resource->ActiveCount++; - ERESOURCE_OWNING_COUNT_EXCLUSIVE(Resource)++; - - g_assert(PERESOURE_validate(Resource)); - return TRUE; -} - - -/** - * ExAcquireResourceSharedLite: - * @Resource: Resource to acquire. - * %NULL value is forbidden. - * @Wait: %TRUE if the caller may wait to acquire @Resource. - * - * Shared acquire of resource for the calling thread. - * - * Returns: %TRUE if the resource was acquired. - * libcaptive always returns %TRUE. - */ -BOOLEAN ExAcquireResourceSharedLite(PERESOURCE Resource,BOOLEAN Wait) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),FALSE); - - Resource->ActiveCount++; - ERESOURCE_OWNING_COUNT_SHARED(Resource)++; - - g_assert(PERESOURE_validate(Resource)); - return TRUE; -} - - -/** - * ExConvertExclusiveToSharedLite: - * @Resource: Resource to convert access mode. - * %NULL value is forbidden. - * - * Converts a given resource from acquired for exclusive access to being - * acquired for shared access. - * - * You must already have exclusive access to @Resource before the call. - */ -VOID ExConvertExclusiveToSharedLite(PERESOURCE Resource) -{ - g_return_if_fail(PERESOURE_validate(Resource)); - g_return_if_fail(ERESOURCE_OWNING_COUNT_EXCLUSIVE(Resource)>0); - - ERESOURCE_OWNING_COUNT_EXCLUSIVE(Resource)--; - ERESOURCE_OWNING_COUNT_SHARED(Resource)++; - - g_assert(PERESOURE_validate(Resource)); -} - - -/** - * ExAcquireSharedStarveExclusive: - * @Resource: Resource to acquire for shared access. - * %NULL value is forbidden. - * @Wait: %TRUE if the caller should wait to acquire @Resource. - * - * Acquires a given resource for shared access. Current thread has priority - * over any threads currently wating for exclusive access to this @Resource. - * - * libcaptive has the same implementation as ExAcquireResourceSharedLite(). - * - * Returns: %TRUE if the resource was acquired. - * libcaptive always returns %TRUE. - */ -BOOLEAN ExAcquireSharedStarveExclusive(PERESOURCE Resource,BOOLEAN Wait) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),FALSE); - - return ExAcquireResourceSharedLite(Resource,Wait); -} - - -/** - * ExAcquireSharedWaitForExclusive: - * @Resource: Resource to acquire for shared access. - * %NULL value is forbidden. - * @Wait: %TRUE if the caller should wait to acquire @Resource. - * - * Acquires a given resource for shared access. Any threads currently wating - * for exclusive access to this @Resource have priority over the current - * thread. - * - * libcaptive has the same implementation as ExAcquireResourceSharedLite(). - * - * Returns: %TRUE if the resource was acquired. - * libcaptive always returns %TRUE. - */ -BOOLEAN ExAcquireSharedWaitForExclusive(PERESOURCE Resource,BOOLEAN Wait) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),FALSE); - - return ExAcquireResourceSharedLite(Resource,Wait); -} - - -/** - * ExReleaseResourceForThreadLite: - * @Resource: Resource to release. - * %NULL value is forbidden. - * @ResourceThreadId: Thread which currently owns @Resource. - * %NULL value is forbidden. - * Value ExGetCurrentResourceThread() required by libcaptive. - * - * Function releases @Resource. @ResourceThreadId must be either exclusive or - * shared owner of @Resource. - * FIXME: W32 undocumented: Ownership counter is decremented by 1; - * @ResourceThreadId may still own @Resource after this function finishes. - * FIXME: W32 undocumented: It is expected shared ownership should be released first. - * ntfs.sys of NT-5.1sp1 behaviour: Init,AcqExcl,AcqShared,Rel,expectExcl. - * Maybe acquire ordering also makes sense? - */ -VOID ExReleaseResourceForThreadLite(PERESOURCE Resource,ERESOURCE_THREAD ResourceThreadId) -{ - g_return_if_fail(PERESOURE_validate(Resource)); - g_return_if_fail(ResourceThreadId==ExGetCurrentResourceThread()); - g_return_if_fail(Resource->ActiveCount>0); - - /**/ if (ERESOURCE_OWNING_COUNT_SHARED(Resource)>0) - ERESOURCE_OWNING_COUNT_SHARED(Resource)--; - else if (ERESOURCE_OWNING_COUNT_EXCLUSIVE(Resource)>0) - ERESOURCE_OWNING_COUNT_EXCLUSIVE(Resource)--; - else g_assert_not_reached(); - - Resource->ActiveCount--; - - g_assert(PERESOURE_validate(Resource)); -} - - -/** - * ExReleaseResourceForThreadLite: - * @Resource: Resource to release. - * %NULL value is forbidden. - * - * Function releases @Resource. Current thread must be either exclusive or - * shared owner of @Resource. - * FIXME: W32 undocumented: Ownership counter is decremented by 1; - * Current thread may still own @Resource after this function finishes. - * FIXME: W32 undocumented: It is expected exclusive ownership should be released first. - */ -VOID ExReleaseResourceLite(PERESOURCE Resource) -{ - g_return_if_fail(PERESOURE_validate(Resource)); - - return ExReleaseResourceForThreadLite(Resource,ExGetCurrentResourceThread()); -} - - -/** - * ExGetExclusiveWaiterCount: - * @Resource: Resource to query. - * %NULL value is forbidden. - * - * Reports the number of waiters for exclusive access. - * - * Returns: Number of waiters for exclusive access. - * This function always returns 0 by libcaptive. - */ -ULONG ExGetExclusiveWaiterCount(PERESOURCE Resource) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),0); - - return 0; -} - - -/** - * ExGetSharedWaiterCount: - * @Resource: Resource to query. - * %NULL value is forbidden. - * - * Reports the number of currently pending waiters for shared access to - * @Resource. - * - * Returns: Number of waiters for shared access. - * This function always returns 0 by libcaptive. - */ -ULONG ExGetSharedWaiterCount(PERESOURCE Resource) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),0); - - return 0; -} - - -/* - * ExIsResourceAcquiredExclusiveLite: - * @Resource: Resource to query. - * %NULL value is forbidden. - * - * Query if the calling thread owns exclusive access to @Resource. - * - * Returns: %TRUE if the caller has exclusive access to @Resource, - */ -BOOLEAN ExIsResourceAcquiredExclusiveLite(PERESOURCE Resource) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),FALSE); - - return ERESOURCE_OWNING_COUNT_EXCLUSIVE(Resource)>0; -} - - -/* - * ExIsResourceAcquiredSharedLite: - * @Resource: Resource to query. - * %NULL value is forbidden. - * - * Query if the calling thread owns shared access to @Resource. - * Exclusive access is considered equivalent to shared access in this case. - * - * Returns: Count how many times the caller owns @Resource for any access, - * Value 0 is returned if the resource is not owned at all. - */ -USHORT ExIsResourceAcquiredSharedLite(PERESOURCE Resource) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),0); - - g_assert(Resource->ActiveCount==(USHORT)Resource->ActiveCount); - return Resource->ActiveCount; -} - - -/** - * ExInitializeResourceLite: - * @Resource: Memory block of size #PERESOURCE to initialize. - * %NULL value is forbidden. - * - * Initializes fields of #PERESOURCE structure. - * - * Returns: %STATUS_SUCCESS if the resource was initialized successfully. - * libcaptive always returns %STATUS_SUCCESS. - */ -NTSTATUS ExInitializeResourceLite(PERESOURCE Resource) -{ - g_return_val_if_fail(Resource!=NULL,STATUS_INVALID_PARAMETER); - - CAPTIVE_MEMZERO(Resource); - KeInitializeSpinLock(&Resource->SpinLock); - - g_assert(PERESOURE_validate(Resource)); - return STATUS_SUCCESS; -} - - -/* - * ExReinitializeResourceLite: - * @Resource: Resource to reinitialize sized as #ERESOURCE. - * %NULL value is forbidden. - * - * Reinitialize data fields of @Resource. @Resource must be already initialized - * by ExInitializeResourceLite(). Its state is lost and it becomes a fresh new - * #ERESOURCED without any its owners. - */ -VOID ExReinitializeResourceLite(PERESOURCE Resource) -{ - g_return_if_fail(PERESOURE_validate(Resource)); - - ExDeleteResourceLite(Resource); /* errors ignored */ - ExInitializeResourceLite(Resource); /* errors ignored */ -} - - -/** - * ExDeleteResourceLite: - * @Resource: Resource to delete. - * %NULL value is forbidden. - * - * Deletes any resources allocated for @Resource. Memory of #ERESOURCE pointer - * directly by @Resource is not freed - its storage belongs to the caller. - * - * This function is a NOP for libcaptive. - * - * Returns: %STATUS_SUCCESS if the resource was successfully deleted. - * libcaptive always returns %STATUS_SUCCESS. - */ -NTSTATUS ExDeleteResourceLite(PERESOURCE Resource) -{ - g_return_val_if_fail(PERESOURE_validate(Resource),STATUS_INVALID_PARAMETER); - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/ex/time.c b/src/libcaptive/ex/time.c deleted file mode 100644 index 8af2008..0000000 --- a/src/libcaptive/ex/time.c +++ /dev/null @@ -1,64 +0,0 @@ -/* $Id$ - * reactos time handling functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/exfuncs.h" /* self */ -#include -#include - - -/** - * ExLocalTimeToSystemTime: - * @LocalTime: Time value to convert. - * %NULL value is forbidden. - * @SystemTime: Returns the converted @LocalTime. - * %NULL value is forbidden. - * - * Converts @LocalTime from the current local-timezone to the internation GMT zone - * for @SystemTime. - */ -VOID ExLocalTimeToSystemTime(PLARGE_INTEGER LocalTime,PLARGE_INTEGER SystemTime) -{ - g_return_if_fail(LocalTime!=NULL); - g_return_if_fail(SystemTime!=NULL); - - tzset(); - SystemTime->QuadPart=LocalTime->QuadPart + timezone*G_GINT64_CONSTANT(10000000); -} - - -/** - * ExSystemTimeToLocalTime: - * @SystemTime: Time value to convert. - * %NULL value is forbidden. - * @LocalTime: Returns the converted @SystemTime. - * %NULL value is forbidden. - * - * Converts @SystemTime from the internation GMT zone to the current local-timezone - * for @LocalTime. - */ -VOID ExSystemTimeToLocalTime(PLARGE_INTEGER SystemTime,PLARGE_INTEGER LocalTime) -{ - g_return_if_fail(SystemTime!=NULL); - g_return_if_fail(LocalTime!=NULL); - - tzset(); - LocalTime->QuadPart=SystemTime->QuadPart - timezone*G_GINT64_CONSTANT(10000000); -} diff --git a/src/libcaptive/ex/work.c b/src/libcaptive/ex/work.c deleted file mode 100644 index 3094f61..0000000 --- a/src/libcaptive/ex/work.c +++ /dev/null @@ -1,85 +0,0 @@ -/* $Id$ - * reactos WORK_QUEUE_ITEM handling by libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/exfuncs.h" /* self */ -#include -#include "reactos/ddk/extypes.h" /* for WORK_QUEUE_ITEM */ -#include -#include "captive/macros.h" - - -static gboolean ExQueueWorkItem_idlefunc(WORK_QUEUE_ITEM *WorkItem_copy /* data */) -{ - g_return_val_if_fail(WorkItem_copy!=NULL,FALSE); /* false=>remove-me */ - g_return_val_if_fail(WorkItem_copy->WorkerRoutine!=NULL,FALSE); /* false=>remove-me */ - - /* typedef VOID STDCALL_FUNC (*PWORKER_THREAD_ROUTINE)(PVOID Parameter); */ - - captive_stdcall_call_4((CaptiveStdCallFunc4)WorkItem_copy->WorkerRoutine, - WorkItem_copy->Parameter); /* Parameter */ - g_free(WorkItem_copy); - - return FALSE; /* remove-me */ -} - -/** - * ExQueueWorkItem: - * @WorkItem: Initialized structure of #WORK_QUEUE_ITEM to enqueue. - * %NULL value is forbidden. - * @QueueType: Queue priority. - * - * Inserts a work item in a queue for one of the system worker threads to - * process. It will be processed through g_idle_add_full() with priority - * range %G_PRIORITY_DEFAULT+10 ... %G_PRIORITY_DEFAULT+30. - * - * @WorkItem memory address space can be freed even before its function invocation - * (required by ntfs.sys). - */ -VOID ExQueueWorkItem(PWORK_QUEUE_ITEM WorkItem,WORK_QUEUE_TYPE QueueType) -{ -gint priority; -WORK_QUEUE_ITEM *WorkItem_copy; - - g_return_if_fail(WorkItem!=NULL); - g_return_if_fail(WorkItem->WorkerRoutine!=NULL); - - switch (QueueType) { - case DelayedWorkQueue: - priority=G_PRIORITY_DEFAULT+30; /* positive towards G_PRIORITY_HIGH_IDLE */ - break; - case CriticalWorkQueue: - priority=G_PRIORITY_DEFAULT+20; /* positive towards G_PRIORITY_HIGH_IDLE */ - break; - case HyperCriticalWorkQueue: - priority=G_PRIORITY_DEFAULT+10; /* positive towards G_PRIORITY_HIGH_IDLE */ - break; - default: - g_assert_not_reached(); - priority=G_PRIORITY_DEFAULT; - } - - captive_memdup(WorkItem_copy,WorkItem); - g_idle_add_full( - priority, /* priority */ - (GSourceFunc)ExQueueWorkItem_idlefunc, /* function */ - WorkItem_copy, /* data */ - NULL); /* notify */ -} diff --git a/src/libcaptive/fs/Makefile.am b/src/libcaptive/fs/Makefile.am deleted file mode 100644 index 9e033bf..0000000 --- a/src/libcaptive/fs/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# $Id$ -# automake source for the reactos's fs/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libfs.la -libfs_la_SOURCES= \ - filelock.c \ - name_pass.c \ - notify.c \ - oplock.c \ - stream.c \ - tunnel.c \ - util.c diff --git a/src/libcaptive/fs/dbcsname.c b/src/libcaptive/fs/dbcsname.c deleted file mode 100644 index 3e268f9..0000000 --- a/src/libcaptive/fs/dbcsname.c +++ /dev/null @@ -1,90 +0,0 @@ -/* $Id$ - * reactos filesystem name strings functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/fsfuncs.h" /* self */ -#include -#include "captive/unicode.h" - - -/** - * FsRtlIsFatDbcsLegal: - * @DbcsName_nonconst: #ANSI_STRING to check. - * Yes, the string is passed by value, not by reference! - * @WildCardsPermissible: Allow '*' or '?' characters? - * @PathNamePermissible: Allow '\' for pathname checking? Otherwise plain filename is required. - * @LeadingBackslashPermissible: Allow first directory component empty? - * - * Characters 0x00..0x1F, '"', '/', ':', '|', '+', ',', ';', '=', '[' and ']' are always forbidden anywhere. - * Characters '*' and '?' are permitted if @WildCardsPermissible. - * Basename length must be >=1 && <=8. Extension length must be >=0 && <=3. - * Basename or extension must not contain trailing space (' '). - * Only one '.' is allowed inside one filename component - to split filename to basename and extension. - * - * Returns: %TRUE if @DbcsName_nonconst is a valid pathname according to the constaints. - */ -BOOLEAN FsRtlIsFatDbcsLegal(IN ANSI_STRING DbcsName_nonconst, - IN BOOLEAN WildCardsPermissible,IN BOOLEAN PathNamePermissible,IN BOOLEAN LeadingBackslashPermissible) -{ -const ANSI_STRING *cDbcsName; -gboolean gotdot=FALSE; -gint len=0,i; - - g_return_val_if_fail(captive_validate_AnsiString(&DbcsName_nonconst),FALSE); - g_return_val_if_fail(PathNamePermissible==FALSE,FALSE); /* FIXME: 'PathNamePermissible' not yet implemented */ - - cDbcsName=&DbcsName_nonconst; - for (i=0;iLength;i++) { -char c=cDbcsName->Buffer[i]; - - if ((c>=0x00 && c<=0x1F) - || c=='"' || c=='/' || c==':' || c=='|' || c=='+' - || c==',' || c==';' || c=='=' || c=='[' || c==']') /* always invalid */ - return FALSE; - if (!PathNamePermissible && c=='\\') - return FALSE; - if (!LeadingBackslashPermissible && i==0 && c=='\\') - return FALSE; - if (!WildCardsPermissible && (c=='*' || c=='?')) - return FALSE; - - if (c!='.') { - len++; - continue; - } - /* c=='.' */ - if (gotdot) - return FALSE; - gotdot=TRUE; - if (len<1 || len>8) - return FALSE; - len=0; - if (' '==cDbcsName->Buffer[i-1]) - return FALSE; - } - if (!cDbcsName->Length) - return FALSE; - if (' '==cDbcsName->Buffer[cDbcsName->Length-1]) - return FALSE; - if (len>(!gotdot ? 8 : 3)) - return FALSE; - - return TRUE; -} diff --git a/src/libcaptive/fs/filelock.c b/src/libcaptive/fs/filelock.c deleted file mode 100644 index 4134e58..0000000 --- a/src/libcaptive/fs/filelock.c +++ /dev/null @@ -1,81 +0,0 @@ -/* $Id$ - * reactos file locking functions emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/fsfuncs.h" /* self */ -#include -#include "reactos/ntos/types.h" /* for VOID */ -#include "reactos/ddk/status.h" /* for STATUS_SUCCESS */ - - -VOID FsRtlInitializeFileLock(IN PFILE_LOCK FileLock, - IN PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine OPTIONAL,IN PUNLOCK_ROUTINE UnlockRoutine OPTIONAL) -{ - g_return_if_fail(FileLock!=NULL); - - FileLock->CompleteLockIrpRoutine=CompleteLockIrpRoutine; - FileLock->UnlockRoutine=UnlockRoutine; - - /* FIXME: NOT IMPLEMENTED YET */ -} - - -VOID FsRtlUninitializeFileLock(IN PFILE_LOCK FileLock) -{ - g_return_if_fail(FileLock!=NULL); - - /* FIXME: NOT IMPLEMENTED YET */ -} - - -NTSTATUS FsRtlFastUnlockAll(IN PFILE_LOCK FileLock,IN PFILE_OBJECT FileObject,IN PEPROCESS Process,IN PVOID Context OPTIONAL) -{ - g_return_val_if_fail(FileLock!=NULL,STATUS_INVALID_PARAMETER); - - /* FIXME: NOT IMPLEMENTED YET */ - - return STATUS_SUCCESS; -} - - -BOOLEAN FsRtlCheckLockForReadAccess(IN PFILE_LOCK FileLock,IN PIRP Irp) -{ - g_return_val_if_fail(FileLock!=NULL,FALSE); /* FALSE means 'no access */ - g_return_val_if_fail(Irp!=NULL,FALSE); /* FALSE means 'no access */ - - return TRUE; /* permit access */ -} - - -BOOLEAN FsRtlCheckLockForWriteAccess(IN PFILE_LOCK FileLock,IN PIRP Irp) -{ - g_return_val_if_fail(FileLock!=NULL,FALSE); /* FALSE means 'no access */ - g_return_val_if_fail(Irp!=NULL,FALSE); /* FALSE means 'no access */ - - return TRUE; /* permit access */ -} - - -PFILE_LOCK_INFO FsRtlGetNextFileLock(IN PFILE_LOCK FileLock,IN BOOLEAN Restart) -{ - g_return_val_if_fail(FileLock!=NULL,FALSE); /* FALSE means 'no access */ - - return NULL; /* no known locked byte range */ -} diff --git a/src/libcaptive/fs/mcb.c b/src/libcaptive/fs/mcb.c deleted file mode 100644 index 62b5246..0000000 --- a/src/libcaptive/fs/mcb.c +++ /dev/null @@ -1,814 +0,0 @@ -/* $Id$ - * reactos MCB (map control block) functions emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/fsfuncs.h" /* self */ -#include -#include "reactos/ntos/types.h" /* for VOID */ -#include -#include -#include "reactos/ddk/exfuncs.h" /* for ExInitializeFastMutex() */ -#include "captive/macros.h" - - -/* We use only real 'mapping' runs; we do not store 'holes' to our GTree. - */ -struct run { - LONGLONG Vbn_start; - LONGLONG Vbn_end; /* Vbn_start+SectorCount; that means +1 after the last sector */ - LONGLONG Lbn_start; /* Lbn of 'Vbn_start' */ - }; - -struct Mcb_priv { - GTree *gtree; /* map (struct run *)->(struct run *) */ - }; - -static const struct run *run_compare_func_last_a_run; -static const struct run *run_compare_func_last_b_run; -static const struct run *run_compare_func_minus_a_run; /* last run where we returned -1 */ -static const struct run *run_compare_func_minus_b_run; -static const struct run *run_compare_func_plus_a_run; /* last run where we returned +1 */ -static const struct run *run_compare_func_plus_b_run; - -static gint run_compare_func(const struct run *a_run,const struct run *b_run,gpointer user_data /* unused */) -{ -gint r; - - g_return_val_if_fail(a_run!=NULL,0); - g_return_val_if_fail(a_run->Vbn_end>a_run->Vbn_start,0); - g_return_val_if_fail(b_run!=NULL,0); - g_return_val_if_fail(b_run->Vbn_end>b_run->Vbn_start,0); - - run_compare_func_last_a_run=a_run; - run_compare_func_last_b_run=b_run; - - if (1 - && !(r=(a_run->Vbn_start>b_run->Vbn_start)-(a_run->Vbn_startVbn_start)) - && !(r=(a_run->Vbn_end >b_run->Vbn_end )-(a_run->Vbn_end Vbn_end ))) - r=0; - - if (r<0) { - run_compare_func_minus_a_run=a_run; - run_compare_func_minus_b_run=b_run; - } - else if (r>0) { - run_compare_func_plus_a_run=a_run; - run_compare_func_plus_b_run=b_run; - } - - return r; -} - -static void run_destroy_func(struct run *run) -{ - g_return_if_fail(run!=NULL); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: run->Vbn_start=%lld,run->Vbn_end=%lld,run->Lbn_start=%lld", - G_STRLOC,run->Vbn_start,run->Vbn_end,run->Lbn_start); - - g_free(run); -} - -/* map (LARGE_MCB *)->(struct Mcb_priv *) */ -static GHashTable *Mcb_hash; - -static void Mcb_hash_init(void) -{ - if (Mcb_hash) - return; - Mcb_hash=g_hash_table_new( - g_direct_hash, /* key_compare_func */ - g_direct_equal); /* key_compare_data */ -} - - -/** - * FsRtlInitializeLargeMcb: - * @Mcb: Allocated memory to be initialized as #PLARGE_MCB. - * %NULL value is forbidden. - * @PoolType: Memory type to use for the items. Ignored by libcaptive. - * - * You must use this function to be able to pass @Mcb to any other - * FsRtl*LargeMcb*() function. - */ -VOID FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb,IN POOL_TYPE PoolType) -{ -struct Mcb_priv *Mcb_priv; - - g_return_if_fail(Mcb!=NULL); - - Mcb_hash_init(); - g_return_if_fail(NULL==g_hash_table_lookup(Mcb_hash,Mcb)); - - ExInitializeFastMutex(&Mcb->FastMutex); - Mcb->MaximumPairCount=0; - Mcb->PairCount=0; - Mcb->PoolType=PoolType; - Mcb->Mapping=NULL; - - captive_new(Mcb_priv); - Mcb_priv->gtree=g_tree_new_full( - (GCompareDataFunc)run_compare_func, /* key_compare_func */ - NULL, /* key_compare_data */ - (GDestroyNotify)run_destroy_func, /* key_destroy_func */ - NULL); /* value_destroy_func */ - - g_hash_table_insert(Mcb_hash, - Mcb, /* key */ - Mcb_priv); /* value */ -} - - -/** - * FsRtlUninitializeLargeMcb: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * - * Frees all the resources associated with @Mcb. - * You must not pass this pointer to any FsRtl*LargeMcb*() function afterwards. - */ -VOID FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb) -{ -struct Mcb_priv *Mcb_priv; -gboolean errbool; - - g_return_if_fail(Mcb!=NULL); - - Mcb_hash_init(); - Mcb_priv=g_hash_table_lookup(Mcb_hash,Mcb); - g_return_if_fail(Mcb_priv!=NULL); - - errbool=g_hash_table_remove(Mcb_hash,Mcb); - g_assert(errbool==TRUE); - g_tree_destroy(Mcb_priv->gtree); - g_free(Mcb_priv); -} - - -static gint run_intersect_compare_func(const struct run *haystack_run,const struct run *needle_run) -{ -gint r; -struct run common_run; - - g_return_val_if_fail(haystack_run!=NULL,0); - g_return_val_if_fail(haystack_run->Vbn_end>haystack_run->Vbn_start,0); - g_return_val_if_fail(needle_run!=NULL,0); - g_return_val_if_fail(needle_run->Vbn_end>needle_run->Vbn_start,0); - - common_run.Vbn_start=MAX(haystack_run->Vbn_start,needle_run->Vbn_start); - common_run.Vbn_end =MIN(haystack_run->Vbn_end ,needle_run->Vbn_end ); - - if (common_run.Vbn_end>common_run.Vbn_start) - return 0; - r=run_compare_func(needle_run,haystack_run, - NULL); /* user_data; unused */ - g_assert(r!=0); /* otherwise we would hit it by 'common_run' */ - return r; -} - - -/** - * FsRtlRemoveLargeMcbEntry: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * @Vbn: Starting virtual block number to specify the range to delete. - * @SectorCount: Length of the range to delete. - * Value less or equal to %0 is forbidden; FIXME: Is the reject of %0 W32 compliant? - * - * Deletes any possible @Mcb mappings in the given range @Vbn ... @Vbn+@SectorCount-1. - * This call has no problems if no mappings exist there yet. - */ -VOID FsRtlRemoveLargeMcbEntry(IN PLARGE_MCB Mcb,IN LONGLONG Vbn,IN LONGLONG SectorCount) -{ -struct Mcb_priv *Mcb_priv; -struct run needle_run,*haystack_run; - - g_return_if_fail(Mcb!=NULL); - g_return_if_fail(Vbn>=0); - g_return_if_fail(SectorCount>0); - /* FIXME: We are unable to delete the absolutely last sector G_MAXINT64 by this implementation! */ - g_return_if_fail(Vbn+SectorCount>Vbn); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Mcb=%p,Vbn=%lld,SectorCount=%lld",G_STRLOC,Mcb,Vbn,SectorCount); - - Mcb_hash_init(); - Mcb_priv=g_hash_table_lookup(Mcb_hash,Mcb); - g_return_if_fail(Mcb_priv!=NULL); - - needle_run.Vbn_start=Vbn; - needle_run.Vbn_end=Vbn+SectorCount; - - /* adjust/destroy all intersecting ranges */ - while ((haystack_run=g_tree_search(Mcb_priv->gtree,(GCompareFunc)run_intersect_compare_func,&needle_run))) { - /**/ if (haystack_run->Vbn_startVbn_end >needle_run.Vbn_start); - haystack_run->Vbn_end =needle_run.Vbn_start; - } - else if (haystack_run->Vbn_end >needle_run.Vbn_end ) { - g_assert(haystack_run->Vbn_startVbn_start=needle_run.Vbn_end; - } - else { - g_assert(needle_run.Vbn_start>=haystack_run->Vbn_start); - g_assert(needle_run.Vbn_end <=haystack_run->Vbn_end ); - g_tree_remove(Mcb_priv->gtree,haystack_run); - } - } -} - - -/** - * FsRtlAddLargeMcbEntry: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * @Vbn: Starting virtual block number of the wished range. - * @Lbn: Starting logical block number of the wished range. - * @SectorCount: Length of the wished range. - * Value less or equal to %0 is forbidden; FIXME: Is the reject of %0 W32 compliant? - * - * Adds the specified range @Vbn ... @Vbn+@SectorCount-1 to @Mcb. - * Any mappings previously in this range are deleted first. - * - * Returns: %TRUE if successful. - */ -BOOLEAN FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb,IN LONGLONG Vbn,IN LONGLONG Lbn,IN LONGLONG SectorCount) -{ -struct Mcb_priv *Mcb_priv; -struct run *insert_run,current_run,needle_run,*lower_run,*higher_run; - - g_return_val_if_fail(Mcb!=NULL,FALSE); - g_return_val_if_fail(Vbn>=0,FALSE); - g_return_val_if_fail(SectorCount>0,FALSE); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Mcb=%p,Vbn=%lld,Lbn=%lld,SectorCount=%lld",G_STRLOC,Mcb,Vbn,Lbn,SectorCount); - - Mcb_hash_init(); - Mcb_priv=g_hash_table_lookup(Mcb_hash,Mcb); - g_return_val_if_fail(Mcb_priv!=NULL,FALSE); - - /* clean any possible previous entries in our range */ - FsRtlRemoveLargeMcbEntry(Mcb,Vbn,SectorCount); - - /* initially we think we will be inserted as a separate run */ - current_run.Vbn_start=Vbn; - current_run.Vbn_end =Vbn+SectorCount; - current_run.Lbn_start=Lbn; - - /* optionally merge with lower run */ - needle_run.Vbn_start=current_run.Vbn_start-1; - needle_run.Vbn_end =needle_run.Vbn_start+1; - if ((lower_run=g_tree_search(Mcb_priv->gtree,(GCompareFunc)run_intersect_compare_func,&needle_run))) { - g_assert(lower_run->Vbn_end==current_run.Vbn_start); - current_run.Vbn_start=lower_run->Vbn_start; - g_tree_remove(Mcb_priv->gtree,lower_run); - } - - /* optionally merge with higher run */ - needle_run.Vbn_start=current_run.Vbn_end; - needle_run.Vbn_end =needle_run.Vbn_start+1; - if ((higher_run=g_tree_search(Mcb_priv->gtree,(GCompareFunc)run_intersect_compare_func,&needle_run))) { - g_assert(higher_run->Vbn_start==current_run.Vbn_end); - current_run.Vbn_end=higher_run->Vbn_end; - g_tree_remove(Mcb_priv->gtree,higher_run); - } - - /* finally insert the resulting run */ - captive_new(insert_run); - *insert_run=current_run; - g_tree_insert(Mcb_priv->gtree,insert_run,insert_run); - - return TRUE; /* success */ -} - - -static const struct run static_run_below_0={ - Vbn_start:-1, /* ignored */ - Vbn_end: 0, - Lbn_start:-1, /* ignored */ - }; - - -struct FsRtlGetNextLargeMcbEntry_input { - gboolean first; - ULONG RunIndex_remaining; - const struct run *run_found; - const struct run *run_found_lower,*run_found_higher; - }; - -static gboolean FsRtlGetNextLargeMcbEntry_traverse_func - (struct run *run /* _key */,struct run *run_value,struct FsRtlGetNextLargeMcbEntry_input *input) -{ - g_return_val_if_fail(run!=NULL,TRUE); - g_return_val_if_fail(run_value!=NULL,TRUE); - g_return_val_if_fail(run==run_value,TRUE); - g_return_val_if_fail(input!=NULL,TRUE); - - if (input->first) { - /* Take care when we must emulate missing 'hole' run at start of our run list. */ - if (run->Vbn_start>0) { - if (input->RunIndex_remaining==0) { - input->run_found_lower=&static_run_below_0; - input->run_found_higher=run; - return TRUE; /* stop the traversal */ - } - /* If someone wants RunIndex #1 we are already on it. */ - input->RunIndex_remaining--; - } - input->first=FALSE; - } - - if (input->RunIndex_remaining>0) { - /* FIXME: performance: non-linear direct seek to the requested RunIndex */ - input->RunIndex_remaining--; - if (input->RunIndex_remaining==0) - input->run_found_lower=run; - else - input->RunIndex_remaining--; - return FALSE; /* continue the traversal */ - } - - if (input->run_found_lower) - input->run_found_higher=run; - else - input->run_found=run; - return TRUE; /* stop the traversal */ -} - - -/** - * FsRtlGetNextLargeMcbEntry: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * @RunIndex: Requested range index to retrieve. - * @Vbn: Returns the starting virtual block number of the wished range. - * %NULL pointer is forbidden. - * @Lbn: Returns the starting logical block number of the wished range (or -1 if it is a hole). - * %NULL pointer is forbidden. - * @SectorCount: Returns the length of the wished range. - * %NULL pointer is forbidden. - * Value less or equal to %0 is forbidden; FIXME: Is the reject of %0 W32 compliant? - * - * Retrieves the parameters of the specified run with index @RunIndex. - * - * Mapping %0 always starts at virtual block %0, either as 'hole' or as 'real' mapping. - * libcaptive does not store 'hole' information to its #GTree. - * Last run is always a 'real' run. 'hole' runs appear as mapping to constant @Lbn value %-1. - * - * Returns: %TRUE if successful. - */ -BOOLEAN FsRtlGetNextLargeMcbEntry - (IN PLARGE_MCB Mcb,IN ULONG RunIndex,OUT PLONGLONG Vbn,OUT PLONGLONG Lbn,OUT PLONGLONG SectorCount) -{ -struct Mcb_priv *Mcb_priv; -struct FsRtlGetNextLargeMcbEntry_input input; - - g_return_val_if_fail(Mcb!=NULL,FALSE); - g_return_val_if_fail(Vbn!=NULL,FALSE); - g_return_val_if_fail(Lbn!=NULL,FALSE); - g_return_val_if_fail(SectorCount!=NULL,FALSE); - - Mcb_hash_init(); - Mcb_priv=g_hash_table_lookup(Mcb_hash,Mcb); - g_return_val_if_fail(Mcb_priv!=NULL,FALSE); - - input.first=TRUE; - input.RunIndex_remaining=RunIndex; - input.run_found=NULL; - input.run_found_lower=NULL; - input.run_found_higher=NULL; - g_tree_foreach(Mcb_priv->gtree,(GTraverseFunc)FsRtlGetNextLargeMcbEntry_traverse_func,&input); - - if (input.run_found) { - g_assert(input.run_found_lower ==NULL); - g_assert(input.run_found_higher==NULL); - *Vbn =input.run_found->Vbn_start; - *Lbn =input.run_found->Lbn_start; - *SectorCount=input.run_found->Vbn_end-input.run_found->Vbn_start; - return TRUE; - } - - if (input.run_found_lower) { - g_assert(input.run_found_higher!=NULL); - *Vbn =input.run_found_lower->Vbn_end; - *Lbn =-1; - *SectorCount=input.run_found_higher->Vbn_start-input.run_found_lower->Vbn_end; - return TRUE; - } - - g_assert(input.run_found_higher==NULL); - return FALSE; -} - - -struct FsRtlLookupLargeMcbEntry_input { - gboolean first; - LONGLONG Vbn; - ULONG RunIndex; - const struct run *run_found; - const struct run *run_found_lower,*run_found_higher; - }; - -static gboolean FsRtlLookupLargeMcbEntry_traverse_func - (struct run *run /* _key */,struct run *run_value,struct FsRtlLookupLargeMcbEntry_input *input) -{ - g_return_val_if_fail(run!=NULL,TRUE); - g_return_val_if_fail(run_value!=NULL,TRUE); - g_return_val_if_fail(run==run_value,TRUE); - g_return_val_if_fail(input!=NULL,TRUE); - - if (input->first) { - /* Take care when we must emulate missing 'hole' run at start of our run list. */ - if (run->Vbn_start>0) { - input->RunIndex+=1; - input->run_found_lower=&static_run_below_0; - } - input->first=FALSE; - } - - if (run->Vbn_start<=input->Vbn && input->VbnVbn_end) { - input->run_found=run; - input->run_found_lower=NULL; - return TRUE; /* stop the traversal; hit */ - } - if (run->Vbn_end<=input->Vbn) { - input->run_found_lower=run; - input->RunIndex+=2; - return FALSE; /* continue the traversal; not yet crossed by the run */ - } - if (input->VbnVbn_start) { - input->run_found_higher=run; - input->RunIndex+=1; - return TRUE; /* stop the traversal; the run skipped us */ - } - g_assert_not_reached(); - return TRUE; /* stop the traversal */ -} - - -/** - * FsRtlLookupLargeMcbEntry: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * @Vbn: Starting virtual block number of the requested sector. - * @Lbn: Returns the logical block number corresponding to @Vbn (or -1 if it is a hole). - * %NULL value is permitted. - * @SectorCountFromLbn: Returns the number of sectors after @Vbn in the mapping found. - * FIXME: 'after' means including current 'Lbn' or without it? - * %NULL value is permitted. - * @StartingLbn: Returns the first logical block number of the mapping found (or -1 if it is a hole). - * %NULL value is permitted. - * @SectorCountFromStartingLbn: Returns total length in blocks of the mapping found. - * %NULL value is permitted. - * @Index: Returns the range index of the mapping found. - * %NULL value is permitted. - * - * Retrieves the information about the requested virtual block number @Vbn - * and its mapping (either real 'mapping' or the 'hole'). - * - * Mapping %0 always starts at virtual block %0, either as 'hole' or as 'real' mapping. - * libcaptive does not store 'hole' information to its #GTree. - * Last run is always a 'real' run. 'hole' runs appear as mapping to constant @Lbn value %-1. - * - * Returns: %TRUE if successful. - */ -BOOLEAN FsRtlLookupLargeMcbEntry(IN PLARGE_MCB Mcb,IN LONGLONG Vbn, - OUT PLONGLONG Lbn OPTIONAL, - OUT PLONGLONG SectorCountFromLbn OPTIONAL, - OUT PLONGLONG StartingLbn OPTIONAL, - OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL, - OUT PULONG Index OPTIONAL) -{ -struct Mcb_priv *Mcb_priv; -struct FsRtlLookupLargeMcbEntry_input input; - - g_return_val_if_fail(Mcb!=NULL,FALSE); - g_return_val_if_fail(Vbn>=0,FALSE); - - Mcb_hash_init(); - Mcb_priv=g_hash_table_lookup(Mcb_hash,Mcb); - g_return_val_if_fail(Mcb_priv!=NULL,FALSE); - - input.first=TRUE; - input.Vbn=Vbn; - input.RunIndex=0; - input.run_found=NULL; - input.run_found_lower=NULL; - input.run_found_higher=NULL; - g_tree_foreach(Mcb_priv->gtree,(GTraverseFunc)FsRtlLookupLargeMcbEntry_traverse_func,&input); - - if (input.run_found) { /* hit the mapping */ - g_assert(input.run_found_lower ==NULL); - g_assert(input.run_found_higher==NULL); - if (Lbn) - *Lbn=input.run_found->Lbn_start+(Vbn-input.run_found->Vbn_start); - if (SectorCountFromLbn) /* FIXME: 'after' means including current 'Lbn' or without it? */ - *SectorCountFromLbn=input.run_found->Vbn_end-Vbn; - if (StartingLbn) - *StartingLbn=input.run_found->Lbn_start; - if (SectorCountFromStartingLbn) - *SectorCountFromStartingLbn=input.run_found->Vbn_end-input.run_found->Vbn_start; - if (Index) - *Index=input.RunIndex; - return TRUE; - } - - if (input.run_found_higher) { /* search for hole */ - g_assert(input.run_found_lower!=NULL); - if (Lbn) - *Lbn=-1; - if (SectorCountFromLbn) /* FIXME: 'after' means including current 'Lbn' or without it? */ - *SectorCountFromLbn=input.run_found_higher->Vbn_start-Vbn; - if (StartingLbn) - *StartingLbn=-1; - if (SectorCountFromStartingLbn) - *SectorCountFromStartingLbn=input.run_found_higher->Vbn_start-input.run_found_lower->Vbn_end; - if (Index) - *Index=input.RunIndex; - return TRUE; - } - - /* We may have some 'input.run_found_lower'. */ - return FALSE; -} - - -static BOOLEAN FsRtlLookupLastLargeMcbEntryAndIndex_internal - (IN PLARGE_MCB Mcb,OUT PLONGLONG Vbn,OUT PLONGLONG Lbn,OUT PULONG Index OPTIONAL) -{ -struct Mcb_priv *Mcb_priv; -const struct run needle_run_top={ - Vbn_start:G_MAXINT64-1, - Vbn_end:G_MAXINT64, - Lbn_start:-1, /* ignored*/ - }; -const struct run *found_run; - - g_return_val_if_fail(Mcb!=NULL,FALSE); - g_return_val_if_fail(Vbn!=NULL,FALSE); - g_return_val_if_fail(Lbn!=NULL,FALSE); - - Mcb_hash_init(); - Mcb_priv=g_hash_table_lookup(Mcb_hash,Mcb); - g_return_val_if_fail(Mcb_priv!=NULL,FALSE); - - run_compare_func_last_a_run=NULL; - run_compare_func_last_b_run=NULL; - found_run=g_tree_lookup(Mcb_priv->gtree,&needle_run_top); - g_assert(found_run==NULL); - - if (run_compare_func_last_a_run==NULL) { - g_assert(run_compare_func_last_b_run==NULL); - g_assert(g_tree_nnodes(Mcb_priv->gtree)==0); - - *Vbn=-1; - *Lbn=-1; - if (Index) - *Index=0; - return FALSE; - } - g_assert(run_compare_func_last_a_run!=&needle_run_top); - g_assert(run_compare_func_last_b_run==&needle_run_top); - - *Vbn=run_compare_func_last_a_run->Vbn_end-1; - *Lbn=run_compare_func_last_a_run->Lbn_start - +((run_compare_func_last_a_run->Vbn_end-1)-run_compare_func_last_a_run->Vbn_start); - if (Index) { -ULONG runs=FsRtlNumberOfRunsInLargeMcb(Mcb); - - g_assert(runs>0); /* There must be some runs if we found _something_. */ - *Index=runs-1; - } - return TRUE; -} - - -/** - * FsRtlLookupLastLargeMcbEntryAndIndex: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * @Vbn: Returns the virtual block number of the last mapped sector. - * %NULL pointer is forbidden. - * @Lbn: Returns the logical block number of the last mapped sector. - * %NULL pointer is forbidden. - * @Index: Returns the RunIndex of the last mapped sector. - * %NULL pointer is forbidden. - * - * Retrieves the mapping of the ever last sector mapped by @Mcb. - * FIXME: W32 doc says the returned @Lbn may get value %-1 but such 'hole' is not - * a real mapping - why not to return the previous real mapping instead? - * How can be some trailing 'hole's present? - * - * Returns: %TRUE if successful. %FALSE if @Mcb is empty. - */ -BOOLEAN FsRtlLookupLastLargeMcbEntryAndIndex - (IN PLARGE_MCB Mcb,OUT PLONGLONG Vbn,OUT PLONGLONG Lbn,OUT PULONG Index) -{ - g_return_val_if_fail(Mcb!=NULL,FALSE); - g_return_val_if_fail(Vbn!=NULL,FALSE); - g_return_val_if_fail(Lbn!=NULL,FALSE); - g_return_val_if_fail(Index!=NULL,FALSE); - - return FsRtlLookupLastLargeMcbEntryAndIndex_internal(Mcb,Vbn,Lbn,Index); -} - - -/** - * FsRtlLookupLastLargeMcbEntry: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * @Vbn: Returns the virtual block number of the last mapped sector. - * %NULL pointer is forbidden. - * @Lbn: Returns the logical block number of the last mapped sector. - * %NULL pointer is forbidden. - * - * Retrieves the mapping of the ever last sector mapped by @Mcb. - * FIXME: W32 doc says the returned @Lbn may get value %-1 but such 'hole' is not - * a real mapping - why not to return the previous real mapping instead? - * How can be some trailing 'hole's present? - * - * Returns: %TRUE if successful. %FALSE if @Mcb is empty. - */ -BOOLEAN FsRtlLookupLastLargeMcbEntry(IN PLARGE_MCB Mcb,OUT PLONGLONG Vbn,OUT PLONGLONG Lbn) -{ - g_return_val_if_fail(Mcb!=NULL,FALSE); - g_return_val_if_fail(Vbn!=NULL,FALSE); - g_return_val_if_fail(Lbn!=NULL,FALSE); - - return FsRtlLookupLastLargeMcbEntryAndIndex_internal(Mcb,Vbn,Lbn, - NULL); /* Index */ -} - - -/** - * FsRtlNumberOfRunsInLargeMcb: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * - * Counts the number of runs mapped by @Mcb. - * - * Mapping %0 always starts at virtual block %0, either as 'hole' or as 'real' mapping. - * libcaptive does not store 'hole' information to its #GTree. - * Last run is always a 'real' run. 'hole' runs appear as mapping to constant @Lbn value %-1. - * - * Returns: The sum of 'real' and 'hole' runs in @Mcb. - * Returns value %0 if @Mcb is empty. - * Returns odd number iff the mapping has 'real' virtual block %0. - */ -ULONG FsRtlNumberOfRunsInLargeMcb(IN PLARGE_MCB Mcb) -{ -struct Mcb_priv *Mcb_priv; -gint nodes; -LONGLONG Lbn_at_Vbn_0; - - g_return_val_if_fail(Mcb!=NULL,0); - - Mcb_hash_init(); - Mcb_priv=g_hash_table_lookup(Mcb_hash,Mcb); - g_return_val_if_fail(Mcb_priv!=NULL,0); - - nodes=g_tree_nnodes(Mcb_priv->gtree); - if (!nodes) - return 0; - - Lbn_at_Vbn_0=-1; - FsRtlLookupLargeMcbEntry(Mcb, - 0, /* Vbn */ - &Lbn_at_Vbn_0, /* Lbn */ - NULL,NULL,NULL,NULL); /* 4 output arguments - not interested in them */ - - /* Return the number of 'real' and 'hole' runs. - * If we do not have sector 0 as 'real' emulate a 'hole' there. - */ - return nodes*2 - (Lbn_at_Vbn_0!=-1 ? 1 : 0); /* include holes as runs */ -} - - -struct FsRtlSplitLargeMcb_input { - LONGLONG Vbn; - LONGLONG Amount; - struct Mcb_priv *Mcb_priv; - struct run *insert_lower_run; /* 'run' to insert after g_tree_foreach() finishes */ - }; - -static gboolean FsRtlSplitLargeMcb_traverse_func - (struct run *run /* _key */,struct run *run_value,struct FsRtlSplitLargeMcb_input *input) -{ - g_return_val_if_fail(run!=NULL,TRUE); - g_return_val_if_fail(run_value!=NULL,TRUE); - g_return_val_if_fail(run==run_value,TRUE); - g_return_val_if_fail(input!=NULL,TRUE); - - /* unaffected run? */ - /* FIXME: performance: effective skip of all 'lower' runs without traversing them */ - if (input->Vbn>=run->Vbn_end) - return FALSE; /* continue the traversal */ - - /* crossing run to be split? - * 'lower_run' is created on the original place; just shortened. - * current 'run' is shifted up later - */ - if (input->VbnVbn_end) { -struct run *lower_run; - - captive_new(lower_run); - *lower_run=*run; - lower_run->Vbn_end=input->Vbn; - /* FIXME: shift 'run->Lbn_start' ? */ - run->Vbn_start=input->Vbn; - - input->insert_lower_run=lower_run; - } - - /* Shift the current 'run'. - * Ordering is not changed in GTree so I hope I do not need to reinsert it. - */ - run->Vbn_start+=input->Amount; - g_assert(run->Vbn_end+input->Amount>run->Vbn_end); /* overflow? */ - run->Vbn_end+=input->Amount; - /* FIXME: shift 'run->Lbn_start' ? */ - - return FALSE; /* continue the traversal */ -} - - -/** - * FsRtlSplitLargeMcb: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * @Vbn: First virtual block number of blocks to shift up. - * @Amount: The amount of sectors to shift the blocks up by. - * Value less or equal to %0 is forbidden; FIXME: Is the reject of %0 W32 compliant? - * - * Takes the range of existing @Vbn..infinity 'real' block runs and shifts their - * virtual block numbers up by @Amount. Any possible 'real' run crossed by @Vbn - * threshold value gets split with the 'hole' of size @Amount blocks. - * - * FIXME: W32 doc does not say if logical block number should be also shifted. - * libcaptive does not touch logical block numbers. - * - * Returns: %TRUE if we crossed some 'real' run and we needed to create new 'hole'. - * We still may map a lot of 'real' runs and return %FALSE if no such run will be hit by @Vbn directly. - */ -BOOLEAN FsRtlSplitLargeMcb(IN PLARGE_MCB Mcb,IN LONGLONG Vbn,IN LONGLONG Amount) -{ -struct Mcb_priv *Mcb_priv; -struct FsRtlSplitLargeMcb_input input; - - g_return_val_if_fail(Mcb!=NULL,FALSE); - g_return_val_if_fail(Vbn>=0,FALSE); - g_return_val_if_fail(Amount>0,FALSE); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Mcb=%p,Vbn=%lld,Amount=%lld",G_STRLOC,Mcb,Vbn,Amount); - - Mcb_hash_init(); - Mcb_priv=g_hash_table_lookup(Mcb_hash,Mcb); - g_return_val_if_fail(Mcb_priv!=NULL,FALSE); - - input.Vbn=Vbn; - input.Amount=Amount; - input.insert_lower_run=NULL; - input.Mcb_priv=Mcb_priv; - g_tree_foreach(Mcb_priv->gtree,(GTraverseFunc)FsRtlSplitLargeMcb_traverse_func,&input); - - if (input.insert_lower_run) - g_tree_insert(input.Mcb_priv->gtree,input.insert_lower_run,input.insert_lower_run); - - return (input.insert_lower_run!=NULL); /* the hole was successfuly created? */ -} - - -/** - * FsRtlTruncateLargeMcb: - * @Mcb: #PLARGE_MCB initialized by FsRtlInitializeLargeMcb(). - * %NULL value is forbidden. - * @Vbn: First virtual block number of blocks to delete. - * - * Deletes the mapping from @Vbn upwards. If no such blocks exist this function - * does a safe NOP. - */ -VOID FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb,IN LONGLONG Vbn) -{ - g_return_if_fail(Mcb!=NULL); - g_return_if_fail(Vbn>=0); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Mcb=%p,Vbn=%lld",G_STRLOC,Mcb,Vbn); - - FsRtlRemoveLargeMcbEntry(Mcb,Vbn,G_MAXINT64-Vbn+1); -} diff --git a/src/libcaptive/fs/name.c b/src/libcaptive/fs/name.c deleted file mode 100644 index 93508d0..0000000 --- a/src/libcaptive/fs/name.c +++ /dev/null @@ -1,192 +0,0 @@ -/* $Id$ - * reactos filesystem name strings functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/fsfuncs.h" /* self */ -#include -#include "captive/unicode.h" -#include "reactos/unicode.h" /* for ANSI_* */ -#include "captive/macros.h" -#include - - -UCHAR **FsRtlLegalAnsiCharacterArray; - - -/** - * captive_FsRtlLegalAnsiCharacterArray_init: - * - * Initialize #FsRtlLegalAnsiCharacterArray character classes - * by appropriate #FSRTL_FAT_LEGAL etc. flags. - */ -void captive_FsRtlLegalAnsiCharacterArray_init(void) -{ -static UCHAR *array; -guint ui; -const gchar fat_valid[]="!#&(-./@_~"; - - /* Use allocation instead of static array to get ElectricFence sanity boundaries. - * Use even the negative 0x80 part as someone may access 'FsRtlLegalAnsiCharacterArray' - * with 'signed char' (but also with 'unsigned char'). See also memcpy(3) below. - */ - captive_new0n(array,0x80+0x100); - array+=0x80; - - for (ui=0;ui<0x100;ui++) { -UCHAR f=0; - - if (isalnum(ui) || strchr(fat_valid,ui)) - f|=FSRTL_FAT_LEGAL; - if (isalnum(ui) || strchr(fat_valid,ui)) - f|=FSRTL_HPFS_LEGAL; - if (isalnum(ui) || strchr(fat_valid,ui)) - f|=FSRTL_NTFS_LEGAL; - if (ui=='*' || ui=='?') - f|=FSRTL_WILD_CHARACTER; - if (isalnum(ui)) - f|=FSRTL_OLE_LEGAL; - - array[(unsigned int)(unsigned char)ui]=f; - } - - memcpy(array-0x80,array+0x80,0x80*sizeof(*array)); - - FsRtlLegalAnsiCharacterArray=&array; -} - - -/** - * FsRtlDoesNameContainWildCards: - * @Name: Filename to check for wildcards. - * %NULL value is forbidden. - * Non-zero terminated #PUNICODE_STRING is permitted. - * - * Check if @Name contains wildcard markers as its substring(s). - * - * Returns: %TRUE if @Name contains "*", "?", %ANSI_DOS_STAR, %ANSI_DOS_DOT or %ANSI_DOS_QM. - */ -BOOLEAN FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name) -{ -const UNICODE_STRING *cName=Name; -const WCHAR *wcp; - - g_return_val_if_fail(captive_validate_UnicodeString_noterm(cName),FALSE); - - for (wcp=cName->Buffer;wcpBuffer+(cName->Length/sizeof(*cName->Buffer));*wcp++) - if (0 - || *wcp=='*' - || *wcp=='?' - || *wcp==ANSI_DOS_STAR - || *wcp==ANSI_DOS_DOT - || *wcp==ANSI_DOS_QM) - return TRUE; - return FALSE; -} - - -/** - * FsRtlDissectName: - * @Path_noterm: Initialized #UNICODE_STRING to parse. - * @FirstName: Returns the first filename from @Path_noterm. - * %NULL value is forbidden. - * @RemainingName: Returns the part of @Path_noterm behind @FirstName. - * %NULL value is forbidden. - * - * Will parse @Path_noterm as regex (FirstName,RemainingName)=/^\?([^/]*)/?(.*)$/; - * @FirstName and @RemainingName must be pointers to allocated #UNICODE_STRING - * but their #Buffer will be pointing to inside @Path_noterm buffer afterwards. - * Therefore do not free it! The returned strings may not be 0-terminated strings. - * - * @Path_noterm does not neet to be zero-terminated. - */ -VOID FsRtlDissectName(IN UNICODE_STRING Path_noterm,OUT PUNICODE_STRING FirstName,OUT PUNICODE_STRING RemainingName) -{ -PWSTR Path_end; -PWSTR delim_FirstName_start ,delim_FirstName_end; -PWSTR delim_RemainingName_start,delim_RemainingName_end; - - g_return_if_fail(captive_validate_UnicodeString_noterm(&Path_noterm)); - g_return_if_fail(FirstName!=NULL); - g_return_if_fail(RemainingName!=NULL); - - Path_end=Path_noterm.Buffer+Path_noterm.Length/sizeof(*Path_noterm.Buffer); - - delim_FirstName_start=Path_noterm.Buffer; - if (delim_FirstName_startBuffer=delim_FirstName_start; - FirstName->Length=(delim_FirstName_end-delim_FirstName_start)*sizeof(*FirstName->Buffer); - FirstName->MaximumLength=FirstName->Length; - FirstName->Buffer=delim_FirstName_start; - - RemainingName->Buffer=delim_RemainingName_start; - RemainingName->Length=(delim_RemainingName_end-delim_RemainingName_start)*sizeof(*RemainingName->Buffer); - RemainingName->MaximumLength=RemainingName->Length; - RemainingName->Buffer=delim_RemainingName_start; -} - - -/** - * FsRtlAreNamesEqual: - * @Name1: First filesystem name (FIXME: pathname or basename?) of type #PUNICODE_STRING. - * Invalid string input is forbidden. - * @Name2: Second filesystem name (FIXME: pathname or basename?) of type #PUNICODE_STRING. - * Invalid string input is forbidden. - * @IgnoreCase: Compare @Name1 and @Name2 case-insensitively? - * @UpcaseTable: - * %NULL value is required if @IgnoreCase==%FALSE. - * TODO: NOT IMPLEMENTED YET. - * - * Compare the given filenames if they match according to the specified criteria. - * FIXME: libcaptive implements this function currently as captive_UnicodeString_compare_insensitive() - * or captive_UnicodeString_compare(); How are filesystem names specific from regular strings? - * - * Returns: %TRUE if @Name1 and @Name2 match. - */ -BOOLEAN FsRtlAreNamesEqual - (IN PUNICODE_STRING Name1,IN PUNICODE_STRING Name2,IN BOOLEAN IgnoreCase,IN PWCHAR UpcaseTable OPTIONAL) -{ - g_return_val_if_fail(captive_validate_UnicodeString(Name1),FALSE); - g_return_val_if_fail(FsRtlDoesNameContainWildCards(Name1)==FALSE,FALSE); - g_return_val_if_fail(captive_validate_UnicodeString(Name2),FALSE); - g_return_val_if_fail(FsRtlDoesNameContainWildCards(Name2)==FALSE,FALSE); - g_return_val_if_fail(UpcaseTable==NULL,FALSE); /* TODO: NOT IMPLEMENTED YET */ - /* Do not permit passing of 'UpcaseTable' if it would not make any sense. - * Just a sanity check, it should not harm. Such assertion is not mandatory by W32 doc. - */ - g_return_val_if_fail((IgnoreCase==FALSE && UpcaseTable==NULL) || IgnoreCase==TRUE,FALSE); - - if (IgnoreCase) - return captive_UnicodeString_compare_insensitive(Name1,Name2); - else - return captive_UnicodeString_compare (Name1,Name2); -} diff --git a/src/libcaptive/fs/name_pass.c b/src/libcaptive/fs/name_pass.c deleted file mode 100644 index 17020b6..0000000 --- a/src/libcaptive/fs/name_pass.c +++ /dev/null @@ -1,57 +0,0 @@ -/* $Id$ - * reactos filesystem name strings "pass"-redirector emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/fsfuncs.h" /* self */ -#include -#include "reactos/internal/module.h" /* for MODULE_OBJECT */ -#include "reactos/internal/ldr.h" /* for LdrGetModuleObject() */ -#include "captive/unicode.h" - - -UCHAR **FsRtlLegalAnsiCharacterArray; - - -/* Declared only inside ntoskrnl/ldr/loader.c scope. */ -PVOID LdrGetExportAddress(PMODULE_OBJECT ModuleObject,char *Name,unsigned short Hint); - -/** - * captive_FsRtlLegalAnsiCharacterArray_init: - * - * Initialize #FsRtlLegalAnsiCharacterArray character classes - * by appropriate #FSRTL_FAT_LEGAL etc. flags. - */ -void captive_FsRtlLegalAnsiCharacterArray_init(void) -{ -MODULE_OBJECT *ntoskrnl_exe_ModuleObject; -UCHAR **exported; - - ntoskrnl_exe_ModuleObject=LdrGetModuleObject(captive_utf8_to_UnicodeString_alloca("ntoskrnl.exe")); - g_assert(ntoskrnl_exe_ModuleObject!=NULL); - - exported=LdrGetExportAddress( - ntoskrnl_exe_ModuleObject, /* ModuleObject */ - "FsRtlLegalAnsiCharacterArray", /* Name */ - 0); /* Hint */ - g_assert(exported!=NULL); - - g_assert(*exported!=NULL); - FsRtlLegalAnsiCharacterArray=exported; -} diff --git a/src/libcaptive/fs/notify.c b/src/libcaptive/fs/notify.c deleted file mode 100644 index 089cb85..0000000 --- a/src/libcaptive/fs/notify.c +++ /dev/null @@ -1,63 +0,0 @@ -/* $Id$ - * reactos filesystem notification functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -/* no prototype for FsRtlNotifyFilterChangeDirectory() */ -#include -#include "reactos/base.h" /* for VOID etc. */ -#include "reactos/ddk/fstypes.h" /* for PNOTIFY_SYNC */ -#include "reactos/ddk/fsfuncs.h" /* for PCHECK_FOR_TRAVERSE_ACCESS */ - - -typedef BOOLEAN (*PFILTER_REPORT_CHANGE)(IN PVOID NotifyContext,IN PVOID FilterContext); - -/** - * FsRtlNotifyFilterChangeDirectory: - * @NotifySync: IGNORED; ignored by libcaptive. - * %NULL value is forbidden. - * @NotifyList: IGNORED; ignored by libcaptive. - * %NULL value is forbidden. - * @FsContext: IGNORED; ignored by libcaptive. - * @FullDirectoryName: IGNORED; ignored by libcaptive. - * %NULL value is permitted. - * @WatchTree: IGNORED; ignored by libcaptive. - * @IgnoreBuffer: IGNORED; ignored by libcaptive. - * @CompletionFilter: IGNORED; ignored by libcaptive. - * @NotifyIrp: IGNORED; ignored by libcaptive. - * %NULL value is permitted. - * @TraverseCallback: IGNORED; ignored by libcaptive. - * @SubjectContext: IGNORED; ignored by libcaptive. - * @FilterCallback: IGNORED; ignored by libcaptive. - * - * libcaptive does not support any filesystem filter drivers and therefore - * the function is implemented as no-operation. - */ -VOID FsRtlNotifyFilterChangeDirectory(IN PNOTIFY_SYNC NotifySync,IN PLIST_ENTRY NotifyList, - IN PVOID FsContext,IN PSTRING FullDirectoryName,IN BOOLEAN WatchTree,IN BOOLEAN IgnoreBuffer, - IN ULONG CompletionFilter,IN PIRP NotifyIrp,IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL, - IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL,IN PFILTER_REPORT_CHANGE FilterCallback OPTIONAL) -{ - g_return_if_fail(NotifySync!=NULL); - g_return_if_fail(NotifyList!=NULL); - /* 'FullDirectoryName' may be NULL */ - /* 'NotifyIrp' may be NULL */ - - /* NOP */ -} diff --git a/src/libcaptive/fs/oplock.c b/src/libcaptive/fs/oplock.c deleted file mode 100644 index 23441ae..0000000 --- a/src/libcaptive/fs/oplock.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id$ - * reactos filesystem oplock functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/fsfuncs.h" /* self */ -#include "reactos/ddk/status.h" /* for STATUS_SUCCESS */ -#include - - -VOID FsRtlInitializeOplock(IN OUT POPLOCK Oplock) -{ - g_return_if_fail(Oplock!=NULL); - - /* FIXME: NOT IMPLEMENTED YET */ -} - - -VOID FsRtlUninitializeOplock(IN OUT POPLOCK Oplock) -{ - g_return_if_fail(Oplock!=NULL); - - /* FIXME: NOT IMPLEMENTED YET */ -} - - -/** - * FsRtlCheckOplock: - * @Oplock: ???. - * %NULL value is forbidden. - * @Irp: ???. - * %NULL value is forbidden. - * @Context: ???. - * %NULL value is permitted. - * @CompletionRoutine: ???. - * %NULL value is permitted. - * @PostIrpRoutine: - * %NULL value is permitted. - * - * libcaptive does not support any oplocks. This function is a NOP. - * - * Returns: %STATUS_SUCCESS. - */ -NTSTATUS FsRtlCheckOplock(IN POPLOCK Oplock,IN PIRP Irp,IN PVOID Context, - IN POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine OPTIONAL,IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL) -{ - g_return_val_if_fail(Oplock!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Irp!=NULL,STATUS_INVALID_PARAMETER); - - /* NOP */ - - return STATUS_SUCCESS; -} - - -BOOLEAN FsRtlCurrentBatchOplock(IN POPLOCK Oplock) -{ - g_return_val_if_fail(Oplock!=NULL,FALSE); - - /* NOP */ - - return FALSE; /* no oplock operation pending */ -} diff --git a/src/libcaptive/fs/stream.c b/src/libcaptive/fs/stream.c deleted file mode 100644 index 6dae595..0000000 --- a/src/libcaptive/fs/stream.c +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * reactos stream handling functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -/* FIXME: #include missing prototype */ /* self */ -#include -#include "reactos/ntos/types.h" /* for VOID */ -#include "reactos/ddk/ntifs.h" /* for PFSRTL_ADVANCED_FCB_HEADER */ - - -/** - * FsRtlTeardownPerStreamContexts: - * @AdvancedHeader: Registry of all filter contexts. - * %NULL value is forbidden. - * - * Frees all filter contexts for @AdvancedHeader. - * Currently a nop for libcaptive as it does not support any filter drivers. - */ -VOID FsRtlTeardownPerStreamContexts(IN PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader) -{ - g_return_if_fail(AdvancedHeader!=NULL); - - /* NOP */ -} diff --git a/src/libcaptive/fs/tunnel.c b/src/libcaptive/fs/tunnel.c deleted file mode 100644 index 684f9b0..0000000 --- a/src/libcaptive/fs/tunnel.c +++ /dev/null @@ -1,138 +0,0 @@ -/* $Id$ - * reactos tunnel (deleted files) database functions emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/fsfuncs.h" /* self */ -#include -#include "reactos/ntos/types.h" /* for VOID */ -#include "reactos/ddk/exfuncs.h" /* for ExInitializeFastMutex() */ - - -/** - * FsRtlAddToTunnelCache: - * @Cache: Tunnel cache initialized by FsRtlInitializeTunnelCache(). - * %NULL value or uninitialized structure is forbidden. - * @DirectoryKey: Unique #ULONGLONG to identify the parent directory on the volume. - * @ShortName: Shortname of the entry to add. - * %NULL value forbidden if @KeyByShortName==%TRUE. - * @LongName: Longname of the entry to add. - * %NULL value forbidden if @KeyByShortName==%FALSE. - * @DataLength: Size of @Data to store with the entry. This value must be the same for the whole @Cache. - * @Data: Data to store with the entry. - * %NULL value permitted if @DataLength==0. - * - * Stores the given entry name pair associated with the given directory. - * It may get handy to keep the same shortname or longname after its recreation later. - * FIXME: Currently not yet implemented by libcaptive. It may get handy to keep - * shortnames/longnames the same during crossfilesystem copying. - */ -VOID FsRtlAddToTunnelCache(IN PTUNNEL Cache,IN ULONGLONG DirectoryKey,IN PUNICODE_STRING ShortName,IN PUNICODE_STRING LongName,IN BOOLEAN KeyByShortName,IN ULONG DataLength,IN PVOID Data) -{ - g_return_if_fail(Cache!=NULL); - g_return_if_fail(ShortName!=NULL || KeyByShortName==FALSE); - g_return_if_fail(LongName!=NULL || KeyByShortName==TRUE); - g_return_if_fail(DataLength==0 || Data!=NULL); - - /* NOP now */ -} - - -/** - * FsRtlDeleteKeyFromTunnelCache: - * @Cache: Tunnel cache initialized by FsRtlInitializeTunnelCache(). - * %NULL value or uninitialized structure is forbidden. - * @DirectoryKey: Unique #ULONGLONG to identify the directory on the volume. - * - * Deletes the given directory @DirectoryKey from Tunnel cache @Cache. - * All the directory's entries are deleted. - */ -VOID FsRtlDeleteKeyFromTunnelCache(IN PTUNNEL Cache,IN ULONGLONG DirectoryKey) -{ - g_return_if_fail(Cache!=NULL); - - /* NOP now */ -} - - -/** - * FsRtlDeleteTunnelCache: - * @Cache: Tunnel cache initialized by FsRtlInitializeTunnelCache(). - * %NULL value or uninitialized structure is forbidden. - * - * Deletes the whole @Caceh and frees all its resources. You may no longer pass - * this @Cache to any FsRtl*TunnelCache() function. - */ -VOID FsRtlDeleteTunnelCache(IN PTUNNEL Cache) -{ - g_return_if_fail(Cache!=NULL); - - /* NOP now */ -} - - -/** - * FsRtlFindInTunnelCache: - * @Cache: Tunnel cache initialized by FsRtlInitializeTunnelCache(). - * %NULL value or uninitialized structure is forbidden. - * @DirectoryKey: Unique #ULONGLONG to identify the parent directory on the volume. - * @Name: Name to search for; either shortname or longname. - * %NULL value is forbidden. - * @ShortName: Returns shortname of the found entry if successful. - * %NULL value is forbidden. - * @LongName: Returns longname of the found entry if successful. - * %NULL value is forbidden. - * @DataLength: Size of @Data to fill-in/returned. This value must be the same for the whole @Cache. - * %NULL pointer is forbidden. - * @Data: Returns filed-in data associated with the tunnelled entry. - * %NULL value permitted if @*DataLength==0. - * - * Finds the given entry in the specified Tunnel cache @Cache; either by its stored - * shortname or the longname. - * FIXME: Currently not yet implemented by libcaptive. It may get handy to keep - * shortnames/longnames the same during crossfilesystem copying. - * - * Returns: %TRUE if the entry was found. FIXME: libcaptive always returns %FALSE. - */ -BOOLEAN FsRtlFindInTunnelCache(IN PTUNNEL Cache,IN ULONGLONG DirectoryKey,IN PUNICODE_STRING Name,OUT PUNICODE_STRING ShortName,OUT PUNICODE_STRING LongName,IN OUT PULONG DataLength,OUT PVOID Data) -{ - g_return_val_if_fail(Cache!=NULL,FALSE); - g_return_val_if_fail(Name!=NULL,FALSE); - g_return_val_if_fail(DataLength!=NULL,FALSE); - g_return_val_if_fail(*DataLength==0 || Data!=NULL,FALSE); - - return FALSE; /* not found */ -} - - -/** - * FsRtlInitializeTunnelCache: - * @Cache: Allocated Tunnel cache memory to initialize. - * %NULL value is forbidden. - * - * Initializes given @Cache to use it later for FsRtl*TunnelCache() functions. - */ -VOID FsRtlInitializeTunnelCache(IN PTUNNEL Cache) -{ - g_return_if_fail(Cache!=NULL); - - ExInitializeFastMutex(&Cache->Mutex); - /* FIXME: PRTL_SPLAY_LINKS Cache->Cache */ - Cache->NumEntries=0; -} diff --git a/src/libcaptive/fs/util.c b/src/libcaptive/fs/util.c deleted file mode 100644 index 3fc58dd..0000000 --- a/src/libcaptive/fs/util.c +++ /dev/null @@ -1,43 +0,0 @@ -/* $Id$ - * reactos filesystem oplock functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/fsfuncs.h" /* self */ -#include "reactos/ddk/status.h" /* for STATUS_SUCCESS */ -#include - - -/** - * FsRtlBalanceReads: - * @TargetDevice: Existing device to start mirring operations on. - * - * Called by filesystem to indicate to mirroting subsystem it is now safe - * to start mirroring operations on its device. - * - * libcaptive does not support mirroring; this function is a NOP. - * - * Returns: %STATUS_SUCCESS. - */ -NTSTATUS FsRtlBalanceReads(IN PDEVICE_OBJECT TargetDevice) -{ - g_return_val_if_fail(TargetDevice!=NULL,STATUS_INVALID_PARAMETER); - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/halcaptive/Makefile.am b/src/libcaptive/halcaptive/Makefile.am deleted file mode 100644 index 71c4acc..0000000 --- a/src/libcaptive/halcaptive/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ -# automake source for the reactos's HAL emulation of libcaptive Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libhalcaptive.la -libhalcaptive_la_SOURCES= \ - intrlck.c \ - perfcnt.c \ - queuedspinlock.c \ - spinlock.c diff --git a/src/libcaptive/halcaptive/intrlck.c b/src/libcaptive/halcaptive/intrlck.c deleted file mode 100644 index 4ff7fbb..0000000 --- a/src/libcaptive/halcaptive/intrlck.c +++ /dev/null @@ -1,106 +0,0 @@ -/* $Id$ - * reactos inter lock increments emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/exfuncs.h" /* self */ - - -/** - * InterlockedIncrement: - * @Addend: #LONG variable to be +1ed. - * - * Adds 1 to a #LONG variable and returns. - * Currently libcaptive doesn't use multithreading - * and thus this function is just a simple increment now. - * - * Returns: a negative number if the @result < %0, - * zero if the @result == %0 - * a positive number if the @result > %0. - * The returned number need not be equal to the result!!!! - */ -LONG InterlockedIncrement(PLONG Addend) -{ - /* TODO:thread; really? */ - return ++*Addend; -} - - -/** - * InterlockedDecrement: - * @Addend: #LONG variable to be -1ed. - * - * Subtracts 1 from a #LONG variable and returns. - * Currently libcaptive doesn't use multithreading - * and thus this function is just a simple decrement now. - * - * Returns: a negative number if the @result < %0, - * zero if the @result == %0 - * a positive number if the @result > %0. - * The returned number need not be equal to the result!!!! - */ -LONG InterlockedDecrement(PLONG Subend) -{ - /* TODO:thread; really? */ - return --*Subend; -} - - -/** - * InterlockedExchange: - * @Target: Pointer to #LONG variable to exchange @Value with. - * @Value: Value to store to @Target value. - * - * Atomic value exchange between *@Target and @Value. - * Currently libcaptive doesn't use multithreading - * and thus this function is just a simple value exchange now. - * - * Returns: Previous value of @Target; - */ -LONG InterlockedExchange(PLONG Target,LONG Value) -{ -LONG r; - - /* TODO:thread */ - r=*Target; - *Target=Value; - return r; -} - - -/** - * InterlockedExchangeAdd: - * @Addend: Pointer to #LONG variable to add @Value to. - * @Value: Value to add to @Addend value. - * - * Atomic value add of @Value to *@Addend. - * Currently libcaptive doesn't use multithreading - * and thus this function is just a simple value add now. - * - * Returns: Previous value of *@Addend; - */ -LONG InterlockedExchangeAdd(PLONG Addend,LONG Value) -{ -LONG r; - - /* TODO:thread */ - r=*Addend; - *Addend+=Value; - return r; -} diff --git a/src/libcaptive/halcaptive/perfcnt.c b/src/libcaptive/halcaptive/perfcnt.c deleted file mode 100644 index cfc186b..0000000 --- a/src/libcaptive/halcaptive/perfcnt.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id$ - * reactos performance counters emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include -#include - - -/** - * KeQueryPerformanceCounter: - * @PerformanceFreq: Optionally returns the number of ticks per second. - * %NULL value is permitted. - * - * Reports the current system-wide timer value. - * - * Returns: Current system timer ticks count with unspecified base. - * You will want to subtract two such values to get some timing result. - * libcaptive must return #gint64 instead of the official #LARGE_INTEGER - * as W32 expects it as value in EAX:EDX but GCC returns the structure address in EAX. - */ -gint64 /* instead of LARGE_INTEGER */ KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFreq) -{ -LARGE_INTEGER r; -struct timeval tv; -int errint; - - errint=gettimeofday( - &tv, /* tv */ - NULL); /* tz */ - g_assert(errint==0); - - r.QuadPart=((guint64)tv.tv_sec)*1000000+tv.tv_usec; - - if (PerformanceFreq) - PerformanceFreq->QuadPart=1000000; - - return r.QuadPart; -} diff --git a/src/libcaptive/halcaptive/queuedspinlock.c b/src/libcaptive/halcaptive/queuedspinlock.c deleted file mode 100644 index 4b28185..0000000 --- a/src/libcaptive/halcaptive/queuedspinlock.c +++ /dev/null @@ -1,151 +0,0 @@ -/* $Id$ - * reactos queued spinlock emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -/* no reactos prototype for KeAcquireQueuedSpinLock() and KeReleaseQueuedSpinLock() */ -#include "reactos/ddk/types.h" /* for KIRQL */ -#include "reactos/ddk/kefuncs.h" /* for KeGetCurrentIrql() */ -#include - - -typedef enum _KSPIN_LOCK_QUEUE_NUMBER { - LockQueueDispatcherLock, - LockQueueContextSwapLock, - LockQueuePfnLock, - LockQueueSystemSpaceLock, - LockQueueVacbLock, - LockQueueMasterLock, - LockQueueNonPagedPoolLock, - LockQueueIoCancelLock, - LockQueueWorkQueueLock, - LockQueueIoVpbLock, - LockQueueIoDatabaseLock, - LockQueueIoCompletionLock, - LockQueueNtfsStructLock, - LockQueueAfdWorkQueueLock, - LockQueueBcbLock, - LockQueueMaximumLock - } KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER; - - -/** - * KeAcquireQueuedSpinLock: - * @Number: Identification number of queued spinlock to acquire. - * - * Acquires a queued spinlock identified by @Number. - * Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. #GMutex would be needed otherwise. - * - * See http://www.compuware.co.jp/drivercentral/resources/spinlocks.asp - * - * Returns: IRQ level before this call. FIXME: What is expected in real? No W32 doc... - */ -KIRQL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER Number) -{ - /* TODO:thread */ - - return KeGetCurrentIrql(); -} - - -/** - * KeReleaseQueuedSpinLock: - * @Number: Identification number of queued spinlock to release. - * @OldIrql: Original IRQ level before KeAcquireQueuedSpinLock(). - * - * Releases a queued spinlock acquired by KeAcquireQueuedSpinLock(). - * Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. #GMutex would be needed otherwise. - */ -VOID KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER Number,IN KIRQL OldIrql) -{ - /* TODO:thread */ -} - - -/** - * KeAcquireQueuedSpinLockRaiseToSynch: - * @Number: Identification number of queued spinlock to acquire. - * - * Acquires a queued spinlock identified by @Number. - * Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. #GMutex would be needed otherwise. - * - * FIXME: This functions has unknown prototype and functionality, it was only guessed. - * - * See http://www.compuware.co.jp/drivercentral/resources/spinlocks.asp - * - * Returns: IRQ level before this call. FIXME: What is expected in real? No W32 doc... - */ -KIRQL KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER Number) /* FIXME: unknown prototype! */ -{ - /* TODO:thread */ - - return KeGetCurrentIrql(); -} - - -typedef struct _KSPIN_LOCK_QUEUE { - struct _KSPIN_LOCK_QUEUE * volatile Next; - PKSPIN_LOCK volatile Lock; - } KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE; - -typedef struct _KLOCK_QUEUE_HANDLE { - KSPIN_LOCK_QUEUE LockQueue; - KIRQL OldIrql; - } KLOCK_QUEUE_HANDLE,*PKLOCK_QUEUE_HANDLE; - - -/** - * KeAcquireInStackQueuedSpinLock: - * @SpinLock: Spin lock structure to acquire. - * %NULL value is forbidden. - * @LockHandle: Handle to later pass to KeReleaseInStackQueuedSpinLock(). - * %NULL value is forbidden. - * - * Acquires a queued spinlock @SpinLock. - * You must not mix this call with KeAcquireQueuedSpinLock() for the same @SpinLock. - * Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. #GMutex would be needed otherwise. - */ -VOID KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock,IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - g_return_if_fail(SpinLock!=NULL); - g_return_if_fail(LockHandle!=NULL); - - /* TODO:thread */ -} - - -/** - * KeReleaseInStackQueuedSpinLock: - * @LockHandle: Handle from the acquire by KeAcquireInStackQueuedSpinLock(). - * %NULL value is forbidden. - * - * Releases a queued spinlock acquired by KeAcquireInStackQueuedSpinLock(). - * Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. #GMutex would be needed otherwise. - */ -VOID KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle) -{ - g_return_if_fail(LockHandle!=NULL); - - /* TODO:thread */ -} diff --git a/src/libcaptive/halcaptive/spinlock.c b/src/libcaptive/halcaptive/spinlock.c deleted file mode 100644 index 024e80d..0000000 --- a/src/libcaptive/halcaptive/spinlock.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * reactos spinlock emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ - - -/** - * KeAcquireSpinLockAtDpcLevel: - * @SpinLock: Spinlock to acquire - * - * Acquires a spinlock if the caller already runs on >= %DISPATCH_LEVEL. - * Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. #GMutex would be needed otherwise. - */ -VOID KeAcquireSpinLockAtDpcLevel(PKSPIN_LOCK SpinLock) -{ - /* TODO:thread */ -} - - -/** - * KeReleaseSpinLockFromDpcLevel: - * @SpinLock: Spinlock to release - * - * Releases a spinlock if the caller already run on >= %DISPATCH_LEVEL - * during its acquire by KeAcquireSpinLockAtDpcLevel(). - * Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. #GMutex would be needed otherwise. - */ -VOID KeReleaseSpinLockFromDpcLevel(PKSPIN_LOCK SpinLock) -{ - /* TODO:thread */ -} diff --git a/src/libcaptive/include/Makefile.am b/src/libcaptive/include/Makefile.am deleted file mode 100644 index dab7495..0000000 --- a/src/libcaptive/include/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# $Id$ -# automake source for include directory containing "captive" subdir -# to permit clean #include "captive/FIXMEsomeincludefile.h" in .c files -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -SUBDIRS=reactos captive diff --git a/src/libcaptive/include/captive/Makefile.am b/src/libcaptive/include/captive/Makefile.am deleted file mode 100644 index 2cc9daa..0000000 --- a/src/libcaptive/include/captive/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -# $Id$ -# automake source for include/captive directory Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -pkginclude_HEADERS+= \ - calltype_reactos.h \ - client-directory.h \ - client-file.h \ - client-vfs.h \ - client.h \ - config2.h \ - ldr.h \ - ldr_exports.h \ - leave.h \ - libxml.h \ - macros.h \ - mm.h \ - options-module.h \ - options.h \ - ps_reactos.h \ - rtl-file.h \ - signal.h \ - storage.h \ - unicode.h \ - unicode_reactos.h \ - usecount.h - -# for 'include_test.c' handled by Makefile-head.am/.include_test_all.stamp rule by $(COMPILE) -AM_CFLAGS=$(GNOME_VFS_MODULE_CFLAGS) $(LIBXML_CFLAGS) diff --git a/src/libcaptive/include/captive/calltype_reactos.h b/src/libcaptive/include/captive/calltype_reactos.h deleted file mode 100644 index 59b166d..0000000 --- a/src/libcaptive/include/captive/calltype_reactos.h +++ /dev/null @@ -1,85 +0,0 @@ -/* $Id$ - * Include file for function call types definitions for reactos files for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CALLTYPE_REACTOS_H -#define _CAPTIVE_CALLTYPE_REACTOS_H 1 - - -#include -#include -/* captive/?*_reactos.h include files have forbidden any reactos/?* inclusions - * as they are being included by reactos/compat.h. - */ - - -G_BEGIN_DECLS - -/** - * CAPTIVE_CDECL: - * - * Function call type declaration for the real #CDECL call type. - * As the default #CDECL macro gets disabled (=NOP) during reactos sources - * compilation (and gets undefined to cause error during non-reactos sources - * compilation) you have the chance to do the real #CDECL declaration - * by using #CAPTIVE_CDECL. You must #ifdef it by %LIBCAPTIVE symbol as it - * is not available during standalone reactos compilation. - * - * This macro may be needed to pass control to W32 binary code. - */ -#define CAPTIVE_CDECL __attribute__((__cdecl__)) - - -/** - * CAPTIVE_STDCALL: - * - * Function call type declaration for the real #STDCALL call type. - * As the default #STDCALL macro gets disabled (=NOP) during reactos sources - * compilation (and gets undefined to cause error during non-reactos sources - * compilation) you have the chance to do the real #STDCALL declaration - * by using #CAPTIVE_STDCALL. You must #ifdef it by %LIBCAPTIVE symbol as it - * is not available during standalone reactos compilation. - * - * This macro may be needed to pass control to W32 binary code. - */ -#define CAPTIVE_STDCALL __attribute__((__stdcall__)) - - -/** - * CAPTIVE_FASTCALL: - * - * You cannot do simple declaration for the real #FASTCALL call type. - * - * You should not need it as the non-core W32 binary code does not use #FASTCALL - * functions. - */ -#undef CAPTIVE_FASTCALL - - -typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc4 )(gpointer arg0); -typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc8 )(gpointer arg0,gpointer arg1); -typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc12)(gpointer arg0,gpointer arg1,gpointer arg2); - -gpointer captive_stdcall_call_4 (CaptiveStdCallFunc4 func,gpointer arg0); -gpointer captive_stdcall_call_8 (CaptiveStdCallFunc8 func,gpointer arg0,gpointer arg1); -gpointer captive_stdcall_call_12(CaptiveStdCallFunc12 func,gpointer arg0,gpointer arg1,gpointer arg2); - -G_END_DECLS - - -#endif /* _CAPTIVE_CALLTYPE_REACTOS_H */ diff --git a/src/libcaptive/include/captive/client-directory.h b/src/libcaptive/include/captive/client-directory.h deleted file mode 100644 index 82f34ae..0000000 --- a/src/libcaptive/include/captive/client-directory.h +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id$ - * Include file with client-application 'directory' access to libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_DIRECTORY_H -#define _CAPTIVE_CLIENT_DIRECTORY_H 1 - - -#include -#include -#include /* for GnomeVFSFileInfo */ -#include "captive/client-vfs.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_DIRECTORY_TYPE_OBJECT (captive_directory_object_get_type()) -#define CAPTIVE_DIRECTORY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_DIRECTORY_TYPE_OBJECT,CaptiveDirectoryObject)) -#define CAPTIVE_DIRECTORY_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_DIRECTORY_TYPE_OBJECT,CaptiveDirectoryObjectClass)) -#define CAPTIVE_DIRECTORY_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_DIRECTORY_TYPE_OBJECT)) -#define CAPTIVE_DIRECTORY_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_DIRECTORY_TYPE_OBJECT)) -#define CAPTIVE_DIRECTORY_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_DIRECTORY_TYPE_OBJECT,CaptiveDirectoryObjectClass)) -typedef struct _CaptiveDirectoryObject CaptiveDirectoryObject; -typedef struct _CaptiveDirectoryObjectClass CaptiveDirectoryObjectClass; - - -GType captive_directory_object_get_type(void); - -GnomeVFSResult captive_directory_new_open(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname); -GnomeVFSResult captive_directory_new_make(CaptiveDirectoryObject **captive_directory_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,guint perm); -CaptiveVfsObject *captive_directory_ref_vfs(CaptiveDirectoryObject *captive_directory_object); -GnomeVFSResult captive_directory_read(CaptiveDirectoryObject *captive_directory_object,GnomeVFSFileInfo *file_info); -GnomeVFSResult captive_directory_remove(CaptiveDirectoryObject *captive_directory_object); - - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_DIRECTORY_H */ diff --git a/src/libcaptive/include/captive/client-file.h b/src/libcaptive/include/captive/client-file.h deleted file mode 100644 index 421ace2..0000000 --- a/src/libcaptive/include/captive/client-file.h +++ /dev/null @@ -1,67 +0,0 @@ -/* $Id$ - * Include file with client-application 'file' access to libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_FILE_H -#define _CAPTIVE_CLIENT_FILE_H 1 - - -#include -#include -#include /* for GnomeVFSOpenMode */ -#include "captive/client-vfs.h" - - -G_BEGIN_DECLS - -#define CAPTIVE_FILE_TYPE_OBJECT (captive_file_object_get_type()) -#define CAPTIVE_FILE_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_FILE_TYPE_OBJECT,CaptiveFileObject)) -#define CAPTIVE_FILE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_FILE_TYPE_OBJECT,CaptiveFileObjectClass)) -#define CAPTIVE_FILE_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_FILE_TYPE_OBJECT)) -#define CAPTIVE_FILE_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_FILE_TYPE_OBJECT)) -#define CAPTIVE_FILE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_FILE_TYPE_OBJECT,CaptiveFileObjectClass)) -typedef struct _CaptiveFileObject CaptiveFileObject; -typedef struct _CaptiveFileObjectClass CaptiveFileObjectClass; - - -GType captive_file_object_get_type(void); - -GnomeVFSResult captive_file_new_open(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode); -GnomeVFSResult captive_file_new_create(CaptiveFileObject **captive_file_object_return, - CaptiveVfsObject *captive_vfs_object,const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm); -CaptiveVfsObject *captive_file_ref_vfs(CaptiveFileObject *captive_file_object); -GnomeVFSResult captive_file_read(CaptiveFileObject *captive_file_object, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return); -GnomeVFSResult captive_file_write(CaptiveFileObject *captive_file_object, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return); -GnomeVFSResult captive_file_seek - (CaptiveFileObject *captive_file_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset); -GnomeVFSResult captive_file_tell(CaptiveFileObject *captive_file_object,GnomeVFSFileOffset *offset_return); -GnomeVFSResult captive_file_remove(CaptiveFileObject *captive_file_object); -GnomeVFSResult captive_file_file_info_get(CaptiveFileObject *captive_file_object, - GnomeVFSFileInfo *file_info); -GnomeVFSResult captive_file_file_info_set(CaptiveFileObject *captive_file_object, - const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask); -GnomeVFSResult captive_file_truncate(CaptiveFileObject *captive_file_object,GnomeVFSFileSize file_size); -GnomeVFSResult captive_file_move(CaptiveFileObject *captive_file_object_old,const gchar *pathname_new,gboolean force_replace); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_FILE_H */ diff --git a/src/libcaptive/include/captive/client-vfs.h b/src/libcaptive/include/captive/client-vfs.h deleted file mode 100644 index b370f17..0000000 --- a/src/libcaptive/include/captive/client-vfs.h +++ /dev/null @@ -1,63 +0,0 @@ -/* $Id$ - * Include file with client general VFS access to libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_VFS_H -#define _CAPTIVE_CLIENT_VFS_H 1 - - -#include -#include -#include -#include "captive/options.h" /* for captive_options */ - - -G_BEGIN_DECLS - -#define CAPTIVE_VFS_TYPE_OBJECT (captive_vfs_object_get_type()) -#define CAPTIVE_VFS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_VFS_TYPE_OBJECT,CaptiveVfsObject)) -#define CAPTIVE_VFS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_VFS_TYPE_OBJECT,CaptiveVfsObjectClass)) -#define CAPTIVE_VFS_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_VFS_TYPE_OBJECT)) -#define CAPTIVE_VFS_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_VFS_TYPE_OBJECT)) -#define CAPTIVE_VFS_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_VFS_TYPE_OBJECT,CaptiveVfsObjectClass)) -typedef struct _CaptiveVfsObject CaptiveVfsObject; -typedef struct _CaptiveVfsObjectClass CaptiveVfsObjectClass; - - -GType captive_vfs_object_get_type(void); - -struct captive_options; - -typedef struct _CaptiveVfsVolumeInfo CaptiveVfsVolumeInfo; -struct _CaptiveVfsVolumeInfo { - guint32 block_size; - guint64 bytes; - guint64 bytes_free; /* total free */ - guint64 bytes_available; /* free without reserved */ - }; - - -GnomeVFSResult captive_vfs_new - (CaptiveVfsObject **captive_vfs_object_return,const struct captive_options *options); -GnomeVFSResult captive_vfs_commit(CaptiveVfsObject *captive_vfs_object); -GnomeVFSResult captive_vfs_volume_info_get(CaptiveVfsObject *captive_vfs_object,CaptiveVfsVolumeInfo *volume_info); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_VFS_H */ diff --git a/src/libcaptive/include/captive/client.h b/src/libcaptive/include/captive/client.h deleted file mode 100644 index 9c3b749..0000000 --- a/src/libcaptive/include/captive/client.h +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id$ - * Include file with client utility functions of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_H -#define _CAPTIVE_CLIENT_H 1 - - -#include - - -G_BEGIN_DECLS - -gchar *captive_path_normalize(const gchar *raw_pathname); -void captive_standalone_init(void); -void captive_standalone_gnome_init(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_H */ diff --git a/src/libcaptive/include/captive/config2.h b/src/libcaptive/include/captive/config2.h deleted file mode 100644 index 09857ca..0000000 --- a/src/libcaptive/include/captive/config2.h +++ /dev/null @@ -1,105 +0,0 @@ -/* $Id$ - * Supplemental include file for config.h of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CONFIG2_H -#define _CAPTIVE_CONFIG2_H 1 - - -/* Prevent: /usr/include/libbonobo-2.0/bonobo/bonobo-i18n.h:47:1: warning: "_" redefined */ -/* #undef's need to be out of AH_BOTTOM() of 'configure.ac' to not to be commented out. */ -#ifdef CAPTIVE_USING_GNOMEUI -# include -# undef textdomain -# undef gettext -# undef dgettext -# undef dcgettext -# undef bindtextdomain -# undef bind_textdomain_codeset -# undef _ -# undef N_ -#endif /* CAPTIVE_USING_GNOMEUI */ -#ifdef ENABLE_NLS -/* is taken from "$(top_srcdir)/intl" if system doesn't provide intl */ -# include -#ifdef LIBCAPTIVE -# define _(String) dgettext (PACKAGE,String) -#else -# define _(String) gettext (String) -#endif /* LIBCAPTIVE */ -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else /* !ENABLE_NLS */ -/* Stubs that do something close enough. */ -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -#endif /* !ENABLE_NLS */ - -#include /* for 'gchar' */ -/* Prevent: /usr/include/glib-2.0/glib/gmessages.h:123:1: warning: this is the location of the previous definition */ -#undef G_LOG_DOMAIN -#define G_LOG_DOMAIN ((const gchar *)"Captive") - -/* Ensure we have proper -I options: */ -#if defined(CAPTIVE_USE_GNOME_VFS_MODULE) || defined(CAPTIVE_USE_GNOME_VFS) -#ifndef HAVE_GNOME_VFS_READ_ENTIRE_FILE -#include -GnomeVFSResult gnome_vfs_read_entire_file(const char *uri,int *file_size,char **file_contents); -#endif -#endif - -/* We need to redefine it here as any '#undef' in config.h gets commented - * out during 'config.h.in' -> 'config.h' pass. - */ -#if defined(__GNUC__) && (__GNUC__ >= 3) -#include /* for 'G_STRLOC' */ -# undef G_STRLOC -/* '__func__' does not string-concatenate! */ -# define G_STRLOC __func__ -#endif - - -/* g_log() and g_logv() acceleration */ -#ifdef LIBCAPTIVE -#include /* for g_log() */ -#include /* for 'gboolean' */ -extern gboolean captive_debug_messages_disabled; -#define g_log(log_domain,log_level,format,args...) ({ \ - GLogLevelFlags _captive_g_log_log_level=(log_level); \ - if ((_captive_g_log_log_level&~(G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG)) \ - || !captive_debug_messages_disabled) \ - g_log((log_domain),_captive_g_log_log_level,(format) , ## args); \ - }) -#define g_logv(log_domain,log_level,format,args) ({ \ - GLogLevelFlags _captive_g_logv_log_level=(log_level); \ - if ((_captive_g_logv_log_level&~(G_LOG_LEVEL_MESSAGE|G_LOG_LEVEL_INFO|G_LOG_LEVEL_DEBUG)) \ - || !captive_debug_messages_disabled) \ - g_logv((log_domain),_captive_g_logv_log_level,(format),(args)); \ - }) -#endif /* LIBCAPTIVE */ - - -#endif /* _CAPTIVE_CONFIG2_H */ diff --git a/src/libcaptive/include/captive/ldr.h b/src/libcaptive/include/captive/ldr.h deleted file mode 100644 index 462e8ec..0000000 --- a/src/libcaptive/include/captive/ldr.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $Id$ - * Include file for reactos ldr/ (loader) emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_LDR_H -#define _CAPTIVE_LDR_H 1 - - -#include "captive/ldr.h" /* self */ -#include -#include "reactos/internal/ldr.h" -#include -#include "captive/options-module.h" - - -G_BEGIN_DECLS - -NTSTATUS captive_LdrpLoadAndCallImage(PMODULE_OBJECT *ModuleObjectp,struct captive_options_module *options_module, - PDRIVER_OBJECT DriverEntry_DriverObject,PUNICODE_STRING DriverEntry_RegistryPath); -NTSTATUS captive_LdrLoadModule(struct captive_options_module *options_module,PMODULE_OBJECT *ModuleObjectp); -struct captive_ModuleList_patchpoint *captive_ModuleList_patchpoint_find(gconstpointer ExportAddress); -G_CONST_RETURN gchar *captive_ModuleList_function_disable_find(gconstpointer ExportAddress); -void *captive_Module_GetExportAddress(const gchar *ModuleName_utf8,const gchar *FunctionName); - -/* reactos/ntoskrnl/ldr/loader.c file-scope global declaration: */ -/* Newlines prevent their inclusion by gtk-doc. */ -extern - LIST_ENTRY ModuleListHead; -extern - KSPIN_LOCK ModuleListLock; -extern - LIST_ENTRY ModuleTextListHead; - -/* po/shutdownwork.c: */ -void captive_PoQueueShutdownWorkItem_hooklist_invoke(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_LDR_H */ diff --git a/src/libcaptive/include/captive/ldr_exports.h b/src/libcaptive/include/captive/ldr_exports.h deleted file mode 100644 index 280e04c..0000000 --- a/src/libcaptive/include/captive/ldr_exports.h +++ /dev/null @@ -1,101 +0,0 @@ -/* $Id$ - * Include file for reactos ldr/ (loader) to be used from ke/exports.c of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_LDR_EXPORTS_H -#define _CAPTIVE_LDR_EXPORTS_H 1 - - -#include -/* NEVER include any captive/reactos include file as we are included - * from libcaptive/ke/exports.c which conflicts on any export symbol declaration. - */ - - -G_BEGIN_DECLS - -/** - * captive_kernel_exports: - * - * Export complete libcaptive modules to reactos. It is done by *.def files used - * by dlltool(1) of Mingw32 compiler suite. We use native host OS compiler and - * we also have just a limited set of functions over reactos itself. - * We use our captive_ModuleList_add_builtin() to simulate PE headers exporting - * our symbols; this export simulation is invocated from this function. - * - * This function is generated automatically from #exports.captivesym file - * by #captivesym.pl script. - * - * Multiple calls of this function are forbidden. See also captive_kernel_patches(). - * - * Returns: %TRUE if the export was successful. - */ -gboolean captive_kernel_exports(void); - - -/** - * captive_kernel_patches_debug: - * - * Patches W32 libraries by libcaptive functions. It is done by *.def files used - * by dlltool(1) of Mingw32 compiler suite. We use native host OS compiler and - * we also have just a limited set of functions over reactos itself. - * We use our captive_ModuleList_patch() to modify existing module function - * tables generated from captive_ModuleList_add_builtin(). - * - * This function is generated automatically from #exports.captivesym file - * by #captivesym.pl script. - * - * This function is used in --debug-messages mode as it also patches 'pass' - * functions to be successfuly debug dumped. - * - * Multiple calls of this function are forbidden. See also captive_kernel_exports(). - * - * Returns: %TRUE if the export was successful. - */ -gboolean captive_kernel_patches_debug(void); - - -/** - * captive_kernel_patches_nondebug: - * - * Function equivalent to captive_kernel_patches_debug() but it does not patch - * 'pass' functions as they are not needed to be traced if no --debug-messages - * was specified. See captive_kernel_patches_debug() for the description - * of this function. - * - * Returns: %TRUE if the export was successful. - */ -gboolean captive_kernel_patches_nondebug(void); - - -struct captive_ModuleList_patchpoint { - guint8 *orig_w32_func; /* direct pointer to W32 binary entry point */ - guint8 *orig_w32_2ndinstr; /* direct pointer to W32 binary second instruction after entry point */ - void (*wrap_wrap_func)(void); /* address of 'exports.c' debug-printing outer function */ - guint8 orig_w32_func_byte; - guint8 orig_w32_2ndinstr_byte; - gboolean through_w32_func; /* pass once through 'orig_w32_func' entry point without redirection to 'wrap_wrap_func' */ - }; - -gboolean captive_ModuleList_add_builtin(const gchar *FullName_utf8,...); -gboolean captive_ModuleList_patch(const gchar *FullName_utf8,...); - -G_END_DECLS - - -#endif /* _CAPTIVE_LDR_EXPORTS_H */ diff --git a/src/libcaptive/include/captive/leave.h b/src/libcaptive/include/captive/leave.h deleted file mode 100644 index 0c16813..0000000 --- a/src/libcaptive/include/captive/leave.h +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ - * Include file for code of leaving libcaptive to be called to cleanup W32 fs state - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_LEAVE_H -#define _CAPTIVE_LEAVE_H 1 - - -#include - - -G_BEGIN_DECLS - -void captive_leave(void); -typedef void (*captive_leave_func)(gpointer data); -void captive_leave_register(captive_leave_func func,gpointer data); -extern gboolean captive_cc_unmounting; - -G_END_DECLS - - -#endif /* _CAPTIVE_LEAVE_H */ diff --git a/src/libcaptive/include/captive/libxml.h b/src/libcaptive/include/captive/libxml.h deleted file mode 100644 index 2a23608..0000000 --- a/src/libcaptive/include/captive/libxml.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * Include file for supplementary captive utilities for libxml2 - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_LIBXML_H -#define _CAPTIVE_LIBXML_H 1 - - -#include -#include /* for xmlChar */ - - -G_BEGIN_DECLS - -enum captive_xml_text_reader_node_type { - CAPTIVE_XML_TEXT_READER_NODE_TYPE_START=1, - CAPTIVE_XML_TEXT_READER_NODE_TYPE_TEXT=3, - CAPTIVE_XML_TEXT_READER_NODE_TYPE_COMMENT=8, - CAPTIVE_XML_TEXT_READER_NODE_TYPE_SIGNIFICANT_WHITESPACE=14, - CAPTIVE_XML_TEXT_READER_NODE_TYPE_END=15, - }; - -struct captive_libxml_string_drop_stack; - -gint64 captive_libxml_sscanf_gint64(const char *gint64_string); -G_CONST_RETURN gchar *captive_libxml_string_drop(struct captive_libxml_string_drop_stack **drop_stackp,const xmlChar *xml_string); -void captive_libxml_string_drop_flush(struct captive_libxml_string_drop_stack **drop_stackp); - -G_END_DECLS - - -#endif /* _CAPTIVE_LIBXML_H */ diff --git a/src/libcaptive/include/captive/macros.h b/src/libcaptive/include/captive/macros.h deleted file mode 100644 index 8292a8f..0000000 --- a/src/libcaptive/include/captive/macros.h +++ /dev/null @@ -1,367 +0,0 @@ -/* $Id$ - * Include file with general macros and typedefs used through Captive project - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_MACROS_H -#define _CAPTIVE_MACROS_H 1 - - -#include -#include -#include -#include /* for memset() */ -#include -#include -#include /* for g_snprintf(); glib-2.2.x+ it also has in */ - - -G_BEGIN_DECLS - -/** - * CAPTIVE_FAKEUSE: - * - * Prevent 'might be used uninitialized' warning. - * Macro will fakes the use of the variable as sometimes GCC can't code flow - * analyse #C correctly. - * - * - * - * g_some_type some_variable CAPTIVE_FAKEUSE; - * - * - */ -#define CAPTIVE_FAKEUSE =0 - - -/** - * captive_newn: - * @objp: Variable with the pointer to the objects wished to be allocated. - * Original value is discarded. - * @n: Numbers of objects to be allocated. Value %0 is permitted (%NULL assignment effect). - * - * Macro to allocate @n objects of type *@objp and to assign the resulting pointer to @objp. - * Allocated memory may contain garbage. - * - * @Returns: Initialized @objp value as the memory of size #sizeof(typeof(*objp))*n. - * Value %NULL is returned iff @n==%0; - */ -#define captive_newn(objp,n) ((objp)=g_new(typeof(*(objp)),(n))) - - -/** - * captive_new0n: - * @objp: Variable with the pointer to the objects wished to be allocated and precleared. - * Original value is discarded. - * @n: Numbers of objects to be allocated. Value %0 is permitted (%NULL assignment effect). - * - * Macro to allocate @n objects of type *@objp and to assign the resulting pointer to @objp. - * Allocated memory is precleared. - * - * @Returns: Initialized @objp value as the cleared memory of size #sizeof(typeof(*objp))*n. - * Value %NULL is returned iff @n==%0; - */ -#define captive_new0n(objp,n) ((objp)=g_new0(typeof(*(objp)),(n))) - - -/** - * captive_renewn: - * @objp: Variable with the pointer to the objects wished to be reallocated. - * Value %NULL is permitted (g_malloc() effect). - * @n: Numbers of objects to be allocated. Value %0 is permitted (g_free() effect). - * - * Macro to reallocate the original memory stored in @objp - * to the size @n objects of type *@objp and to assign the resulting pointer to @objp. - * New allocated space may contain garbage. Both @objp and @n can be nonexclusively - * passed as zero. - * - * @Returns: Initialized @objp value as the memory of size #sizeof(typeof(*objp))*n. - * Value %NULL is returned iff @n==%0; - */ -#define captive_renewn(objp,n) ({ \ - typeof(&(objp)) _captive_renewn_objpp=&(objp); \ - *_captive_renewn_objpp=g_renew(typeof(*(objp)),*_captive_renewn_objpp,(n)); \ - (*_captive_renewn_objpp); \ - }) - - -/** - * captive_new: - * @objp: Variable with the pointer to the object wished to be allocated. - * Original value is discarded. - * - * Macro to allocate one object of type *@objp and to assign the resulting pointer to @objp. - * Allocated memory may contain garbage. Equivalent to captive_newn(objp,1) call. - * - * @Returns: Initialized @objp value as the memory of size #sizeof(typeof(*objp)). - * Value %NULL is never returned. - */ -#define captive_new(objp) (captive_newn((objp),1)) - - -/** - * captive_new0: - * @objp: Variable with the pointer to the object wished to be allocated and precleared. - * Original value is discarded. - * - * Macro to allocate one object of type *@objp and to assign the resulting pointer to @objp. - * Allocated memory is precleared. Equivalent to captive_new0n(objp,1) call. - * - * @Returns: Initialized @objp value as the cleared memory of size #sizeof(typeof(*objp)). - * Value %NULL is never returned. - */ -#define captive_new0(objp) (captive_new0n((objp),1)) - - -/** - * captive_newn_alloca: - * @objp: Variable with the pointer to the objects wished to be allocated. - * Original value is discarded. - * @n: Numbers of objects to be allocated. Value %0 is permitted (%NULL assignment effect). - * - * Macro to allocate @n objects of type *@objp and to assign the resulting pointer to @objp. - * Allocated memory may contain garbage. - * - * Memory is allocated on the stack frame by g_alloca() and it will be automatically deallocated - * during exit of current function (or current block if variable sized variables present there). - * You cannot deallocate or reallocate such memory in any other way. - * - * @Returns: Initialized @objp value as the memory of size #sizeof(typeof(*objp))*n. - * Value %NULL is returned iff @n==%0; - */ -#define captive_newn_alloca(objp,n) ({ \ - gsize _captive_newn_alloca_n=(n); \ - /* Fix 'g_alloca(0)!=NULL': */ \ - ((objp)=(!_captive_newn_alloca_n ? NULL : g_alloca(sizeof(*(objp))*_captive_newn_alloca_n))); \ - }) - - -/** - * captive_new0n_alloca: - * @objp: Variable with the pointer to the objects wished to be allocated and precleared. - * Original value is discarded. - * @n: Numbers of objects to be allocated. Value %0 is permitted (%NULL assignment effect). - * - * Macro to allocate @n objects of type *@objp and to assign the resulting pointer to @objp. - * Allocated memory is precleared. - * - * Memory is allocated on the stack frame by g_alloca() and it will be automatically deallocated - * during exit of current function (or current block if variable sized variables present there). - * You cannot deallocate or reallocate such memory in any other way. - * - * @Returns: Initialized @objp value as the cleared memory of size #sizeof(typeof(*objp))*n. - * Value %NULL is returned iff @n==%0; - */ -#define captive_new0n_alloca(objp,n) ({ \ - typeof(&(objp)) _captive_new0n_alloca_objpp=&(objp); \ - captive_newn_alloca(*_captive_new0n_alloca_objpp,(n)); \ - CAPTIVE_MEMZERO(*_captive_new0n_alloca_objpp); \ - (*_captive_new0n_alloca_objpp); \ - }) - - -/** - * captive_new_alloca: - * @objp: Variable with the pointer to the object wished to be allocated. - * Original value is discarded. - * - * Macro to allocate one object of type *@objp and to assign the resulting pointer to @objp. - * Allocated memory may contain garbage. Equivalent to captive_newn_alloca(objp,1) call. - * - * Memory is allocated on the stack frame by g_alloca() and it will be automatically deallocated - * during exit of current function (or current block if variable sized variables present there). - * You cannot deallocate or reallocate such memory in any other way. - * - * @Returns: Initialized @objp value as the memory of size #sizeof(typeof(*objp)). - * Value %NULL is never returned. - */ -#define captive_new_alloca(objp) (captive_newn_alloca((objp),1)) - - -/** - * captive_new0_alloca: - * @objp: Variable with the pointer to the object wished to be allocated and precleared. - * Original value is discarded. - * - * Macro to allocate one object of type *@objp and to assign the resulting pointer to @objp. - * Allocated memory is precleared. Equivalent to captive_new0n_alloca(objp,1) call. - * - * @Returns: Initialized @objp value as the cleared memory of size #sizeof(typeof(*objp)). - */ -#define captive_new0_alloca(objp) (captive_new0n_alloca((objp),1)) - - -/** - * captive_memdup: - * @destp: Variable with the pointer to the target object wished to be allocated. - * Original value is discarded. - * @srcp: Pointer to the source object to be copied to @destp. - * - * Macro to similiar to g_memdup() but the object size is detected automatically. - * Size of @destp object and @srcp object must be the same. - * - * You must free the allocated memory of @destp by g_free(). - * - * @Returns: Initialized @destp value as the copied memory of size #sizeof(typeof(*srcp)). - */ -#define captive_memdup(destp,srcp) ({ \ - typeof(&(destp)) _captive_captive_memdup_destpp=&(destp); \ - g_assert(sizeof(*(destp))==sizeof(*(srcp))); \ - captive_new(*_captive_captive_memdup_destpp); \ - memcpy(*_captive_captive_memdup_destpp,(srcp),sizeof(*(srcp))); \ - (*_captive_captive_memdup_destpp); \ - }) - - -/** - * captive_va_arg: - * @objp: Variable to be filled from the next argument of @ap. - * @ap: Initialized #va_list type. - * - * Automatically determines the size of @objp. - * Equivalent to objp=va_arg(ap,typeof(objp)) call. - * - * @Returns: Initialized @objp value. - */ -#define captive_va_arg(objp,ap) ((objp)=va_arg((ap),typeof(objp))) - - -/** - * CAPTIVE_MEMZERO: - * @objp: Pointer to the variable to be cleared. - * - * Clears the sizeof(*@objp) bytes of the given pointer with memset(). - * Pass _pointer_ to the object to be cleared. - */ -#define CAPTIVE_MEMZERO(objp) (memset((objp),0,sizeof(*(objp)))) - - -/** - * captive_printf_alloca: - * @format: Format string. See the sprintf() documentation. - * @args...: Arguments for @format. See the sprintf() documentation. - * - * Format the given format string @format as in sprintf(). - * Output buffer is allocated automatically and it does not need to be deallocated - * manually as it is managed by g_alloca(). - * - * @Returns: Formatted output string located in g_alloca() memory. - */ -#define captive_printf_alloca(format,args...) ({ \ - gsize _captive_printf_alloca_size=captive_nv_printf_string_upper_bound((format) , ## args); \ - gchar *_captive_printf_alloca_r=g_alloca(_captive_printf_alloca_size); \ - g_snprintf(_captive_printf_alloca_r,_captive_printf_alloca_size,(format) , ## args); \ - (const gchar *)_captive_printf_alloca_r; \ - }) -static inline gsize captive_nv_printf_string_upper_bound(const gchar *format,...) G_GNUC_PRINTF(1,0) G_GNUC_UNUSED; -static inline gsize captive_nv_printf_string_upper_bound(const gchar *format,...) -{ -va_list ap; -gsize r; - - va_start(ap,format); - r=g_printf_string_upper_bound(format,ap); - va_end(ap); - return r; -} - - -/** - * captive_strdup_alloca: - * @string: #const #gchar * string to duplicate. - * - * Macro to do g_strdup() equivalent in g_alloca() style. - * - * Memory is allocated on the stack frame by g_alloca() and it will be automatically deallocated - * during exit of current function (or current block if variable sized variables present there). - * You cannot deallocate or reallocate such memory in any other way. - * - * @Returns: Duplicated @string. You may modify its items if the length is not changed. - */ -#define captive_strdup_alloca(string) ({ \ - const gchar *_captive_strdup_alloca_string=(string); \ - const gchar *_captive_strdup_alloca_r=g_alloca(strlen(_captive_strdup_alloca_string)+1); \ - strcpy((gchar *)_captive_strdup_alloca_r,_captive_strdup_alloca_string); \ - (const gchar *)(_captive_strdup_alloca_r); \ - }) - - -/** - * CAPTIVE_ROUND_DOWN: - * @pointer: Arbitrary pointer type. - * @fragment: Amount of 'sizeof(char)' to align @pointer down to. - * This size will be typically a power of 2. - * Value less or equal to %0 is forbidden. - * - * General pointer down-rounding macro. Already aligned pointer is left as is. - * - * glib NOTE: YOU MAY NOT STORE POINTERS IN INTEGERS. - * - * @Returns: Down-rounded @pointer to the integer multiple of @fragment. - * Resulting pointer has the same type as @pointer. - */ -#define CAPTIVE_ROUND_DOWN(pointer,fragment) \ - ((typeof(pointer))(((guint32)(pointer))-CAPTIVE_ROUND_DOWN_EXCEEDING((pointer),(fragment)))) -#define CAPTIVE_ROUND_DOWN64(pointer,fragment) \ - ((typeof(pointer))(((guint64)(pointer))-CAPTIVE_ROUND_DOWN_EXCEEDING64((pointer),(fragment)))) - - -/** - * CAPTIVE_ROUND_DOWN_EXCEEDING: - * @pointer: Arbitrary pointer type. - * @fragment: Amount of 'sizeof(char)' to detect down-alignment amount of @pointer for. - * This size will be typically a power of 2. - * Value less or equal to %0 is forbidden. - * - * Detects current non-aligned amount of data exceeding over integer multiple of @fragment. - * It will return value %0 for an aligned pointer. - * - * glib NOTE: YOU MAY NOT STORE POINTERS IN INTEGERS. - * - * @Returns: #gsize typed number of bytes exceeding over integer multiple of @fragment. - */ -#define CAPTIVE_ROUND_DOWN_EXCEEDING(pointer,fragment) \ - ((gsize)(((guint32)(pointer))%(fragment))) -#define CAPTIVE_ROUND_DOWN_EXCEEDING64(pointer,fragment) \ - ((gsize)(((guint64)(pointer))%(fragment))) - - -/** - * CAPTIVE_ROUND_UP: - * @pointer: Arbitrary pointer type. - * @fragment: Amount of 'sizeof(char)' to align @pointer up to. - * This size will be typically a power of 2. - * Value less or equal to %0 is forbidden. - * - * General pointer up-rounding macro. Already aligned pointer is left as is. - * - * glib NOTE: YOU MAY NOT STORE POINTERS IN INTEGERS. - * - * @Returns: Up-rounded @pointer to the integer multiple of @fragment. - * Resulting pointer has the same type as @pointer. - */ -#define CAPTIVE_ROUND_UP(pointer,fragment) \ - /* new retyping as 'pointer' gets passed as 'char *' to CAPTIVE_ROUND_DOWN(). */ \ - ((typeof(pointer))(CAPTIVE_ROUND_DOWN(((guint32)(pointer))+(fragment)-1,(fragment)))) -#define CAPTIVE_ROUND_UP64(pointer,fragment) \ - /* new retyping as 'pointer' gets passed as 'char *' to CAPTIVE_ROUND_DOWN(). */ \ - ((typeof(pointer))(CAPTIVE_ROUND_DOWN64(((guint64)(pointer))+(fragment)-1,(fragment)))) - -G_END_DECLS - - -#endif /* _CAPTIVE_MACROS_H */ diff --git a/src/libcaptive/include/captive/mm.h b/src/libcaptive/include/captive/mm.h deleted file mode 100644 index b075a57..0000000 --- a/src/libcaptive/include/captive/mm.h +++ /dev/null @@ -1,38 +0,0 @@ -/* $Id$ - * Include file for reactos memory management emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_MM_H -#define _CAPTIVE_MM_H 1 - - -#include -#include "reactos/ntos/types.h" /* for ULONG */ - - -G_BEGIN_DECLS - -gint captive_flProtect_to_mmap_prot(ULONG flProtect) G_GNUC_CONST; -gboolean captive_mmap_map_new(gconstpointer addr,size_t len,int mmap_prot); -gint captive_mmap_map_get(gconstpointer addr); -gboolean captive_mmap_map_set(gconstpointer addr,int mmap_prot); - -G_END_DECLS - - -#endif /* _CAPTIVE_MM_H */ diff --git a/src/libcaptive/include/captive/options-module.h b/src/libcaptive/include/captive/options-module.h deleted file mode 100644 index aee9eeb..0000000 --- a/src/libcaptive/include/captive/options-module.h +++ /dev/null @@ -1,62 +0,0 @@ -/* $Id$ - * Include file with captive_options_module definition of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_OPTIONS_MODULE_H -#define _CAPTIVE_CLIENT_OPTIONS_MODULE_H 1 - - -#include -#include -#include -#include - - -G_BEGIN_DECLS - -enum captive_options_module_type { - CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY, - CAPTIVE_OPTIONS_MODULE_TYPE_PE32, - CAPTIVE_OPTIONS_MODULE_TYPE_GMODULE, - }; - -struct captive_options_module { - gchar *pathname_utf8; - enum captive_options_module_type type; - union { - struct { - guint8 *base; - size_t length; - gboolean mapped; /* otherwise g_malloc()ed */ - gchar *md5; - } pe32; - struct { - gchar *pathname; - } gmodule; - } u; - }; - -/* Functions handle just the fields, not the structure itself. */ -gboolean captive_options_module_load(struct captive_options_module *options_module,const gchar *pathname_utf8); -void captive_options_module_copy(struct captive_options_module *dest,const struct captive_options_module *src); -void captive_options_module_free(struct captive_options_module *options_module); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_OPTIONS_MODULE_H */ diff --git a/src/libcaptive/include/captive/options.h b/src/libcaptive/include/captive/options.h deleted file mode 100644 index 02b4124..0000000 --- a/src/libcaptive/include/captive/options.h +++ /dev/null @@ -1,84 +0,0 @@ -/* $Id$ - * Include file with captive_options definition of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_CLIENT_OPTIONS_H -#define _CAPTIVE_CLIENT_OPTIONS_H 1 - - -#include -#include -#include -#include -#include "captive/options-module.h" - - -G_BEGIN_DECLS - -extern const struct poptOption captive_popt[]; -#define CAPTIVE_POPT_INCLUDE \ - { NULL,'\0',POPT_ARG_INCLUDE_TABLE,(struct poptOption *)&captive_popt,0,"Captive" } - - -enum captive_option_rwmode { - CAPTIVE_OPTION_RWMODE_RO, - CAPTIVE_OPTION_RWMODE_BLIND, - CAPTIVE_OPTION_RWMODE_RW, - }; -typedef - enum captive_option_rwmode captive_option_rwmode_t; - -enum captive_option_media { - CAPTIVE_OPTION_MEDIA_UNKNOWN, - CAPTIVE_OPTION_MEDIA_CDROM, - CAPTIVE_OPTION_MEDIA_DISK, - }; - -struct captive_options { - struct captive_options_module filesystem; - enum captive_option_rwmode rwmode; - enum captive_option_media media; - gboolean debug_messages; - GIOChannel *image_iochannel; - GList *load_module; /* of 'struct captive_options_module *' */ - gboolean sandbox; - char **sandbox_server_argv; - gchar *sandbox_server_ior; - gchar *bug_pathname; - int syslog_facility; /* LOG_*; -1 if not used */ - }; - -/** - * captive_options: - * - * Current options set in one CORBA sandboxed child. - * It is also set when run in non-CORBA debugging mode. - * Set to %NULL in the CORBA master process. - */ -extern struct captive_options *captive_options; - -/* Functions handle just the fields, not the structure itself. */ -void captive_options_init(struct captive_options *options); -void captive_options_copy(struct captive_options *dest,const struct captive_options *src); -void captive_options_free(struct captive_options *options); -gboolean captive_options_parse(struct captive_options *options,const gchar *captive_args); - -G_END_DECLS - - -#endif /* _CAPTIVE_CLIENT_OPTIONS_H */ diff --git a/src/libcaptive/include/captive/ps_reactos.h b/src/libcaptive/include/captive/ps_reactos.h deleted file mode 100644 index d733465..0000000 --- a/src/libcaptive/include/captive/ps_reactos.h +++ /dev/null @@ -1,57 +0,0 @@ -/* $Id$ - * Include file for processor support used also for reactos files for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_PS_REACTOS_H -#define _CAPTIVE_PS_REACTOS_H 1 - - -#include -/* captive/?*_reactos.h include files have forbidden any reactos/?* inclusions - * as they are being included by reactos/compat.h. - */ - - -G_BEGIN_DECLS - -struct _KTHREAD; - -/** - * captive_KPCR: - * - * #PCR (Processor Control Region) structure type. - * Returned by captive_KeGetCurrentKPCR(). - * - * This structure IS NOT binary compatible with reactos! - */ -typedef struct { - struct - /* newline to pass gtkdoc-scan */ - _KTHREAD *CurrentThread; - } captive_KPCR; - -/* NEVER put anything after 'typedef struct' closing '}' as it confuses gtkdoc-scan. */ -typedef captive_KPCR *captive_PKPCR; - - -captive_PKPCR captive_KeGetCurrentKPCR(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_PS_REACTOS_H */ diff --git a/src/libcaptive/include/captive/rtl-file.h b/src/libcaptive/include/captive/rtl-file.h deleted file mode 100644 index 0d0634e..0000000 --- a/src/libcaptive/include/captive/rtl-file.h +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ - * Include file for internal (rtl/) file handling utilities of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_RTL_FILE_H -#define _CAPTIVE_RTL_FILE_H 1 - - -#include -#include - - -G_BEGIN_DECLS - -gpointer captive_rtl_file_mmap(size_t *lenp,const gchar *path,int open_flags,int mmap_prot,int mmap_flags); -void captive_rtl_file_munmap(gpointer base); -gpointer captive_rtl_file_read(gint fd,gsize *bufsizep); - -G_END_DECLS - - -#endif /* _CAPTIVE_RTL_FILE_H */ diff --git a/src/libcaptive/include/captive/signal.h b/src/libcaptive/include/captive/signal.h deleted file mode 100644 index 48d9199..0000000 --- a/src/libcaptive/include/captive/signal.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $Id$ - * Include file for UNIX signal handling for processor emulation for support of ntoskrnl of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_SIGNAL_H -#define _CAPTIVE_SIGNAL_H 1 - - -#include - - -G_BEGIN_DECLS - -gboolean captive_signal_init(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_SIGNAL_H */ diff --git a/src/libcaptive/include/captive/storage.h b/src/libcaptive/include/captive/storage.h deleted file mode 100644 index f96b295..0000000 --- a/src/libcaptive/include/captive/storage.h +++ /dev/null @@ -1,58 +0,0 @@ -/* $Id$ - * Include file for reactos storage device drivers emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_STORAGE_H -#define _CAPTIVE_STORAGE_H 1 - - -#include -#include -#include "reactos/ntos/types.h" /* for ULONG */ - - -G_BEGIN_DECLS - -/** - * captive_image_iochannel - * - * The readl #GIOChannel to be used for accessing the disk image. - * It may be either directly #captive_options->image_iochannel - * or the wrapper by #giochannel-blind. - */ -extern GIOChannel *captive_image_iochannel; - - -/** - * captive_image_size: - * - * Size of #captive_image_iochannel. Empty files are rejected and therefore - * this value is always >0 after successful captive_init(). - * Value is detected by captive_giochannel_size(captive_image_iochannel). - */ -extern guint64 captive_image_size; - - -guint64 captive_giochannel_size(GIOChannel *channel); -gboolean captive_cdrom_init(void); -gboolean captive_disk_init(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_STORAGE_H */ diff --git a/src/libcaptive/include/captive/unicode.h b/src/libcaptive/include/captive/unicode.h deleted file mode 100644 index b93c1f0..0000000 --- a/src/libcaptive/include/captive/unicode.h +++ /dev/null @@ -1,102 +0,0 @@ -/* $Id$ - * Include file for unicode add-ons to reactos ntoskrnl/rtl/unicode.c for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_UNICODE_H -#define _CAPTIVE_UNICODE_H 1 - - -#include -#include -#include -#include "reactos/napi/types.h" /* for PUNICODE_STRING etc. */ -#include "reactos/ntos/rtltypes.h" /* for ANSI_STRING */ -#include /* for size_t and wchar_t */ -#include /* for gunichar */ - - -G_BEGIN_DECLS - -/** - * captive_UnicodeString_to_utf8_alloca: - * @string_UnicodeString: #PUNICODE_STRING type of string to convert. - * - * alloca(3)-based conversion from #PUNICODE_STRING to plain #utf8 string. - * - * @Returns: #const #gchar * alloca(3)ed converted string @string_UnicodeString. - */ -#define captive_UnicodeString_to_utf8_alloca(string_UnicodeString) \ - ({ /* GCC dependent */ \ - /* detect required memory size, g_alloca() cannot safely fail (really?) */ \ - gchar *mem=g_alloca(_captive_UnicodeString_to_utf8_alloca_internal_sizeof(string_UnicodeString)); \ - /* convert+copy the string to the prepared memory */ \ - _captive_UnicodeString_to_utf8_alloca_internal_fill(mem,string_UnicodeString); \ - (const gchar *)mem; \ - }) -size_t _captive_UnicodeString_to_utf8_alloca_internal_sizeof(const UNICODE_STRING *string_UnicodeString); -void _captive_UnicodeString_to_utf8_alloca_internal_fill(gchar *mem,const UNICODE_STRING *string_UnicodeString); - - -/** - * captive_utf8_to_UnicodeString_alloca: - * @string_utf8: #const #gchar * string in #utf8 to convert. - * - * alloca(3)-based conversion from plain #utf8 string to #PUNICODE_STRING. - * - * @Returns: #PUNICODE_STRING alloca(3)ed converted string @string_utf8. - */ -#define captive_utf8_to_UnicodeString_alloca(string_utf8) \ - ({ /* GCC dependent */ \ - /* detect required memory size, g_alloca() cannot safely fail (really?) */ \ - UNICODE_STRING *mem=g_alloca(_captive_utf8_to_UnicodeString_alloca_internal_sizeof(string_utf8)); \ - /* convert+copy the string to the prepared memory */ \ - _captive_utf8_to_UnicodeString_alloca_internal_fill(mem,string_utf8); \ - (PUNICODE_STRING)mem; \ - }) -size_t _captive_utf8_to_UnicodeString_alloca_internal_sizeof(const gchar *string_utf8); -void _captive_utf8_to_UnicodeString_alloca_internal_fill(UNICODE_STRING *mem,const gchar *string_utf8); - - -gboolean captive_validate_ucs4(const gunichar *string_ucs4); -gboolean captive_validate_ucs2(const captive_ucs2 *string_ucs2); -gboolean captive_validate_ucs2_fixlen(const captive_ucs2 *string_ucs2,glong string_ucs2_fixlen); -gboolean captive_validate_utf8(const gchar *string_utf8); -glong captive_ucs2_strlen(const captive_ucs2 *string_ucs2) G_GNUC_PURE; -gboolean captive_validate_UnicodeString(const UNICODE_STRING *string_UnicodeString); -gboolean captive_validate_UnicodeString_noterm(const UNICODE_STRING *string_UnicodeString_noterm); -gboolean captive_validate_AnsiString(const ANSI_STRING *string_AnsiString); -gchar *captive_UnicodeString_to_utf8_malloc(const UNICODE_STRING *string_UnicodeString); -PUNICODE_STRING captive_utf8_to_UnicodeString_malloc(const gchar *string_utf8); -/* We can be G_GNUC_CONST as we really just map the pointer values. - * Initially we create the result content from the input content but it should not harm. - */ -const gunichar2 *captive_ucs4_to_utf16_const(const gunichar *string_ucs4) G_GNUC_CONST; -gboolean captive_ucs2_compare(const captive_ucs2 *string_a_ucs2,const captive_ucs2 *string_b_ucs2); -gboolean captive_UnicodeString_compare - (const UNICODE_STRING *string_a_UnicodeString,const UNICODE_STRING *string_b_UnicodeString); -gboolean captive_ucs2_compare_insensitive(const captive_ucs2 *string_a_ucs2,const captive_ucs2 *string_b_ucs2); -gboolean captive_UnicodeString_compare_insensitive - (const UNICODE_STRING *string_a_UnicodeString,const UNICODE_STRING *string_b_UnicodeString); - -/* internal: */ -void captive_FsRtlLegalAnsiCharacterArray_init(void); - -G_END_DECLS - - -#endif /* _CAPTIVE_UNICODE_H */ diff --git a/src/libcaptive/include/captive/unicode_reactos.h b/src/libcaptive/include/captive/unicode_reactos.h deleted file mode 100644 index fd53a38..0000000 --- a/src/libcaptive/include/captive/unicode_reactos.h +++ /dev/null @@ -1,76 +0,0 @@ -/* $Id$ - * Include file for unicode support used also for reactos files for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_UNICODE_REACTOS_H -#define _CAPTIVE_UNICODE_REACTOS_H 1 - - -#include /* for guint16 */ -#include /* for gunichar */ -/* captive/?*_reactos.h include files have forbidden any reactos/?* inclusions - * as they are being included by reactos/compat.h. - */ - - -G_BEGIN_DECLS - -/** - * captive_ucs2: - * - * This type is separated from Gnome #gunichar2 as #captive_ucs2 MUST be used for UCS-2 - * encoded strings in the opposite of #gunichar2 beging used for UTF-16 encoded strings. - */ -typedef guint16 captive_ucs2; - - -/* We can be G_GNUC_CONST as we really just map the pointer values. - * Initially we create the result content from the input content but it should not harm. - */ -const captive_ucs2 *captive_ucs4_to_ucs2_const(const gunichar *string_ucs4) G_GNUC_CONST; - - -/** - * captive_wchar32_to_ucs2_const: - * @string_wchar32: #const #wchar_t * type of 32-bit #wchar_t persistent string to convert. - * This string MUST remain readable with the same content forever. - * This string MUST be convertible to UCS-2 string. - * - * Constant string conversion from 32-bit #wchar_t to 16-bit #wchar_t. - * You may not modify the result in any way. - * - * It is guaranteed to get two different string addresses for two different - * input addresses even if the input strings content is the same. - * Otherwise we would behave as #GCC option %-fmerge-constants which - * results in %C non-conforming behaviour. - * - * This function is a pure pass to captive_ucs4_to_ucs2_const() - * to implement proper type checking of the passed @string_wchar32. - * - * Returns: #const #captive_ucs2 * converted string @string_ucs4. - */ -static inline const captive_ucs2 *captive_wchar32_to_ucs2_const(const wchar_t *string_wchar32) G_GNUC_UNUSED; -static inline const captive_ucs2 *captive_wchar32_to_ucs2_const(const wchar_t *string_wchar32) -{ - return captive_ucs4_to_ucs2_const((const gunichar *)string_wchar32); -} - -G_END_DECLS - - -#endif /* _CAPTIVE_UNICODE_REACTOS_H */ diff --git a/src/libcaptive/include/captive/usecount.h b/src/libcaptive/include/captive/usecount.h deleted file mode 100644 index 41c731e..0000000 --- a/src/libcaptive/include/captive/usecount.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $Id$ - * Include file for usecounting for regular disk commits of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_USECOUNT_H -#define _CAPTIVE_USECOUNT_H 1 - - -#include - - -G_BEGIN_DECLS - -void captive_usecount(gint balance); - -G_END_DECLS - - -#endif /* _CAPTIVE_USECOUNT_H */ diff --git a/src/libcaptive/include/reactos/Makefile.am b/src/libcaptive/include/reactos/Makefile.am deleted file mode 100644 index d30f763..0000000 --- a/src/libcaptive/include/reactos/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# $Id$ -# automake source for reactos-include wrappers directory Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# This include/reactos/ exists to provide glue for including reactos -# include files. They are hard to include directly from the .c source file -# as they have unresolved include file dependencies (hard!) and also some -# compatibility cludges as for -fshort-wchar are needed. - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -SUBDIRS=ddk internal napi ntos - -noinst_HEADERS+= \ - compat.h \ - \ - base.h \ - defines.h \ - structs.h \ - unicode.h diff --git a/src/libcaptive/include/reactos/base.h b/src/libcaptive/include/reactos/base.h deleted file mode 100644 index 6755af4..0000000 --- a/src/libcaptive/include/reactos/base.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos base.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_BASE_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_BASE_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_BASE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_BASE_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_BASE_H -#define _CAPTIVE_REACTOS_BASE_H 1 - - -#include /* for wchar_t */ -/* #include "..." prefers current directory even if not specified by cpp -I. - * In the base $(top_srcdir)/src/libcaptive/include/reactos/ directory - * we must use #include <...> to prevent including ourselves. - */ -#include - - -#endif /* _CAPTIVE_REACTOS_BASE_H */ - -# if _CAPTIVE_REACTOS_BASE_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_BASE_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_BASE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_BASE_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/compat.h b/src/libcaptive/include/reactos/compat.h deleted file mode 100644 index 53ec6f0..0000000 --- a/src/libcaptive/include/reactos/compat.h +++ /dev/null @@ -1,378 +0,0 @@ -/* $Id$ - * Include file for GNU world compatibility with reactos include files for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -/* NEVER protect this include file with #ifndef/#define/#endif - * wrapper as we need to be included multiple times - * Despite this we still #define the symbol to be able to check it - */ -#ifdef _CAPTIVE_REACTOS_COMPAT_H -#undef _CAPTIVE_REACTOS_COMPAT_H -#define _CAPTIVE_REACTOS_COMPAT_H 2 -#else -#define _CAPTIVE_REACTOS_COMPAT_H 1 -#endif - -/* NEVER use #include in this file before all the #define-s are done - * as we pretend any nested #include "reactos/compat.h" automatically as 'succeeded'. - * NEVER use any #include inside !REACTOS_COMPAT condition branches. - * We never nest as the include is protected by #ifdef from reactos/?*.h includes. - */ -#ifdef _CAPTIVE_REACTOS_COMPAT_H_INSIDE -#error "$(top_srcdir)/src/libcaptive/include/reactos/compat.h MUST NOT NEST!" -#endif -#define _CAPTIVE_REACTOS_COMPAT_H_INSIDE 1 - - -/* reactos uses __declspec(dllimport) and __declspec(dllexport) - * which gets expanded to __attribute__($2) by -D in their Makefile GCC commandline. - */ -#ifdef REACTOS_COMPAT -#define __declspec(type) -#else -#undef __declspec -#endif - -/* It gets defined to __attribute__((fastcall)) by "ddk/ntddk.h". */ -#ifdef REACTOS_COMPAT -#define FASTCALL -#else -#undef FASTCALL -#endif - -/* It gets defined to __attribute__((stdcall)) by "base.h" and "ntos/types.h". */ -#ifdef REACTOS_COMPAT -#define STDCALL -#else -#undef STDCALL -#endif - -/* It gets defined to __attribute__((cdecl)) by "base.h" and "ntos/types.h"; should not hurt. */ -#ifdef REACTOS_COMPAT -#define CDECL -#else -#undef CDECL -#endif - -/* Get the system declarations as their original names. - * reactos will use the redefined ones below. - * If we would include later the system declarations would have captive_reactos_* - * names and system vs. reactos declarations would conflict again - just named captive_reactos_*. - * FIXME: Unfortunately we cannot include twice. - * If we do "reactos/X.h" include from libcaptive (not reactos) - * we already lost the possibility to use the optimized - * system macros as they are #define-d and we #undef them here. - * Fortunately there should also be a system declarations with the same - * name and we are satisfied with their non-inlined (=non-#define-d) versions. - */ -#include - -#ifdef REACTOS_COMPAT -#define wcscpy captive_reactos_wcscpy -#else -#undef wcscpy -#endif - -#ifdef REACTOS_COMPAT -#define wcscat captive_reactos_wcscat -#else -#undef wcscat -#endif - -#ifdef REACTOS_COMPAT -#define wcschr captive_reactos_wcschr -#else -#undef wcschr -#endif - -#ifdef REACTOS_COMPAT -#define wcsrchr captive_reactos_wcsrchr -#else -#undef wcsrchr -#endif - -#ifdef REACTOS_COMPAT -#define wcslen captive_reactos_wcslen -#else -#undef wcslen -#endif - -#ifdef REACTOS_COMPAT -#define wcscmp captive_reactos_wcscmp -#else -#undef wcscmp -#endif - -#ifdef REACTOS_COMPAT -#define _wcsicmp captive_reactos__wcsicmp -#else -#undef _wcsicmp -#endif - -#ifdef REACTOS_COMPAT -#define wcsncmp captive_reactos_wcsncmp -#else -#undef wcsncmp -#endif - -#ifdef REACTOS_COMPAT -#undef memchr -#define memchr captive_reactos_memchr -#else -#undef memchr -#endif - -#ifdef REACTOS_COMPAT -#undef memcpy -#define memcpy captive_reactos_memcpy -#else -#undef memcpy -#endif - -#ifdef REACTOS_COMPAT -#undef memmove -#define memmove captive_reactos_memmove -#else -#undef memmove -#endif - -#ifdef REACTOS_COMPAT -#undef memset -#define memset captive_reactos_memset -#else -#undef memset -#endif - -#ifdef REACTOS_COMPAT -#undef strcat -#define strcat captive_reactos_strcat -#else -#undef strcat -#endif - -#ifdef REACTOS_COMPAT -#undef strchr -#define strchr captive_reactos_strchr -#else -#undef strchr -#endif - -#ifdef REACTOS_COMPAT -#undef strcmp -#define strcmp captive_reactos_strcmp -#else -#undef strcmp -#endif - -#ifdef REACTOS_COMPAT -#undef strcpy -#define strcpy captive_reactos_strcpy -#else -#undef strcpy -#endif - -#ifdef REACTOS_COMPAT -#undef strlen -#define strlen captive_reactos_strlen -#else -#undef strlen -#endif - -#ifdef REACTOS_COMPAT -#undef strncat -#define strncat captive_reactos_strncat -#else -#undef strncat -#endif - -#ifdef REACTOS_COMPAT -#undef strncmp -#define strncmp captive_reactos_strncmp -#else -#undef strncmp -#endif - -#ifdef REACTOS_COMPAT -#undef strncpy -#define strncpy captive_reactos_strncpy -#else -#undef strncpy -#endif - -#ifdef REACTOS_COMPAT -#undef strrchr -#define strrchr captive_reactos_strrchr -#else -#undef strrchr -#endif - -#ifdef REACTOS_COMPAT -#undef strspn -#define strspn captive_reactos_strspn -#else -#undef strspn -#endif - -#ifdef REACTOS_COMPAT -#undef strstr -#define strstr captive_reactos_strstr -#else -#undef strstr -#endif - -#ifdef REACTOS_COMPAT -#undef iswdigit -#define iswdigit captive_reactos_iswdigit -#else -#undef iswdigit -#endif - -#ifdef REACTOS_COMPAT -#undef iswlower -#define iswlower captive_reactos_iswlower -#else -#undef iswlower -#endif - -#ifdef REACTOS_COMPAT -#undef iswxdigit -#define iswxdigit captive_reactos_iswxdigit -#else -#undef iswxdigit -#endif - -#ifdef REACTOS_COMPAT -#undef towlower -#define towlower captive_reactos_towlower -#else -#undef towlower -#endif - -#ifdef REACTOS_COMPAT -#undef towupper -#define towupper captive_reactos_towupper -#else -#undef towupper -#endif - -/* Place BEFORE "internal/debug.h" include as there is - * internal/debug.h->internal/ntoskrnl.h->ddk/ntddk.h->REACTOS_UCS2() - */ -#ifdef REACTOS_COMPAT -#include /* for wchar_t; Prevent declaration while REACTOS_COMPAT is active */ -/* You MUST include "captive/unicode_reactos.h" before wchar_t redefinition! */ -#include "captive/unicode_reactos.h" /* for captive_ucs4_to_ucs2_const() for crtdll/string.h/REACTOS_UCS2() and captive_ucs2 */ -#define wchar_t captive_ucs2 -#define REACTOS_UCS2(string_wchar32) (captive_wchar32_to_ucs2_const((string_wchar32))) -#else -#undef wchar_t -#undef REACTOS_UCS2 -#endif - -/* for internal/debug.h */ -#ifdef REACTOS_COMPAT -#define DBG 1 -#else -#undef DBG -#endif - -/* Defined platform as _WIN32 as it is checked by some reactos include files. - * I expect it is set by MingW32 as I didn't find it defined anywhere in reactos distribution. - */ -#ifdef REACTOS_COMPAT -#define _WIN32 1 -/* else _WIN64 1 */ -#else -#undef _WIN32 -#endif - - -/* reactos/ntos/security.h/'PACCESS_MODE' does not get defined if !__NT(OSKRNL|HAL)__ - */ -#if _CAPTIVE_REACTOS_COMPAT_H == 1 -#if !defined(__NTOSKRNL__) && !defined(__NTHAL__) -typedef /* ULONG: */ unsigned long ACCESS_MODE, *PACCESS_MODE; -#endif -#endif - - -/* -------------------------------- #include-s permitted now, #define-s forbidden - * See above #define _CAPTIVE_REACTOS_COMPAT_H_INSIDE in this file. - */ - - -/* Define CAPTIVE_CDECL and CAPTIVE_STDCALL call types macros. - * They do not need to be undefed as they are common to reactos and non-reactos code. - * These macros have to be #ifdef-ed inside reactos itself. - */ -#ifdef REACTOS_COMPAT -#include "captive/calltype_reactos.h" /* for CAPTIVE_CDECL and CAPTIVE_STDCALL */ -#endif - -/* Place AFTER REACTOS_UCS2 definition as there is - * internal/debug.h->internal/ntoskrnl.h->ddk/ntddk.h->REACTOS_UCS2() - * Some sources (reactos/ntoskrnl/ldr/loader.c) define NDEBUG themselves! - * We have to pre-define all the non-NDEBUG (=debug) macros for such source files. - */ -#ifdef REACTOS_COMPAT -#ifdef __NTOSKRNL__ /* Don't pollute the namespace outside ntoskrnl. */ -#include "reactos/internal/debug.h" -#endif -#endif - -#ifdef REACTOS_COMPAT -/* All invalid reactos definitions go to captive_reactos_* as trash */ -#define _KPCR captive_reactos__KPCR -#define KPCR captive_reactos_KPCR -#define PKPCR captive_reactos_PKPCR -#define _IKPCR captive_reactos__IKPCR -#define IKPCR captive_reactos_IKPCR -#define PIKPCR captive_reactos_PIKPCR -#define KeGetCurrentKPCR captive_reactos_KeGetCurrentKPCR -#include "reactos/internal/i386/ps.h" -#undef _KPCR -#undef KPCR -#undef PKPCR -#undef _IKPCR -#undef IKPCR -#undef PIKPCR -#undef KeGetCurrentKPCR -/* Usable libcaptive definition for reactos go to captive_*. - * Note we don't leave any defintion under its original symbol name - * just to make the whole mess a bit more sane. - */ -#include "captive/ps_reactos.h" -#define _KPCR captive__KPCR -#define KPCR captive_KPCR -#define PKPCR captive_PKPCR -#define _IKPCR captive__KPCR -#define IKPCR captive_KPCR -#define PIKPCR captive_PKPCR -#define KeGetCurrentKPCR captive_KeGetCurrentKPCR -#else -#undef _KPCR -#undef KPCR -#undef PKPCR -#undef _IKPCR -#undef IKPCR -#undef PIKPCR -#undef KeGetCurrentKPCR -#endif - - -#undef _CAPTIVE_REACTOS_COMPAT_H_INSIDE diff --git a/src/libcaptive/include/reactos/ddk/Makefile.am b/src/libcaptive/include/reactos/ddk/Makefile.am deleted file mode 100644 index 365dfd7..0000000 --- a/src/libcaptive/include/reactos/ddk/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -# $Id$ -# automake source for reactos-include wrappers ddk/ subdirectory Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -SUBDIRS=i386 - -noinst_HEADERS+= \ - class2.h \ - ccfuncs.h \ - cctypes.h \ - cmtypes.h \ - defines.h \ - exfuncs.h \ - extypes.h \ - fsfuncs.h \ - fstypes.h \ - iofuncs.h \ - iotypes.h \ - kefuncs.h \ - ketypes.h \ - mmfuncs.h \ - mmtypes.h \ - ntddscsi.h \ - ntddk.h \ - ntdef.h \ - ntifs.h \ - obfuncs.h \ - potypes.h \ - pnptypes.h \ - psfuncs.h \ - pstypes.h \ - scsi.h \ - sefuncs.h \ - setypes.h \ - srb.h \ - status.h \ - types.h diff --git a/src/libcaptive/include/reactos/ddk/ccfuncs.h b/src/libcaptive/include/reactos/ddk/ccfuncs.h deleted file mode 100644 index 603c81a..0000000 --- a/src/libcaptive/include/reactos/ddk/ccfuncs.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/ccfuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_CCFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_CCFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_CCFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_CCFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_CCFUNCS_H -#define _CAPTIVE_REACTOS_DDK_CCFUNCS_H 1 - - -#include "reactos/ddk/iotypes.h" /* for PFILE_OBJECT */ -#include "reactos/ddk/cctypes.h" /* for PCC_POST_DEFERRED_WRITE */ -#include "reactos/ddk/extypes.h" /* for ERESOURCE_THREAD */ -#include "ddk/ccfuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_CCFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_CCFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_CCFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_CCFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_CCFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/cctypes.h b/src/libcaptive/include/reactos/ddk/cctypes.h deleted file mode 100644 index 8a16958..0000000 --- a/src/libcaptive/include/reactos/ddk/cctypes.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/cctypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_CCTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_CCTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_CCTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_CCTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_CCTYPES_H -#define _CAPTIVE_REACTOS_DDK_CCTYPES_H 1 - - -#include "reactos/ddk/iotypes.h" /* for PFILE_OBJECT */ -#include "ddk/cctypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_CCTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_CCTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_CCTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_CCTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_CCTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/class2.h b/src/libcaptive/include/reactos/ddk/class2.h deleted file mode 100644 index 19b2986..0000000 --- a/src/libcaptive/include/reactos/ddk/class2.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/class2.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_CLASS2_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_CLASS2_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_CLASS2_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_CLASS2_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_CLASS2_H -#define _CAPTIVE_REACTOS_DDK_CLASS2_H 1 - - -#include "reactos/ddk/srb.h" -#include "reactos/ddk/scsi.h" /* for PINQUIRYDATA */ -#include "reactos/ddk/extypes.h" /* for NPAGED_LOOKASIDE_LIST */ -#include "ddk/class2.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_CLASS2_H */ - -# if _CAPTIVE_REACTOS_DDK_CLASS2_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_CLASS2_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_CLASS2_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_CLASS2_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/cmtypes.h b/src/libcaptive/include/reactos/ddk/cmtypes.h deleted file mode 100644 index b76c29e..0000000 --- a/src/libcaptive/include/reactos/ddk/cmtypes.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/cmtypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_CMTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_CMTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_CMTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_CMTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_CMTYPES_H -#define _CAPTIVE_REACTOS_DDK_CMTYPES_H 1 - - -#include "ddk/cmtypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_CMTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_CMTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_CMTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_CMTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_CMTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/defines.h b/src/libcaptive/include/reactos/ddk/defines.h deleted file mode 100644 index 311db09..0000000 --- a/src/libcaptive/include/reactos/ddk/defines.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/defines.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_DEFINES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_DEFINES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_DEFINES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_DEFINES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_DEFINES_H -#define _CAPTIVE_REACTOS_DDK_DEFINES_H 1 - - -#include "ddk/defines.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_DEFINES_H */ - -# if _CAPTIVE_REACTOS_DDK_DEFINES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_DEFINES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_DEFINES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_DEFINES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/exfuncs.h b/src/libcaptive/include/reactos/ddk/exfuncs.h deleted file mode 100644 index 22277ce..0000000 --- a/src/libcaptive/include/reactos/ddk/exfuncs.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/exfuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_EXFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_EXFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_EXFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_EXFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_EXFUNCS_H -#define _CAPTIVE_REACTOS_DDK_EXFUNCS_H 1 - - -#include "reactos/ddk/ntddk.h" /* for FASTCALL */ -#include "reactos/ddk/kefuncs.h" /* for KeInitializeEvent() */ -#include "ddk/exfuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_EXFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_EXFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_EXFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_EXFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_EXFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/extypes.h b/src/libcaptive/include/reactos/ddk/extypes.h deleted file mode 100644 index 069562c..0000000 --- a/src/libcaptive/include/reactos/ddk/extypes.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/extypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_EXTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_EXTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_EXTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_EXTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_EXTYPES_H -#define _CAPTIVE_REACTOS_DDK_EXTYPES_H 1 - - -#include "reactos/ddk/defines.h" /* for IMPORTED */ -#include "reactos/ntos/obtypes.h" /* for POBJECT_TYPE */ -#include "ddk/extypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_EXTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_EXTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_EXTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_EXTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_EXTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/fsfuncs.h b/src/libcaptive/include/reactos/ddk/fsfuncs.h deleted file mode 100644 index 0ef6c83..0000000 --- a/src/libcaptive/include/reactos/ddk/fsfuncs.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/fsfuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_FSFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_FSFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_FSFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_FSFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_FSFUNCS_H -#define _CAPTIVE_REACTOS_DDK_FSFUNCS_H 1 - - -#include "reactos/ddk/fstypes.h" /* for PFILE_LOCK */ -#include "reactos/ddk/setypes.h" /* for PSECURITY_SUBJECT_CONTEXT */ -#include "ddk/fsfuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_FSFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_FSFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_FSFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_FSFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_FSFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/fstypes.h b/src/libcaptive/include/reactos/ddk/fstypes.h deleted file mode 100644 index 12efef1..0000000 --- a/src/libcaptive/include/reactos/ddk/fstypes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/fstypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_FSTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_FSTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_FSTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_FSTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_FSTYPES_H -#define _CAPTIVE_REACTOS_DDK_FSTYPES_H 1 - - -#include "reactos/ddk/iotypes.h" /* for PFILE_OBJECT */ -#include "reactos/ddk/extypes.h" /* for FAST_MUTEX */ -#include "reactos/ntos/rtltypes.h" /* for RTL_SPLAY_LINKS */ -#include "ddk/fstypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_FSTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_FSTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_FSTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_FSTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_FSTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/i386/Makefile.am b/src/libcaptive/include/reactos/ddk/i386/Makefile.am deleted file mode 100644 index 95842b0..0000000 --- a/src/libcaptive/include/reactos/ddk/i386/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# $Id$ -# automake source for reactos-include wrappers ddk/i386/ subdirectory Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_HEADERS+= diff --git a/src/libcaptive/include/reactos/ddk/iofuncs.h b/src/libcaptive/include/reactos/ddk/iofuncs.h deleted file mode 100644 index 6399c06..0000000 --- a/src/libcaptive/include/reactos/ddk/iofuncs.h +++ /dev/null @@ -1,54 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/iofuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_IOFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_IOFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_IOFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_IOFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_IOFUNCS_H -#define _CAPTIVE_REACTOS_DDK_IOFUNCS_H 1 - - -#include "reactos/base.h" /* for STDCALL */ -#include "reactos/ddk/types.h" /* for PKIRQL */ -#include "reactos/napi/types.h" /* for NTSTATUS */ -#include "reactos/ddk/iotypes.h" /* for PADAPTER_OBJECT */ -#include "reactos/ntos/rtltypes.h" /* for PCONTROLLER_OBJECT */ -#include "reactos/ntos/zwtypes.h" /* for PFILE_FULL_EA_INFORMATION */ -#include "reactos/ddk/extypes.h" /* for WORK_QUEUE_TYPE */ -#include "reactos/ddk/ntddk.h" /* for FASTCALL */ -#include "ddk/iofuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_IOFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_IOFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_IOFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_IOFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_IOFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/iotypes.h b/src/libcaptive/include/reactos/ddk/iotypes.h deleted file mode 100644 index 0d52471..0000000 --- a/src/libcaptive/include/reactos/ddk/iotypes.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/iotypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_IOTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_IOTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_IOTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_IOTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_IOTYPES_H -#define _CAPTIVE_REACTOS_DDK_IOTYPES_H 1 - - -#include "reactos/ddk/defines.h" /* for IMPORTED */ -#include "reactos/ddk/cmtypes.h" /* for PKEY_VALUE_FULL_INFORMATION */ -#include "reactos/ddk/pnptypes.h" /* for DEVICE_RELATION_TYPE */ -#include "reactos/ddk/mmtypes.h" /* for PMDL */ -#include "reactos/ntos/obtypes.h" -#include "ddk/iotypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_IOTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_IOTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_IOTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_IOTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_IOTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/kefuncs.h b/src/libcaptive/include/reactos/ddk/kefuncs.h deleted file mode 100644 index 283664a..0000000 --- a/src/libcaptive/include/reactos/ddk/kefuncs.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/kefuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_KEFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_KEFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_KEFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_KEFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_KEFUNCS_H -#define _CAPTIVE_REACTOS_DDK_KEFUNCS_H 1 - - -#include "reactos/base.h" /* for STDCALL */ -#include "reactos/ddk/ketypes.h" /* for PKSPIN_LOCK */ -#include "reactos/ddk/ntddk.h" /* for FASTCALL */ -#include "ddk/kefuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_KEFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_KEFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_KEFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_KEFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_KEFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/ketypes.h b/src/libcaptive/include/reactos/ddk/ketypes.h deleted file mode 100644 index ee812a9..0000000 --- a/src/libcaptive/include/reactos/ddk/ketypes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/ketypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_KETYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_KETYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_KETYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_KETYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_KETYPES_H -#define _CAPTIVE_REACTOS_DDK_KETYPES_H 1 - - -#include "reactos/ddk/defines.h" /* for IMPORTED */ -#include "reactos/napi/types.h" /* for CSHORT */ -#include "reactos/ddk/types.h" /* for KPROCESSOR_MODE */ -#include "ddk/ketypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_KETYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_KETYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_KETYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_KETYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_KETYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/mmfuncs.h b/src/libcaptive/include/reactos/ddk/mmfuncs.h deleted file mode 100644 index 6ec3410..0000000 --- a/src/libcaptive/include/reactos/ddk/mmfuncs.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/mmfuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_MMFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_MMFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_MMFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_MMFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_MMFUNCS_H -#define _CAPTIVE_REACTOS_DDK_MMFUNCS_H 1 - - -#include "reactos/ddk/mmtypes.h" /* for PMDL */ -#include "reactos/ddk/iotypes.h" /* for PSECTION_OBJECT_POINTERS */ -#include "ddk/mmfuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_MMFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_MMFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_MMFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_MMFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_MMFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/mmtypes.h b/src/libcaptive/include/reactos/ddk/mmtypes.h deleted file mode 100644 index af4cc43..0000000 --- a/src/libcaptive/include/reactos/ddk/mmtypes.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/mmtypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_MMTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_MMTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_MMTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_MMTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_MMTYPES_H -#define _CAPTIVE_REACTOS_DDK_MMTYPES_H 1 - - -#include "ddk/mmtypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_MMTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_MMTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_MMTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_MMTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_MMTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/ntddk.h b/src/libcaptive/include/reactos/ddk/ntddk.h deleted file mode 100644 index f4d7521..0000000 --- a/src/libcaptive/include/reactos/ddk/ntddk.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/ntddk.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_NTDDK_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_NTDDK_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_NTDDK_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_NTDDK_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_NTDDK_H -#define _CAPTIVE_REACTOS_DDK_NTDDK_H 1 - - -#include "ddk/ntddk.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_NTDDK_H */ - -# if _CAPTIVE_REACTOS_DDK_NTDDK_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_NTDDK_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_NTDDK_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_NTDDK_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/ntddscsi.h b/src/libcaptive/include/reactos/ddk/ntddscsi.h deleted file mode 100644 index 7bbab7e..0000000 --- a/src/libcaptive/include/reactos/ddk/ntddscsi.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/ntddscsi.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_NTDDSCSI_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_NTDDSCSI_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_NTDDSCSI_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_NTDDSCSI_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_NTDDSCSI_H -#define _CAPTIVE_REACTOS_DDK_NTDDSCSI_H 1 - - -#include "ddk/ntddscsi.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_NTDDSCSI_H */ - -# if _CAPTIVE_REACTOS_DDK_NTDDSCSI_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_NTDDSCSI_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_NTDDSCSI_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_NTDDSCSI_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/ntdef.h b/src/libcaptive/include/reactos/ddk/ntdef.h deleted file mode 100644 index 9060c9c..0000000 --- a/src/libcaptive/include/reactos/ddk/ntdef.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/ntdef.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_NTDEF_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_NTDEF_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_NTDEF_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_NTDEF_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_NTDEF_H -#define _CAPTIVE_REACTOS_DDK_NTDEF_H 1 - - -#include "reactos/ddk/defines.h" /* for IMPORTED */ -#include "reactos/ddk/cmtypes.h" /* for PKEY_VALUE_FULL_INFORMATION */ -#include "reactos/ddk/pnptypes.h" /* for DEVICE_RELATION_TYPE */ -#include "reactos/ddk/mmtypes.h" /* for PMDL */ -#include "ddk/ntdef.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_NTDEF_H */ - -# if _CAPTIVE_REACTOS_DDK_NTDEF_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_NTDEF_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_NTDEF_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_NTDEF_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/ntifs.h b/src/libcaptive/include/reactos/ddk/ntifs.h deleted file mode 100644 index 75a4324..0000000 --- a/src/libcaptive/include/reactos/ddk/ntifs.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/ntifs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_NTIFS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_NTIFS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_NTIFS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_NTIFS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_NTIFS_H -#define _CAPTIVE_REACTOS_DDK_NTIFS_H 1 - - -#include "reactos/ddk/iotypes.h" /* for PFILE_OBJECT */ -#include "reactos/ddk/ccfuncs.h" -#include "reactos/ddk/fstypes.h" -#include "reactos/ddk/fsfuncs.h" -#include "ddk/ntifs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_NTIFS_H */ - -# if _CAPTIVE_REACTOS_DDK_NTIFS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_NTIFS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_NTIFS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_NTIFS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/obfuncs.h b/src/libcaptive/include/reactos/ddk/obfuncs.h deleted file mode 100644 index 3b3a7e9..0000000 --- a/src/libcaptive/include/reactos/ddk/obfuncs.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/obfuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_OBFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_OBFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_OBFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_OBFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_OBFUNCS_H -#define _CAPTIVE_REACTOS_DDK_OBFUNCS_H 1 - - -#include "reactos/ntos/zwtypes.h" /* for POBJECT_NAME_INFORMATION */ -#include "ddk/obfuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_OBFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_OBFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_OBFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_OBFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_OBFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/pnptypes.h b/src/libcaptive/include/reactos/ddk/pnptypes.h deleted file mode 100644 index bf5bc88..0000000 --- a/src/libcaptive/include/reactos/ddk/pnptypes.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/pnptypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_PNPTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_PNPTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_PNPTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_PNPTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_PNPTYPES_H -#define _CAPTIVE_REACTOS_DDK_PNPTYPES_H 1 - - -#include "reactos/ddk/potypes.h" /* for DEVICE_POWER_STATE */ -#include "reactos/ddk/ketypes.h" /* for KEVENT */ -#include "ddk/pnptypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_PNPTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_PNPTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_PNPTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_PNPTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_PNPTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/potypes.h b/src/libcaptive/include/reactos/ddk/potypes.h deleted file mode 100644 index 2b0e3b6..0000000 --- a/src/libcaptive/include/reactos/ddk/potypes.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/potypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_POTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_POTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_POTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_POTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_POTYPES_H -#define _CAPTIVE_REACTOS_DDK_POTYPES_H 1 - - -#include "ddk/potypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_POTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_POTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_POTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_POTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_POTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/psfuncs.h b/src/libcaptive/include/reactos/ddk/psfuncs.h deleted file mode 100644 index 2c32688..0000000 --- a/src/libcaptive/include/reactos/ddk/psfuncs.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/psfuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_PSFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_PSFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_PSFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_PSFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_PSFUNCS_H -#define _CAPTIVE_REACTOS_DDK_PSFUNCS_H 1 - - -#include "reactos/ddk/setypes.h" /* for PACCESS_TOKEN */ -#include "reactos/ntos/obtypes.h" /* for POBJECT_ATTRIBUTES */ -#include "reactos/ddk/kefuncs.h" /* for KeGetCurrentThread() for PsGetCurrentThread() */ -#include "ddk/psfuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_PSFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_PSFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_PSFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_PSFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_PSFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/pstypes.h b/src/libcaptive/include/reactos/ddk/pstypes.h deleted file mode 100644 index e95b4ed..0000000 --- a/src/libcaptive/include/reactos/ddk/pstypes.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/pstypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_PSTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_PSTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_PSTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_PSTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_PSTYPES_H -#define _CAPTIVE_REACTOS_DDK_PSTYPES_H 1 - - -#include "reactos/ddk/defines.h" /* for IMPORTED */ -#include "reactos/ntos/ntdef.h" /* for PACKED */ -#include "ddk/pstypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_PSTYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_PSTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_PSTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_PSTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_PSTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/scsi.h b/src/libcaptive/include/reactos/ddk/scsi.h deleted file mode 100644 index d7a6259..0000000 --- a/src/libcaptive/include/reactos/ddk/scsi.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/scsi.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_SCSI_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_SCSI_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_SCSI_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_SCSI_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_SCSI_H -#define _CAPTIVE_REACTOS_DDK_SCSI_H 1 - - -#include "ddk/scsi.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_SCSI_H */ - -# if _CAPTIVE_REACTOS_DDK_SCSI_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_SCSI_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_SCSI_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_SCSI_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/sefuncs.h b/src/libcaptive/include/reactos/ddk/sefuncs.h deleted file mode 100644 index 2aac4a2..0000000 --- a/src/libcaptive/include/reactos/ddk/sefuncs.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/sefuncs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_SEFUNCS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_SEFUNCS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_SEFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_SEFUNCS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_SEFUNCS_H -#define _CAPTIVE_REACTOS_DDK_SEFUNCS_H 1 - - -#include "reactos/ntos/security.h" /* for PACL */ -#include "reactos/ddk/setypes.h" /* for SECURITY_SUBJECT_CONTEXT */ -#include "reactos/ntos/obtypes.h" /* for PACCESS_STATE */ -#include "ddk/sefuncs.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_SEFUNCS_H */ - -# if _CAPTIVE_REACTOS_DDK_SEFUNCS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_SEFUNCS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_SEFUNCS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_SEFUNCS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/setypes.h b/src/libcaptive/include/reactos/ddk/setypes.h deleted file mode 100644 index 18b4006..0000000 --- a/src/libcaptive/include/reactos/ddk/setypes.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/setypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_SETYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_SETYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_SETYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_SETYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_SETYPES_H -#define _CAPTIVE_REACTOS_DDK_SETYPES_H 1 - - -#include "ddk/setypes.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_SETYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_SETYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_SETYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_SETYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_SETYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/srb.h b/src/libcaptive/include/reactos/ddk/srb.h deleted file mode 100644 index 4f069a5..0000000 --- a/src/libcaptive/include/reactos/ddk/srb.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/srb.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_SRB_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_SRB_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_SRB_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_SRB_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_SRB_H -#define _CAPTIVE_REACTOS_DDK_SRB_H 1 - - -#include "reactos/ntos/haltypes.h" /* for DMA_WIDTH */ -#include "ddk/srb.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_SRB_H */ - -# if _CAPTIVE_REACTOS_DDK_SRB_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_SRB_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_SRB_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_SRB_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/status.h b/src/libcaptive/include/reactos/ddk/status.h deleted file mode 100644 index 4236ef3..0000000 --- a/src/libcaptive/include/reactos/ddk/status.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/status.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_STATUS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_STATUS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_STATUS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_STATUS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_STATUS_H -#define _CAPTIVE_REACTOS_DDK_STATUS_H 1 - - -#include "ddk/status.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_STATUS_H */ - -# if _CAPTIVE_REACTOS_DDK_STATUS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_STATUS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_STATUS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_STATUS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ddk/types.h b/src/libcaptive/include/reactos/ddk/types.h deleted file mode 100644 index 18d9289..0000000 --- a/src/libcaptive/include/reactos/ddk/types.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ddk/types.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DDK_TYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DDK_TYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DDK_TYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_TYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DDK_TYPES_H -#define _CAPTIVE_REACTOS_DDK_TYPES_H 1 - - -#include "ddk/types.h" - - -#endif /* _CAPTIVE_REACTOS_DDK_TYPES_H */ - -# if _CAPTIVE_REACTOS_DDK_TYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DDK_TYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DDK_TYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DDK_TYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/defines.h b/src/libcaptive/include/reactos/defines.h deleted file mode 100644 index f759560..0000000 --- a/src/libcaptive/include/reactos/defines.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos defines.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_DEFINES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_DEFINES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_DEFINES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DEFINES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_DEFINES_H -#define _CAPTIVE_REACTOS_DEFINES_H 1 - - -#include "reactos/defines.h" /* for LF_FACESIZE */ -/* #include "..." prefers current directory even if not specified by cpp -I. - * In the base $(top_srcdir)/src/libcaptive/include/reactos/ directory - * we must use #include <...> to prevent including ourselves. - */ -#include - - -#endif /* _CAPTIVE_REACTOS_DEFINES_H */ - -# if _CAPTIVE_REACTOS_DEFINES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_DEFINES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_DEFINES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_DEFINES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/Makefile.am b/src/libcaptive/include/reactos/internal/Makefile.am deleted file mode 100644 index 9041fb8..0000000 --- a/src/libcaptive/include/reactos/internal/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -# $Id$ -# automake source for reactos-include wrappers internal/ subdirectory Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -SUBDIRS=i386 - -noinst_HEADERS+= \ - cc.h \ - debug.h \ - ex.h \ - io.h \ - kd.h \ - ke.h \ - ldr.h \ - mm.h \ - module.h \ - ntoskrnl.h \ - ps.h \ - safe.h \ - se.h diff --git a/src/libcaptive/include/reactos/internal/cc.h b/src/libcaptive/include/reactos/internal/cc.h deleted file mode 100644 index 457f310..0000000 --- a/src/libcaptive/include/reactos/internal/cc.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/cc.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_CC_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_CC_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_CC_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_CC_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_CC_H -#define _CAPTIVE_REACTOS_INTERNAL_CC_H 1 - - -#include "reactos/ddk/ntifs.h" -#include "internal/cc.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_CC_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_CC_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_CC_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_CC_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_CC_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/debug.h b/src/libcaptive/include/reactos/internal/debug.h deleted file mode 100644 index ca83a11..0000000 --- a/src/libcaptive/include/reactos/internal/debug.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/debug.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_DEBUG_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_DEBUG_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_DEBUG_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_DEBUG_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_DEBUG_H -#define _CAPTIVE_REACTOS_INTERNAL_DEBUG_H 1 - - -#include "reactos/ddk/kefuncs.h" /* for KeBugCheck() */ -#include "internal/debug.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_DEBUG_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_DEBUG_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_DEBUG_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_DEBUG_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_DEBUG_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/ex.h b/src/libcaptive/include/reactos/internal/ex.h deleted file mode 100644 index a0a36e4..0000000 --- a/src/libcaptive/include/reactos/internal/ex.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/ex.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_EX_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_EX_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_EX_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_EX_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_EX_H -#define _CAPTIVE_REACTOS_INTERNAL_EX_H 1 - - -#include "internal/ex.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_EX_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_EX_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_EX_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_EX_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_EX_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/i386/Makefile.am b/src/libcaptive/include/reactos/internal/i386/Makefile.am deleted file mode 100644 index f96d840..0000000 --- a/src/libcaptive/include/reactos/internal/i386/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# $Id$ -# automake source for reactos-include wrappers internal/i386/ subdirectory Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_HEADERS+= \ - ps.h diff --git a/src/libcaptive/include/reactos/internal/i386/ps.h b/src/libcaptive/include/reactos/internal/i386/ps.h deleted file mode 100644 index 3aaad5f..0000000 --- a/src/libcaptive/include/reactos/internal/i386/ps.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/i386/ps.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_I386_PS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_I386_PS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_I386_PS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_I386_PS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_I386_PS_H -#define _CAPTIVE_REACTOS_INTERNAL_I386_PS_H 1 - - -#include "reactos/ntos/types.h" /* for PVOID etc. */ -#include "reactos/ddk/types.h" /* for KIRQL */ -#include "reactos/napi/types.h" /* for NTSTATUS */ -#include "reactos/ddk/pstypes.h" /* for PKSTART_ROUTINE */ -#include "internal/i386/ps.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_I386_PS_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_I386_PS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_I386_PS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_I386_PS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_I386_PS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/io.h b/src/libcaptive/include/reactos/internal/io.h deleted file mode 100644 index 46a1fe1..0000000 --- a/src/libcaptive/include/reactos/internal/io.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/io.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_IO_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_IO_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_IO_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_IO_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_IO_H -#define _CAPTIVE_REACTOS_INTERNAL_IO_H 1 - - -#include "internal/io.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_IO_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_IO_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_IO_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_IO_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_IO_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/kd.h b/src/libcaptive/include/reactos/internal/kd.h deleted file mode 100644 index 13c0beb..0000000 --- a/src/libcaptive/include/reactos/internal/kd.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/kd.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_KD_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_KD_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_KD_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_KD_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_KD_H -#define _CAPTIVE_REACTOS_INTERNAL_KD_H 1 - - -#include "reactos/internal/ke.h" /* for PFILE_OBJECT */ -#include "internal/kd.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_KD_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_KD_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_KD_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_KD_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_KD_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/ke.h b/src/libcaptive/include/reactos/internal/ke.h deleted file mode 100644 index dc8d26c..0000000 --- a/src/libcaptive/include/reactos/internal/ke.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/ke.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_KE_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_KE_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_KE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_KE_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_KE_H -#define _CAPTIVE_REACTOS_INTERNAL_KE_H 1 - - -#include "reactos/ddk/iotypes.h" /* for PFILE_OBJECT */ -#include "reactos/ddk/ntifs.h" /* for PRTL_SPLAY_LINKS */ -#include "reactos/ntos/zwtypes.h" /* for KPROFILE_SOURCE */ -#include "internal/ke.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_KE_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_KE_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_KE_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_KE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_KE_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/ldr.h b/src/libcaptive/include/reactos/internal/ldr.h deleted file mode 100644 index c590573..0000000 --- a/src/libcaptive/include/reactos/internal/ldr.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/ldr.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_LDR_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_LDR_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_LDR_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_LDR_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_LDR_H -#define _CAPTIVE_REACTOS_INTERNAL_LDR_H 1 - - -#include "reactos/ntos/types.h" /* for WORD etc. */ -#include "internal/ldr.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_LDR_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_LDR_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_LDR_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_LDR_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_LDR_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/mm.h b/src/libcaptive/include/reactos/internal/mm.h deleted file mode 100644 index c86dc98..0000000 --- a/src/libcaptive/include/reactos/internal/mm.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/mm.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_MM_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_MM_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_MM_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_MM_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_MM_H -#define _CAPTIVE_REACTOS_INTERNAL_MM_H 1 - - -#include "internal/mm.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_MM_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_MM_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_MM_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_MM_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_MM_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/module.h b/src/libcaptive/include/reactos/internal/module.h deleted file mode 100644 index eed6391..0000000 --- a/src/libcaptive/include/reactos/internal/module.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/module.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_MODULE_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_MODULE_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_MODULE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_MODULE_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_MODULE_H -#define _CAPTIVE_REACTOS_INTERNAL_MODULE_H 1 - - -#include "internal/module.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_MODULE_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_MODULE_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_MODULE_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_MODULE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_MODULE_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/ntoskrnl.h b/src/libcaptive/include/reactos/internal/ntoskrnl.h deleted file mode 100644 index d49a65e..0000000 --- a/src/libcaptive/include/reactos/internal/ntoskrnl.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/ntoskrnl.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H -#define _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H 1 - - -#include "internal/ntoskrnl.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_NTOSKRNL_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/ps.h b/src/libcaptive/include/reactos/internal/ps.h deleted file mode 100644 index a791c90..0000000 --- a/src/libcaptive/include/reactos/internal/ps.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/ps.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_PS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_PS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_PS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_PS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_PS_H -#define _CAPTIVE_REACTOS_INTERNAL_PS_H 1 - - -#include "reactos/ntos/types.h" /* for PVOID etc. */ -#include "reactos/ddk/types.h" /* for KIRQL */ -#include "reactos/napi/types.h" /* for NTSTATUS */ -#include "reactos/ddk/pstypes.h" /* for PKSTART_ROUTINE */ -#include "internal/ps.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_PS_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_PS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_PS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_PS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_PS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/safe.h b/src/libcaptive/include/reactos/internal/safe.h deleted file mode 100644 index 829e18d..0000000 --- a/src/libcaptive/include/reactos/internal/safe.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/safe.h for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_SAFE_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_SAFE_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_SAFE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_SAFE_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_SAFE_H -#define _CAPTIVE_REACTOS_INTERNAL_SAFE_H 1 - - -#include "internal/safe.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_SAFE_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_SAFE_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_SAFE_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_SAFE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_SAFE_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/internal/se.h b/src/libcaptive/include/reactos/internal/se.h deleted file mode 100644 index ed67ba5..0000000 --- a/src/libcaptive/include/reactos/internal/se.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos internal/se.h for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_INTERNAL_SE_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_INTERNAL_SE_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_INTERNAL_SE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_SE_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_INTERNAL_SE_H -#define _CAPTIVE_REACTOS_INTERNAL_SE_H 1 - - -#include "reactos/ntos/obtypes.h" /* for POBJECT_TYPE */ -#include "internal/se.h" - - -#endif /* _CAPTIVE_REACTOS_INTERNAL_SE_H */ - -# if _CAPTIVE_REACTOS_INTERNAL_SE_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_INTERNAL_SE_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_INTERNAL_SE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_INTERNAL_SE_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/napi/Makefile.am b/src/libcaptive/include/reactos/napi/Makefile.am deleted file mode 100644 index f84567b..0000000 --- a/src/libcaptive/include/reactos/napi/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ -# automake source for reactos-include wrappers napi/ subdirectory Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_HEADERS+= \ - teb.h \ - types.h diff --git a/src/libcaptive/include/reactos/napi/teb.h b/src/libcaptive/include/reactos/napi/teb.h deleted file mode 100644 index 7355c46..0000000 --- a/src/libcaptive/include/reactos/napi/teb.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos napi/teb.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NAPI_TEB_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NAPI_TEB_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NAPI_TEB_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NAPI_TEB_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NAPI_TEB_H -#define _CAPTIVE_REACTOS_NAPI_TEB_H 1 - - -#include "napi/teb.h" - - -#endif /* _CAPTIVE_REACTOS_NAPI_TEB_H */ - -# if _CAPTIVE_REACTOS_NAPI_TEB_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NAPI_TEB_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NAPI_TEB_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NAPI_TEB_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/napi/types.h b/src/libcaptive/include/reactos/napi/types.h deleted file mode 100644 index 9ac228a..0000000 --- a/src/libcaptive/include/reactos/napi/types.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos napi/types.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NAPI_TYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NAPI_TYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NAPI_TYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NAPI_TYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NAPI_TYPES_H -#define _CAPTIVE_REACTOS_NAPI_TYPES_H 1 - - -#include "reactos/base.h" /* for LONG */ -#include "napi/types.h" - - -#endif /* _CAPTIVE_REACTOS_NAPI_TYPES_H */ - -# if _CAPTIVE_REACTOS_NAPI_TYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NAPI_TYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NAPI_TYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NAPI_TYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/Makefile.am b/src/libcaptive/include/reactos/ntos/Makefile.am deleted file mode 100644 index 34d94a6..0000000 --- a/src/libcaptive/include/reactos/ntos/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# $Id$ -# automake source for reactos-include wrappers ntos/ subdirectory Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_HEADERS+= \ - disk.h \ - except.h \ - haltypes.h \ - ntdef.h \ - obtypes.h \ - rtl.h \ - rtltypes.h \ - security.h \ - time.h \ - tss.h \ - types.h \ - zw.h \ - zwtypes.h diff --git a/src/libcaptive/include/reactos/ntos/disk.h b/src/libcaptive/include/reactos/ntos/disk.h deleted file mode 100644 index 6a78682..0000000 --- a/src/libcaptive/include/reactos/ntos/disk.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/disk.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_DISK_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_DISK_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_DISK_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_DISK_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_DISK_H -#define _CAPTIVE_REACTOS_NTOS_DISK_H 1 - - -#include "ntos/disk.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_DISK_H */ - -# if _CAPTIVE_REACTOS_NTOS_DISK_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_DISK_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_DISK_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_DISK_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/except.h b/src/libcaptive/include/reactos/ntos/except.h deleted file mode 100644 index e4c13c7..0000000 --- a/src/libcaptive/include/reactos/ntos/except.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/except.h for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_EXCEPT_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_EXCEPT_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_EXCEPT_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_EXCEPT_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_EXCEPT_H -#define _CAPTIVE_REACTOS_NTOS_EXCEPT_H 1 - - -#include "ntos/except.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_EXCEPT_H */ - -# if _CAPTIVE_REACTOS_NTOS_EXCEPT_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_EXCEPT_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_EXCEPT_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_EXCEPT_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/haltypes.h b/src/libcaptive/include/reactos/ntos/haltypes.h deleted file mode 100644 index 043cf1f..0000000 --- a/src/libcaptive/include/reactos/ntos/haltypes.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/haltypes.h for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_HALTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_HALTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_HALTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_HALTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_HALTYPES_H -#define _CAPTIVE_REACTOS_NTOS_HALTYPES_H 1 - - -#include "reactos/ddk/iotypes.h" /* for PDEVICE_OBJECT */ -#include "reactos/ntos/rtltypes.h" /* for PSTRING */ -#include "ntos/haltypes.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_HALTYPES_H */ - -# if _CAPTIVE_REACTOS_NTOS_HALTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_HALTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_HALTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_HALTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/ntdef.h b/src/libcaptive/include/reactos/ntos/ntdef.h deleted file mode 100644 index d550247..0000000 --- a/src/libcaptive/include/reactos/ntos/ntdef.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/ntdef.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_NTDEF_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_NTDEF_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_NTDEF_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_NTDEF_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_NTDEF_H -#define _CAPTIVE_REACTOS_NTOS_NTDEF_H 1 - - -#include "ntos/ntdef.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_NTDEF_H */ - -# if _CAPTIVE_REACTOS_NTOS_NTDEF_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_NTDEF_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_NTDEF_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_NTDEF_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/obtypes.h b/src/libcaptive/include/reactos/ntos/obtypes.h deleted file mode 100644 index 97be662..0000000 --- a/src/libcaptive/include/reactos/ntos/obtypes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/obtypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_OBTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_OBTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_OBTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_OBTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_OBTYPES_H -#define _CAPTIVE_REACTOS_NTOS_OBTYPES_H 1 - - -#include "reactos/ntos/security.h" /* for ACCESS_MASK */ -#include "reactos/ddk/setypes.h" /* for SECURITY_OPERATION_CODE */ -#include "reactos/ddk/ketypes.h" /* for PEPROCESS */ -#include "ntos/obtypes.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_OBTYPES_H */ - -# if _CAPTIVE_REACTOS_NTOS_OBTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_OBTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_OBTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_OBTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/rtl.h b/src/libcaptive/include/reactos/ntos/rtl.h deleted file mode 100644 index 05c4b15..0000000 --- a/src/libcaptive/include/reactos/ntos/rtl.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/rtl.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_RTL_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_RTL_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_RTL_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_RTL_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_RTL_H -#define _CAPTIVE_REACTOS_NTOS_RTL_H 1 - - -#include "reactos/ntos/types.h" /* for WORD etc. */ -#include "reactos/ddk/extypes.h" /* for PSLIST_HEADER */ -#include "reactos/ntos/rtltypes.h" /* for PRTL_ATOM_TABLE */ -#include "reactos/ntos/time.h" /* for PTIME_ZONE_INFORMATION */ -#include "ntos/rtl.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_RTL_H */ - -# if _CAPTIVE_REACTOS_NTOS_RTL_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_RTL_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_RTL_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_RTL_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/rtltypes.h b/src/libcaptive/include/reactos/ntos/rtltypes.h deleted file mode 100644 index dea8516..0000000 --- a/src/libcaptive/include/reactos/ntos/rtltypes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/rtltypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_RTLTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_RTLTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_RTLTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_RTLTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_RTLTYPES_H -#define _CAPTIVE_REACTOS_NTOS_RTLTYPES_H 1 - - -#include "reactos/ntos/types.h" /* for ULONG */ -#include "reactos/ddk/ketypes.h" /* for KDEVICE_QUEUE */ -#include "reactos/ddk/ntdef.h" /* for NTAPI */ -#include "ntos/rtltypes.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_RTLTYPES_H */ - -# if _CAPTIVE_REACTOS_NTOS_RTLTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_RTLTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_RTLTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_RTLTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/security.h b/src/libcaptive/include/reactos/ntos/security.h deleted file mode 100644 index 5c16db1..0000000 --- a/src/libcaptive/include/reactos/ntos/security.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/security.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_SECURITY_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_SECURITY_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_SECURITY_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_SECURITY_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_SECURITY_H -#define _CAPTIVE_REACTOS_NTOS_SECURITY_H 1 - - -#include "ntos/security.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_SECURITY_H */ - -# if _CAPTIVE_REACTOS_NTOS_SECURITY_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_SECURITY_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_SECURITY_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_SECURITY_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/time.h b/src/libcaptive/include/reactos/ntos/time.h deleted file mode 100644 index be51269..0000000 --- a/src/libcaptive/include/reactos/ntos/time.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/time.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_TIME_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_TIME_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_TIME_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_TIME_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_TIME_H -#define _CAPTIVE_REACTOS_NTOS_TIME_H 1 - - -#include "ntos/time.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_TIME_H */ - -# if _CAPTIVE_REACTOS_NTOS_TIME_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_TIME_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_TIME_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_TIME_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/tss.h b/src/libcaptive/include/reactos/ntos/tss.h deleted file mode 100644 index e2dac69..0000000 --- a/src/libcaptive/include/reactos/ntos/tss.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/tss.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_TSS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_TSS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_TSS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_TSS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_TSS_H -#define _CAPTIVE_REACTOS_NTOS_TSS_H 1 - - -#include "reactos/ntos/ntdef.h" /* for PACKED */ -#include "ntos/tss.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_TSS_H */ - -# if _CAPTIVE_REACTOS_NTOS_TSS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_TSS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_TSS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_TSS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/types.h b/src/libcaptive/include/reactos/ntos/types.h deleted file mode 100644 index 5b9d3b4..0000000 --- a/src/libcaptive/include/reactos/ntos/types.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/types.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_TYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_TYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_TYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_TYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_TYPES_H -#define _CAPTIVE_REACTOS_NTOS_TYPES_H 1 - - -#include "ntos/types.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_TYPES_H */ - -# if _CAPTIVE_REACTOS_NTOS_TYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_TYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_TYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_TYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/zw.h b/src/libcaptive/include/reactos/ntos/zw.h deleted file mode 100644 index ab13947..0000000 --- a/src/libcaptive/include/reactos/ntos/zw.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/zw.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_ZW_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_ZW_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_ZW_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_ZW_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_ZW_H -#define _CAPTIVE_REACTOS_NTOS_ZW_H 1 - - -#include "reactos/ntos/zwtypes.h" /* for KPRIORITY */ -#include "ntos/zw.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_ZW_H */ - -# if _CAPTIVE_REACTOS_NTOS_ZW_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_ZW_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_ZW_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_ZW_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/ntos/zwtypes.h b/src/libcaptive/include/reactos/ntos/zwtypes.h deleted file mode 100644 index a01e318..0000000 --- a/src/libcaptive/include/reactos/ntos/zwtypes.h +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos ntos/zwtypes.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_NTOS_ZWTYPES_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_NTOS_ZWTYPES_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_NTOS_ZWTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_ZWTYPES_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_NTOS_ZWTYPES_H -#define _CAPTIVE_REACTOS_NTOS_ZWTYPES_H 1 - - -#include "reactos/napi/teb.h" /* for CLIENT_ID */ -#include "reactos/ddk/extypes.h" /* for NPAGED_LOOKASIDE_LIST */ -#include "reactos/ddk/ketypes.h" /* for KPRIORITY */ -#include "ntos/zwtypes.h" - - -#endif /* _CAPTIVE_REACTOS_NTOS_ZWTYPES_H */ - -# if _CAPTIVE_REACTOS_NTOS_ZWTYPES_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_NTOS_ZWTYPES_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_NTOS_ZWTYPES_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_NTOS_ZWTYPES_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/structs.h b/src/libcaptive/include/reactos/structs.h deleted file mode 100644 index c1f3bbd..0000000 --- a/src/libcaptive/include/reactos/structs.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos structs.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_STRUCTS_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_STRUCTS_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_STRUCTS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_STRUCTS_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_STRUCTS_H -#define _CAPTIVE_REACTOS_STRUCTS_H 1 - - -#include "reactos/defines.h" /* for LF_FACESIZE */ -/* #include "..." prefers current directory even if not specified by cpp -I. - * In the base $(top_srcdir)/src/libcaptive/include/reactos/ directory - * we must use #include <...> to prevent including ourselves. - */ -#include - - -#endif /* _CAPTIVE_REACTOS_STRUCTS_H */ - -# if _CAPTIVE_REACTOS_STRUCTS_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_STRUCTS_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_STRUCTS_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_STRUCTS_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/include/reactos/unicode.h b/src/libcaptive/include/reactos/unicode.h deleted file mode 100644 index bef0c0e..0000000 --- a/src/libcaptive/include/reactos/unicode.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $Id$ - * GNU world compatibility wrapper for reactos unicode.h for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef REACTOS_COMPAT -#define REACTOS_COMPAT 1 -#define _CAPTIVE_REACTOS_UNICODE_H_REACTOS_COMPAT 1 -#include "reactos/compat.h" -#else -#ifdef _CAPTIVE_REACTOS_UNICODE_H_REACTOS_COMPAT -#undef _CAPTIVE_REACTOS_UNICODE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_UNICODE_H_REACTOS_COMPAT 2 -#endif -#endif - -#ifndef _CAPTIVE_REACTOS_UNICODE_H -#define _CAPTIVE_REACTOS_UNICODE_H 1 - - -#include /* for va_list */ -#include "reactos/structs.h" /* for LPDCB */ -/* #include "..." prefers current directory even if not specified by cpp -I. - * In the base $(top_srcdir)/src/libcaptive/include/reactos/ directory - * we must use #include <...> to prevent including ourselves. - */ -#include - - -#endif /* _CAPTIVE_REACTOS_UNICODE_H */ - -# if _CAPTIVE_REACTOS_UNICODE_H_REACTOS_COMPAT == 1 -#undef REACTOS_COMPAT -#include "reactos/compat.h" -#elif _CAPTIVE_REACTOS_UNICODE_H_REACTOS_COMPAT == 2 -#undef _CAPTIVE_REACTOS_UNICODE_H_REACTOS_COMPAT -#define _CAPTIVE_REACTOS_UNICODE_H_REACTOS_COMPAT 1 -#endif diff --git a/src/libcaptive/io/Makefile.am b/src/libcaptive/io/Makefile.am deleted file mode 100644 index 316ff76..0000000 --- a/src/libcaptive/io/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# $Id$ -# automake source for the reactos's io/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libio.la -libio_la_SOURCES= \ - create.c \ - device.c \ - iowork.c \ - irp.c \ - process.c \ - symlink.c diff --git a/src/libcaptive/io/create.c b/src/libcaptive/io/create.c deleted file mode 100644 index b61898f..0000000 --- a/src/libcaptive/io/create.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $Id$ - * reactos I/O streams management of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/iofuncs.h" /* self */ -#include -#include - - -/* map: (FILE_OBJECT *) -> GINT_TO_POINTER(1) */ -static GHashTable *captive_stream_file_object_hash; - -/* initialize 'captive_stream_file_object_hash' */ -static void captive_stream_file_object_hash_init(void) -{ - if (captive_stream_file_object_hash) - return; - captive_stream_file_object_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - - -BOOLEAN IoCreateStreamFileObjectLite_is_owner(FILE_OBJECT *FileObject) -{ - g_return_val_if_fail(FileObject!=NULL,FALSE); - - captive_stream_file_object_hash_init(); - - return !!g_hash_table_lookup(captive_stream_file_object_hash,FileObject); -} - - -void IoCreateStreamFileObjectLite_remove(FILE_OBJECT *FileObject) -{ -gboolean errbool; - - g_return_if_fail(FileObject!=NULL); - - captive_stream_file_object_hash_init(); - - errbool=g_hash_table_remove(captive_stream_file_object_hash,FileObject); - g_assert(errbool==TRUE); -} - - -PFILE_OBJECT IoCreateStreamFileObjectLite(IN PFILE_OBJECT FileObject OPTIONAL,IN PDEVICE_OBJECT DeviceObject OPTIONAL) -{ -FILE_OBJECT *r; - - captive_stream_file_object_hash_init(); - - r=IoCreateStreamFileObject(FileObject,DeviceObject); - g_return_val_if_fail(r!=NULL,NULL); - - g_assert(NULL==g_hash_table_lookup(captive_stream_file_object_hash,r)); /* paranoia sanity */ - - g_hash_table_insert(captive_stream_file_object_hash,r,GINT_TO_POINTER(1)); - - return r; -} diff --git a/src/libcaptive/io/device.c b/src/libcaptive/io/device.c deleted file mode 100644 index 0aaa444..0000000 --- a/src/libcaptive/io/device.c +++ /dev/null @@ -1,63 +0,0 @@ -/* $Id$ - * reactos devices management of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/iofuncs.h" /* self */ -#include - - -/* Driver in fs module loaded by captive_w32_init(). - * Located in: libcaptive/client/init.c - */ -extern DRIVER_OBJECT captive_DriverObject; -extern PDRIVER_REINITIALIZE captive_DriverObject_ReinitRoutine; -extern PVOID captive_DriverObject_ReinitRoutine_Context; - - -/** - * IoRegisterDriverReinitialization: - * @DriverObject: #DRIVER_OBJECT of the driver registering @ReinitRoutine. - * Exact unique #captive_DriverObject structure address required by libcaptive. - * @ReinitRoutine: Function to be later called back. - * %NULL value is forbidden. - * @Context: Arbitrary argument of @ReinitRoutine to be passed along. - * %NULL value is permitted. - * - * Register function to be called after the current initialization - * route of the filesystem returned. - * - * Initialization routine may call this function at most once. - * The callbacked @ReinitRoutine is allowed to call this function again - * ad infinitum. - */ -VOID IoRegisterDriverReinitialization(PDRIVER_OBJECT DriverObject,PDRIVER_REINITIALIZE ReinitRoutine,PVOID Context) -{ - g_return_if_fail(DriverObject!=NULL); - g_return_if_fail(ReinitRoutine!=NULL); - - /* libcaptive supports exactly one filesystem driver */ - g_return_if_fail(DriverObject==&captive_DriverObject); - - /* This function may be called at most once. */ - g_return_if_fail(captive_DriverObject_ReinitRoutine==NULL); - - captive_DriverObject_ReinitRoutine=ReinitRoutine; - captive_DriverObject_ReinitRoutine_Context=Context; -} diff --git a/src/libcaptive/io/iowork.c b/src/libcaptive/io/iowork.c deleted file mode 100644 index f42e2ac..0000000 --- a/src/libcaptive/io/iowork.c +++ /dev/null @@ -1,140 +0,0 @@ -/* $Id$ - * reactos IO_WORKITEM handling by libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/iofuncs.h" /* self */ -#include -#include "captive/macros.h" -#include "reactos/ddk/obfuncs.h" /* for ObDereferenceObject() */ -#include - - -typedef struct _IO_WORKITEM { - DEVICE_OBJECT *DeviceObject; - PIO_WORKITEM_ROUTINE WorkerRoutine; - VOID *Context; -} IO_WORKITEM; - - -/** - * IoAllocateWorkItem: - * @DeviceObject: Existing initialized #PDEVICE_OBJECT to bind with allocated #IO_WORKITEM. - * %NULL value is forbidden. - * - * Allocates and initializes the memory for #IO_WORKITEM. - * You may pass it to IoQueueWorkItem() later. At most one active IoQueueWorkItem() - * request may be pending for this returned #IO_WORKITEM. - * - * Returns: Allocated #IO_WORKITEM ready to be used by IoQueueWorkItem(). - */ -PIO_WORKITEM IoAllocateWorkItem(PDEVICE_OBJECT DeviceObject) -{ -IO_WORKITEM *r; - - g_return_val_if_fail(DeviceObject!=NULL,NULL); - - captive_new(r); - r->DeviceObject=DeviceObject; - r->WorkerRoutine=NULL; - - return r; -} - - -/** - * IoFreeWorkItem: - * @IoWorkItem: #IO_WORKITEM allocated by IoAllocateWorkItem(). - * %NULL value is forbidden. - * - * Frees the resources allocated for @IoWorkItem. - * No request by IoQueueWorkItem() may be pending. - */ -VOID IoFreeWorkItem(PIO_WORKITEM IoWorkItem) -{ - g_return_if_fail(IoWorkItem!=NULL); - g_return_if_fail(IoWorkItem->WorkerRoutine==NULL); /* no request should be pending */ - - g_free(IoWorkItem); -} - - -static gboolean IoQueueWorkItem_idlefunc(IO_WORKITEM *IoWorkItem /* data */) -{ - g_return_val_if_fail(IoWorkItem!=NULL,FALSE); /* false=>remove-me */ - g_return_val_if_fail(IoWorkItem->DeviceObject!=NULL,FALSE); /* false=>remove-me */ - g_return_val_if_fail(IoWorkItem->WorkerRoutine!=NULL,FALSE); /* false=>remove-me */ - - (*IoWorkItem->WorkerRoutine)(IoWorkItem->DeviceObject,IoWorkItem->Context); - ObDereferenceObject(IoWorkItem->DeviceObject); - IoWorkItem->WorkerRoutine=NULL; /* request is no longer pending */ - return FALSE; /* remove-me */ -} - -/** - * IoQueueWorkItem: - * @IoWorkItem: Allocated space of #IO_WORKITEM to be initialize. - * %NULL value is forbidden. - * @WorkerRoutine: Function address to call in the idle time. - * %NULL value is forbidden. - * @QueueType: Queue priority. - * @Context: Context pointer to pass to @WorkerRoutine during its invocation. - * %NULL value is permitted. - * - * Inserts a work item in a queue for one of the system worker threads to - * process. It will be processed through g_idle_add_full() with priority - * range %G_PRIORITY_DEFAULT+10 ... %G_PRIORITY_DEFAULT+30. - * - * At most one active IoQueueWorkItem() request per one @IoWorkItem may be pending. - */ -VOID IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, - IN PIO_WORKITEM_ROUTINE WorkerRoutine,IN WORK_QUEUE_TYPE QueueType,IN PVOID Context) -{ -gint priority; - - g_return_if_fail(IoWorkItem!=NULL); - g_return_if_fail(IoWorkItem->DeviceObject!=NULL); - g_return_if_fail(IoWorkItem->WorkerRoutine==NULL); /* no other request pending */ - g_return_if_fail(WorkerRoutine!=NULL); - - IoWorkItem->WorkerRoutine=WorkerRoutine; - IoWorkItem->Context=Context; - ObReferenceObjectByPointer(IoWorkItem->DeviceObject,FILE_ALL_ACCESS,NULL,KernelMode); - - switch (QueueType) { - case DelayedWorkQueue: - priority=G_PRIORITY_DEFAULT+30; /* positive towards G_PRIORITY_HIGH_IDLE */ - break; - case CriticalWorkQueue: - priority=G_PRIORITY_DEFAULT+20; /* positive towards G_PRIORITY_HIGH_IDLE */ - break; - case HyperCriticalWorkQueue: - priority=G_PRIORITY_DEFAULT+10; /* positive towards G_PRIORITY_HIGH_IDLE */ - break; - default: - g_assert_not_reached(); - priority=G_PRIORITY_DEFAULT; - } - - g_idle_add_full( - priority, /* priority */ - (GSourceFunc)IoQueueWorkItem_idlefunc, /* function */ - IoWorkItem, /* data */ - NULL); /* notify */ -} diff --git a/src/libcaptive/io/irp.c b/src/libcaptive/io/irp.c deleted file mode 100644 index fb3944f..0000000 --- a/src/libcaptive/io/irp.c +++ /dev/null @@ -1,66 +0,0 @@ -/* $Id$ - * reactos spinlock emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/iotypes.h" /* for PIRP */ -#include -#include -#include "captive/macros.h" -#include -#include "reactos/internal/io.h" /* for IoSecondStageCompletion() */ - - -struct IofCompleteRequest_register_APC { - PFILE_OBJECT OriginalFileObject; - IRP *Irp; - CHAR PriorityBoost; - }; - -static gboolean IofCompleteRequest_register_APC_idle_func(struct IofCompleteRequest_register_APC *APC /*data*/) -{ - g_return_val_if_fail(APC!=NULL,FALSE); /* remove-me */ - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: IoSecondStageCompletion(IRP=%p)...",G_STRLOC,APC->Irp); - IoSecondStageCompletion(NULL,NULL,(PVOID)&APC->OriginalFileObject,(PVOID)&APC->Irp,(PVOID)&APC->PriorityBoost); - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: ...IoSecondStageCompletion(IRP=%p) done",G_STRLOC,APC->Irp); - - g_free(APC); - - return FALSE; /* remove-me */ -} - - -void IofCompleteRequest_register_APC(PFILE_OBJECT OriginalFileObject,PIRP Irp,CCHAR PriorityBoost) -{ -struct IofCompleteRequest_register_APC *APC; - - g_return_if_fail(Irp!=NULL); - - captive_new(APC); - APC->OriginalFileObject=OriginalFileObject; - APC->Irp=Irp; - APC->PriorityBoost=PriorityBoost; - - g_idle_add_full( - G_PRIORITY_DEFAULT_IDLE, /* priority */ - (GSourceFunc)IofCompleteRequest_register_APC_idle_func, /* function */ - APC, /* data */ - NULL); /* notify */ -} diff --git a/src/libcaptive/io/process.c b/src/libcaptive/io/process.c deleted file mode 100644 index e909442..0000000 --- a/src/libcaptive/io/process.c +++ /dev/null @@ -1,62 +0,0 @@ -/* $Id$ - * reactos spinlock emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/iofuncs.h" /* self */ -#include -#include "reactos/ddk/psfuncs.h" /* for PsGetCurrentThread() */ - - -/** - * IoGetStackLimits: - * @LowLimit: Returns the bottom limit for the current stack pointer. - * @HighLimit: Returns the top limit for the current stack pointer. - * - * Returns the boundaries for the current stack pointer (address space - * of automatic variables). libcaptive returns the whole UNIX process - * address space without some safety boundary space (64KB now). - */ -VOID IoGetStackLimits(OUT PULONG LowLimit,OUT PULONG HighLimit) -{ - g_return_if_fail(LowLimit!=NULL); - g_return_if_fail(HighLimit!=NULL); - - *LowLimit =(ULONG) 0x10000; /* 64KB */ - *HighLimit=(ULONG)-0x10000; /* 64KB */ -} - - -/** - * IoIsSystemThread: - * @Thread: #PETHREAD of the thread to query. - * libcaptive allows only PsGetCurrentThread() value. - * - * Detect if the given @Thread is a kernel system thread. - * FIXME: Not much specific... - * - * Returns: %TRUE if the given @Thread is a kernel system thread. - * libcaptive always returns %TRUE. - */ -BOOLEAN IoIsSystemThread(IN PETHREAD Thread) -{ - g_return_val_if_fail(Thread==PsGetCurrentThread(),FALSE); - - return TRUE; -} diff --git a/src/libcaptive/io/symlink.c b/src/libcaptive/io/symlink.c deleted file mode 100644 index fe82da4..0000000 --- a/src/libcaptive/io/symlink.c +++ /dev/null @@ -1,54 +0,0 @@ -/* $Id$ - * reactos spinlock emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/iofuncs.h" /* self */ -#include -#include "captive/unicode.h" - - -/** - * IoCreateSymbolicLink: - * @SymbolicLinkName: Target registry key name. - * @DeviceName: Existing source registry key. - * - * Creates registry symbolic name from @DeviceName to @SymbolicLinkName. - * It is being used for example for dos-device-name filesystem aliases. - * - * Returns: libcaptive always returns error %STATUS_NOT_IMPLEMENTED. - */ -NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName,PUNICODE_STRING DeviceName) -{ - g_return_val_if_fail(SymbolicLinkName!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(DeviceName!=NULL,STATUS_INVALID_PARAMETER); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: SymbolicLinkName=%s,DeviceName=%s",G_STRLOC, - captive_UnicodeString_to_utf8_alloca(SymbolicLinkName), - captive_UnicodeString_to_utf8_alloca(DeviceName)); - - if (!strcmp(captive_UnicodeString_to_utf8_alloca(SymbolicLinkName),"\\DosDevices\\AscKmd") - && !strcmp(captive_UnicodeString_to_utf8_alloca(DeviceName),"\\Device\\AscKmd")) - return STATUS_SUCCESS; - if (!strcmp(captive_UnicodeString_to_utf8_alloca(SymbolicLinkName),"\\DosDevices\\Secdrv") - && !strcmp(captive_UnicodeString_to_utf8_alloca(DeviceName),"\\Device\\Secdrv")) - return STATUS_SUCCESS; - - return STATUS_NOT_IMPLEMENTED; -} diff --git a/src/libcaptive/kd/Makefile.am b/src/libcaptive/kd/Makefile.am deleted file mode 100644 index 1aec85f..0000000 --- a/src/libcaptive/kd/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ -# automake source for the reactos's kd/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libkd.la -libkd_la_SOURCES= \ - kdebug.c diff --git a/src/libcaptive/kd/kdebug.c b/src/libcaptive/kd/kdebug.c deleted file mode 100644 index 074d9b5..0000000 --- a/src/libcaptive/kd/kdebug.c +++ /dev/null @@ -1,108 +0,0 @@ -/* $Id$ - * reactos spinlock emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/internal/kd.h" /* self */ -#include "captive/unicode.h" /* for captive_validate_AnsiString() */ -#include -#include -#include -#include -#include - - -/** - * KdDebuggerEnabled: - * - * #BOOLEAN variable defined to %FALSE by libcaptive. - * Currently just enables some debug output in - * reactos/ntoskrnl/ldr/loader.c - */ -BOOLEAN /* __declspec(dllexport) */ KdDebuggerEnabled=FALSE; - -/** - * KdDebugState: - * - * Defined to %KD_DEBUG_DISABLED by default in reactos. - * Currently just enables some debug output in - * reactos/ntoskrnl/ldr/loader.c - */ -ULONG KdDebugState=KD_DEBUG_GDB; - - -/* storage for the trailing string part without newline */ -static GString *KdpPrintString_buffer; - -/** - * KdpPrintString: - * @String: String text to print. Buffer is flushed only when newline seen. - * - * Prints the specified text string to the console. libcaptive - * accepts any newline characters as valid and autonewlines the text - * if needed. - */ -ULONG KdpPrintString(PANSI_STRING String) -{ -gchar *out_base,*out; -const CHAR *in; - - g_return_val_if_fail(captive_validate_AnsiString(String),0); - - out_base=g_alloca(((size_t)String->Length)+1); - out=out_base; - for (in=String->Buffer;*in;in++) { - if (*in=='\r' && in[1]=='\n') - in++; - if (*in=='\r' || *in=='\n') - *out++='\n'; - else - *out++=*in; - } - *out='\0'; - - /* Print all completed lines */ - if ((out=strrchr(out_base,'\n'))) { -gchar *previous; - - *out='\0'; /* cut off the rest of string */ - - if (!KdpPrintString_buffer) - previous=NULL; - else { - previous=g_string_free(KdpPrintString_buffer, - FALSE); /* free_segment */ - KdpPrintString_buffer=NULL; - } - g_message("KdpPrintString: %s%s", /* newline is appended by g_message() */ - (!previous ? "" : previous), - out_base); - if (previous) - g_free(previous); - - out_base=out+1; /* leave the rest of string (if any) */ - } - - /* store/append the remaining rest of string w/o newline */ - if (*out_base) - KdpPrintString_buffer=(!KdpPrintString_buffer ? g_string_new(out_base) - : g_string_append(KdpPrintString_buffer,out_base)); - - return (ULONG)String->Length; -} diff --git a/src/libcaptive/ke/Makefile.am b/src/libcaptive/ke/Makefile.am deleted file mode 100644 index 41d2517..0000000 --- a/src/libcaptive/ke/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -# $Id$ -# automake source for the reactos's ke/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libke.la -libke_la_SOURCES= \ - apc.c \ - brkpoint.c \ - bug.c \ - catch.c \ - event.c \ - kthread.c \ - main.c \ - sem.c \ - spinlock.c \ - timer.c \ - wait.c - -EXTRA_DIST+= \ - $(noinst_SCRIPTS) \ - exports.captivesym \ - exports.def - -# Generate exports.c automatically from exports.captivesym by captivesym.pl -noinst_SCRIPTS=captivesym.pl - -BUILT_SOURCES+=exports.c -CLEANFILES+=exports.c -libke_la_SOURCES+=exports.c - -if HAVE_PERL -# FIXME: a difference between "ntoskrnl/ntoskrnl.def" vs. "ntoskrnl/ntoskrnl.edf"? -exports.c: exports.captivesym captivesym.pl exports.def $(top_srcdir)/reactos/ntoskrnl/ntoskrnl.def $(top_srcdir)/reactos/hal/hal/hal.def - $(PERL) captivesym.pl $(top_srcdir)/reactos/ntoskrnl/ntoskrnl.def $(top_srcdir)/reactos/hal/hal/hal.def exports.def $< >$@ - -endif diff --git a/src/libcaptive/ke/apc.c b/src/libcaptive/ke/apc.c deleted file mode 100644 index 230d49d..0000000 --- a/src/libcaptive/ke/apc.c +++ /dev/null @@ -1,39 +0,0 @@ -/* $Id$ - * reactos APC functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include "reactos/ddk/kefuncs.h" /* for KeGetCurrentThread() */ -#include "reactos/internal/ps.h" /* for KTHREAD */ - - -/** - * KeAreApcsDisabled: - * - * Detects whether KeGetCurrentThread() structure has APCs disabled. - * - * Returns: %TRUE if APCs are currently disabled. - */ -BOOLEAN KeAreApcsDisabled(VOID) -{ - g_assert(KeGetCurrentThread()->KernelApcDisable>=0); - - return KeGetCurrentThread()->KernelApcDisable!=0; -} diff --git a/src/libcaptive/ke/brkpoint.c b/src/libcaptive/ke/brkpoint.c deleted file mode 100644 index 883ce47..0000000 --- a/src/libcaptive/ke/brkpoint.c +++ /dev/null @@ -1,37 +0,0 @@ -/* $Id$ - * reactos object wait emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include "reactos/ddk/status.h" /* for STATUS_SUCCESS */ -#include "reactos/napi/types.h" /* for NTSTATUS */ -#include - - -/** - * DbgBreakPoint: - * - * Invoke kernel debugger. libcaptive just writes "DbgBreakPoint() hit" - * and continues the run. Called by ext2fsd.sys V0.10A in %DBG mode. - */ -VOID DbgBreakPoint(VOID) -{ - g_message("DbgBreakPoint() hit"); -} diff --git a/src/libcaptive/ke/bug.c b/src/libcaptive/ke/bug.c deleted file mode 100644 index 6eaa521..0000000 --- a/src/libcaptive/ke/bug.c +++ /dev/null @@ -1,39 +0,0 @@ -/* $Id$ - * reactos internal errors handling by the emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include - - -/** - * KeBugCheck: - * @BugCheckCode: Error code to report. - * - * Report fatal kernel bug. This call never returns. - */ -VOID KeBugCheck(ULONG BugCheckCode) -{ - /* FIXME: Search for BugCheckCode's message text - * by in RT_MESSAGETABLE as done by reactos/ntoskrnl/ke/bug.c/KeBugCheckEx() - */ - g_error("KeBugCheck: 0x%08lX",(gulong)BugCheckCode); - g_assert_not_reached(); -} diff --git a/src/libcaptive/ke/captivesym.pl b/src/libcaptive/ke/captivesym.pl deleted file mode 100755 index b1abc57..0000000 --- a/src/libcaptive/ke/captivesym.pl +++ /dev/null @@ -1,393 +0,0 @@ -#! /usr/bin/perl -# -# $Id$ -# Generate source files based on .captivesym symbol file -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -use vars qw($VERSION); -$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; -use strict; -use warnings; - - -my %def; -while ($ARGV[0] && $ARGV[0]=~/[.]def$/) { - map({ open DEF,"<$_" or die "open(\"$_\"): $!"; } shift()); - while () { - s/;.*$//s; - next if /^\s*$/s; - next if /^(?:LIBRARY|EXPORTS)\b/s; - my($atsign,$symbol,$args,$argscdecl,$isdata)=(/^\s*(\@)?(\S+?)(?:\@(\d+))?(?::(\d+))?(\s+DATA)?\s*$/s); - die "Invalid line" if !defined $symbol; - # popped args doc *.def *.def2 - # cdecl no stack _f f f:4 - # stdcall yes stack _f@4 f@4 - # fastcall yes ecx,edx,stack @f@4 @f@4 - die "Invalid attributes for data symbol: $symbol" if $isdata && ($atsign || defined $args); - die "\@funcname without \@4 suffix not recognized: $symbol" if $atsign && !defined $args; - die "Invalid \@$args number: $symbol" if defined $args && ($args<0 || ($args%4)); - if (!defined $argscdecl) { # beware: $argscdecl may eq "0" - die "Duplicate symbol: $symbol" if exists $def{$symbol}; - } - else { - die "cdecl-fixup without previous declaration: $symbol" if !$def{$symbol}; - die "cdecl-fixup with non-cdecl previous declaration: $symbol" if $def{$symbol}{"type"} ne "cdecl"; - die "cdecl-fixup for already fix-uped cdecl: $symbol" if exists $def{$symbol}{"args4"}; - $args=$argscdecl; - } - $def{$symbol}={ - "type"=>($isdata ? "data" : (!defined($args) || defined($argscdecl) ? "cdecl" : (!$atsign ? "stdcall" : "fastcall"))), - (!defined $args ? () : ("args4"=>$args/4)), - }; - } - close DEF or warn "close(DEF): $!"; - } - -# read source -my %module; # $module{'module'}{'symbol'}=1/"" -my %symbol; # $symbol{'symbol'}='module' -my %patch; # $patch{'module'}=1/undef -my %stats; # $stats{'iswhat'}=42 -while (<>) { - s/#.*$//s; - next if /^\s*$/s; # empty - next if /^\s*#.*/s; # comment - my($module,$symbol,$iswhat)=(/^\s*(\S+)\s+(\S+)(?:\s+(undef|pass|wrap))?\s*$/s); - $iswhat="" if !defined $iswhat; - die "Invalid line" if !defined $symbol; - if ($symbol eq "") { - die "Invalid line" if $iswhat; - die "Symbols already present during for: $module" if $module{$module}{$symbol}; - $patch{$module}=1; - next; - } - die "Symbol already exists: $symbol" if exists $symbol{$symbol}; - if ($iswhat eq "undef") { - warn "Undefined symbol not in *.def files; 'data' type risk imminent: $symbol" if !$def{$symbol}; - die "Undefined 'data' type symbols are not safe: $symbol" if $def{$symbol} && $def{$symbol}{"type"} eq "data"; - delete $def{$symbol}; - } - die "Symbol not in *.def files: $symbol" if $iswhat ne "undef" && !$def{$symbol}; - if ($iswhat eq "pass" || $iswhat eq "wrap") { - die "args count not fixed up for '$iswhat' type: ".$symbol."[".$def{$symbol}{"type"}."]" - if !exists $def{$symbol}{"args4"} && $def{$symbol}{"type"} ne "data"; # beware: {"args"} may ==0 - die "'$iswhat' not permitted if not specified for module on symbol: $symbol" if !$patch{$module}; - $def{$symbol}{$iswhat}=1; - } - $module{$module}{$symbol}=$iswhat ne "undef"; - $symbol{$symbol}=$module; - $stats{$iswhat}++; - } - -# file header -print <<"HERE"; -/* File generated automatically by captivesym.pl from "$ARGV" */ -/* DO NOT EDIT! */ - -#include "config.h" - -#include "captive/ldr_exports.h" /* for captive_ModuleList_add_builtin() */ -#include -#include -#include - -#include /* for built-in: strncmp,memmove,strncpy */ - - -extern gboolean captive_debug_messages_disabled; - -HERE - -for my $symbol (sort keys(%symbol)) { - my $def=$def{$symbol}; - if (!$def) { - # use global symbol named '${symbol}' to cause symbol conflict if it is already defined - print <<"HERE"; -#define ${symbol}_undef ${symbol} -void ${symbol}(void) -{ - g_error("%s: Function '$symbol' NOT IMPLEMENTED",G_STRLOC); -} -HERE - next; - } - if ($patch{$symbol{$symbol}} && "data" ne $def->{"type"}) { - # We do not declare it 'static' as we sometimes make 'extern' references to it - # such as 'ExInitializeNPagedLookasideList_patchpoint' in libcaptive/ex/lookas.c. - print "struct captive_ModuleList_patchpoint ${symbol}_patchpoint;\n"; - } - if ("data" eq $def->{"type"}) { - next if $def->{"pass"} || $def->{"wrap"}; # FIXME: export for .so - print "extern void/* ==unknown */ ${symbol};\n"; - print "#define ${symbol}_".$def->{"type"}." ${symbol}\n"; - next; - } - if ("cdecl" eq $def->{"type"} && !defined $def->{"args4"} && !$def->{"pass"} && !$def->{"wrap"}) { - # g_log(,G_LOG_LEVEL_DEBUG,...) not possible if we do not know the arguments count - my %forbidden=map(($_=>1),qw(strncmp memmove strncpy)); # Prevent: conflicting types for built-in function ... - print "void/* ==unknown */ ${symbol}(void/* ==unknown */);\n" if !$forbidden{$symbol}; - print "#define ${symbol}_".$def->{"type"}." ${symbol}\n"; - next; - } - - die "Needed argument count for: $symbol" if !defined $def->{"args4"}; - my @args_out=map("arg$_",0..($def->{"args4"}-1)); - my @args_in=($def->{"type"} ne "fastcall" ? @args_out - : ("stub_eax","arg1","arg0",@args_out[2..$#args_out])); - my $attrib="" - ."__attribute__((__".(map(($_ ne "fastcall" ? $_ : "stdcall"),$def->{"type"}))[0]."__)) " - .($def->{"type"} ne "fastcall" ? "" : "__attribute__((__regparm__(3)))"); - for my $type ("clean","attrib") { - print - "typedef guint64" - ." ".($type eq "clean" ? "" : $attrib) - ." (${symbol}_t_".$type.")(".(join(",",map("guint32 $_", - ($type eq "clean" ? @args_out : @args_in))) || "void").");\n"; - } - if ($def->{"wrap"}) { - print "${symbol}_t_clean ${symbol}_wrap;\n"; - } - elsif (!$def->{"pass"}) { # direct - print "${symbol}_t_clean $symbol;\n"; - } - my @args_print=@args_out; - for my $pass ("outer","clean","inner") { - if ($pass eq "inner") { - next if !$def->{"wrap"}; # use two passes only for $def->{"wrap"} - # swap the roles of @args_in and @args_out - my @args_xchg=@args_in; - @args_in=@args_out; - @args_out=@args_xchg; - } - next if $pass eq "clean" && !$def->{"pass"} && !$def->{"wrap"}; - print( - "guint64".($pass eq "outer" ? " $attrib" : "") - ." ${symbol}" - .($pass eq "clean" ? "" : - ($pass eq "inner" ? "_orig" : "_".$def->{"type"})) - ."(".(join(",",map("guint32 $_",($pass eq "clean" ? @args_out : @args_in))) || "void").")\n", - "{\n", - "guint64 r;\n", - ($pass ne "outer" && $def->{"type"} eq "fastcall" ? "guint32 " - .join(",",map("$_=0xDEADF00D","stub_eax", - ($def->{"args4"}<=0 ? "arg0" : ()), - ($def->{"args4"}<=1 ? "arg1" : ()))) - .";\n" : ""), - "\tg_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG," - ."\"%s".($def->{"wrap"} ? ";$pass" : "") - ."(".join(",",map("0x%08x",@args_print)).")...\",".join(",","\"${symbol}\"",map("(unsigned)$_",@args_print)) - .");\n", - ""); - if ($def->{"pass"} || ($def->{"wrap"} && $pass eq "inner")) { - print - "\tg_return_val_if_fail(${symbol}_patchpoint.orig_w32_func!=NULL,0);\n", - "\tg_assert(${symbol}_patchpoint.through_w32_func==FALSE);\n", - "\t${symbol}_patchpoint.through_w32_func=TRUE;\n", - "\tr=(*(${symbol}_t_attrib *)${symbol}_patchpoint.orig_w32_func)(".join(",",@args_in).");\n"; - if (!$def->{"pass"}) { - print - "\tg_assert(${symbol}_patchpoint.through_w32_func==FALSE);\n"; - } - else { - print - "\tif (!captive_debug_messages_disabled)\n", - "\t\tg_assert(${symbol}_patchpoint.through_w32_func==FALSE);\n", - "\telse {\n", - "\t\tg_assert(${symbol}_patchpoint.through_w32_func==TRUE);\n", - "\t\t${symbol}_patchpoint.through_w32_func=FALSE;\n", - "\t\t}\n"; - } - } - else { - print - "\tr=${symbol}".($def->{"wrap"} ? "_wrap" : "")."(".join(",",@args_out).");\n"; - } - print - # We diplay just the lower 32-bit of the result EDX:EAX as it is usually not used, - # the only exception are _all{mul,div,*}(); EDX:EAX convention is always compatible. - "\tg_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG," - ."\"... %s".($def->{"wrap"} ? ";$pass" : "") - ."(".join(",",map("0x%08x",@args_print)).")=0x%08x\",".join(",","\"${symbol}\"",map("(unsigned)$_",@args_print)).",(guint32)r" - .");\n", - "\treturn r;\n", - "}\n"; - } - } - -# write function captive_kernel_{exports,patches}() -for my $functype ("exports","patches_debug","patches_nondebug") { - print <<"HERE"; - -gboolean captive_kernel_$functype(void) -{ -gboolean errbool; - -HERE - for my $module (sort keys(%module)) { - my $moduleref=$module{$module}; - next if ($functype=~/^patches/) != defined $patch{$module}; - print "\t\terrbool=" - .($functype=~/^patches/ ? "captive_ModuleList_patch" : "captive_ModuleList_add_builtin") - ."(\"$module\",\n"; - for my $symbol (sort keys(%$moduleref)) { - next if $functype=~/^patches/ && !$def{$symbol}; - (my $symbol_outer=$symbol)=~s/^captive_reactos_//; - print "\t\t\t\"$symbol_outer\",",(($functype=~/^patches/ && "data" eq $def{$symbol}{"type"} - && ($def{$symbol}{"pass"} || $def{$symbol}{"wrap"})) ? ("NULL") - : ("&${symbol}_",($def{$symbol}{"type"} || "undef"))), - (($functype!~/^patches/) ? () : - (",".("data" eq $def{$symbol}{"type"} ? "NULL,NULL" : - ($functype eq "patches_nondebug" && $def{$symbol}{"pass"} ? "&${symbol}_patchpoint,NULL" : - "&${symbol}_patchpoint,&${symbol}_patchpoint")))), - ",\n"; - } - print <<"HERE"; - NULL); - g_return_val_if_fail(errbool,FALSE); - -HERE - } - print <<"HERE"; - return TRUE; -} -HERE - } - -# exit -my $total=0; -$total+=$_ for (values(%stats)); -my $statstring; -for my $statname (sort keys(%stats)) { - $statstring.=" ".($statname || "define")."=".$stats{$statname}."(".int(100*$stats{$statname}/$total)."%)"; - } -print STDERR "$0: Processed ".scalar(keys(%module))." modules:".$statstring."\n"; -exit 0; - - -__END__ - -=head1 NAME - -captivesym.pl - Generate source files based on .captivesym symbol file - -=head1 SYNOPSIS - -./captivesym.pl path/to/ntoskrnl.def path/to/hal.def exports.captivesym Eexports.c - -=head1 DESCRIPTION - -Source files with symbol call type definitions are identified by matching -pattern I<*.def>. The remaining files (I<.captivesym> ones) must -consist of lines with whitespace-separated lines as described below. - -=over - -=item (B,EpatchE) - -Declare B as mandatory W32 binary file to be patched by libcaptive. -Currently being used only for C. - -Any function call even inside such module is trapped and redirected for -libcaptive processing even if it is just for debug-dumping of B type. - -=item (B,B) - -Name without special attribute declares function fully implemented by GNU/Linux -code. Original W32 binary function will never be called. - -You may fully implement function for both EpatchEed and -unEpatchEed modules. - -=item (B,B,undef) - -Optional "undef" specifies invocation of a generated stub function displaying -C message. - -For "unpatched" modules you have to specify all the referenced symbols at least -as this "undef" symbol. For "patched" modules it is not needed for native -W32-PE binary modules importing such symbol but it is still required for W32 -.so files to satisfy .so dynamic linker. - -It is forbidden to "undef" C type of items; you have to cope with it. - -=item (B,B,pass) - -Calls of this function are debug-dumped on its entry/exit but they are fully -left to be solved by W32 binary file being EpatchEed. - -It is forbidden to specify "pass" for unEpatchEed modules. - -=item (B,B,wrap) - -Calls of this function are debug-dumped on its entry/exit. Execution is left -to be solved by your GNU/Linux implementation called B. -You are allowed to call the original W32 binary function named -B but you have to use your own prototype declaration for it. -Both B and B should be used with standard -GNU/Linux C compiler function call type notwithstanding any real W32 -implementation details. - -It is forbidden to specify "wrap" for unEpatchEed modules. - -=back - -=begin comment - - choose one: - podchecker: *** WARNING: node 'http:$_' contains non-escaped | or / - pod2html: cannot resolve L.lt.http:$_.gt. - -=end comment - -Source files I<*.def> are required to have on of three item types described at -L -(B must be dividable by B<4>): - -=over - -=item cdecl: functionname - -=item stdcall: functionname@argslength - -=item fastcall: @functionname@argslength - -=item cdecl fixup: functionname:argslength - -This item must follow (even in some other I<*.def> file) previous B -specification to specify the number of arguments as it is required for B -or B type of B function calls. - -=back - -=head1 COPYRIGHT - -Copyright (C) 2002-2003 Jan Kratochvil - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; exactly version 2 of June 1991 is required - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -=cut diff --git a/src/libcaptive/ke/catch.c b/src/libcaptive/ke/catch.c deleted file mode 100644 index fe0ac5f..0000000 --- a/src/libcaptive/ke/catch.c +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * Stub exception handling for reactos of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/exfuncs.h" /* self */ -#include - - -/* Currently disabled as we use real ReactOS ExRaiseStatus() implementation. */ -#if 0 - -/** - * ExRaiseStatus: - * @Status: #NTSTATUS type code. - * - * Should raise exception with status @Status. - * This call is just a stub debug message handler and it never returns in libcaptive. - */ -VOID ExRaiseStatus(IN NTSTATUS Status) -{ - g_error("ExRaiseStatus(0x%08X)\n",(guint32)Status); - g_assert_not_reached(); -} - -#endif diff --git a/src/libcaptive/ke/event.c b/src/libcaptive/ke/event.c deleted file mode 100644 index 1ec3b44..0000000 --- a/src/libcaptive/ke/event.c +++ /dev/null @@ -1,100 +0,0 @@ -/* $Id$ - * reactos events emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include -#include "reactos/ddk/exfuncs.h" /* for InterlockedExchange() */ - - -/** - * KeInitializeEvent: - * @Event: Event to initialize. - * %NULL value is forbidden. - * @Type: %NotificationEvent or %SynchronizationEvent. - * @State: Initial signal state. - * - * Initalizes a kernel event. Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. - */ -VOID KeInitializeEvent(PKEVENT Event,EVENT_TYPE Type,BOOLEAN State) -{ - g_return_if_fail(Event!=NULL); - g_return_if_fail(Type==NotificationEvent || Type==SynchronizationEvent); - - /* TODO:thread */ -} - - -/** - * KeSetEvent: - * @Event: Event to set its signal state on. - * %NULL value is forbidden. - * @Increment: Thread priority increase during wait; ignored by libcaptive. - * @Wait: Do not release locks, KeWait() is required afterwards; ignored by libcaptive. - * - * Sets the signal state of @Event. Currently libcaptive doesn't use multithreading - * and thus this function will just set the @Event's internal state and it returns - * the previous value. - * See also KeResetEvent(), KeClearEvent(). - * - * Returns: Previous signal state value of @Event. - */ -LONG KeSetEvent(PKEVENT Event,KPRIORITY Increment,BOOLEAN Wait) -{ - g_return_val_if_fail(Event!=NULL,0); - - /* TODO:thread */ - return InterlockedExchange(&(Event->Header.SignalState),1); -} - - -/** - * KeResetEvent: - * @Event: Event to clear its signal state off. - * %NULL value is forbidden. - * - * Clears the signal state of @Event. See also KeSetEvent(). - * Use KeClearEvent() if you do not need the previous signal state of @Event. - * - * Returns: Previous signal state value of @Event. - */ -LONG KeResetEvent(PKEVENT Event) -{ - g_return_val_if_fail(Event!=NULL,0); - - return InterlockedExchange(&(Event->Header.SignalState),0); -} - - -/** - * KeClearEvent: - * @Event: Event to clear its signal state off. - * %NULL value is forbidden. - * - * Clears the signal state of @Event. See also KeSetEvent(). - * Use KeResetEvent() if you need the previous signal state of @Event. - */ -VOID KeClearEvent(PKEVENT Event) -{ - g_return_if_fail(Event!=NULL); - - Event->Header.SignalState=FALSE; -} diff --git a/src/libcaptive/ke/exports.captivesym b/src/libcaptive/ke/exports.captivesym deleted file mode 100644 index 5b26a0e..0000000 --- a/src/libcaptive/ke/exports.captivesym +++ /dev/null @@ -1,464 +0,0 @@ -# $Id$ -# List symbols exported by libcaptive to reactos; see doc of captivesym.pl -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -ntoskrnl.exe -ntoskrnl.exe ObfDereferenceObject -ntoskrnl.exe CcPurgeCacheSection -ntoskrnl.exe RtlTimeFieldsToTime pass -ntoskrnl.exe CcSetFileSizes -ntoskrnl.exe CcInitializeCacheMap -ntoskrnl.exe IoCreateStreamFileObject -ntoskrnl.exe _allmul pass -ntoskrnl.exe CcUninitializeCacheMap -ntoskrnl.exe IofCompleteRequest -ntoskrnl.exe IoCompleteRequest -ntoskrnl.exe IoSetTopLevelIrp -ntoskrnl.exe IoGetStackLimits -ntoskrnl.exe IoGetTopLevelIrp -ntoskrnl.exe IoGetCurrentProcess -ntoskrnl.exe KeLeaveCriticalRegion -ntoskrnl.exe IoIsOperationSynchronous -ntoskrnl.exe KeEnterCriticalRegion -ntoskrnl.exe IoDeleteDevice -ntoskrnl.exe ExDeleteResourceLite -ntoskrnl.exe IoFreeWorkItem -ntoskrnl.exe MmQuerySystemSize -ntoskrnl.exe IoAllocateWorkItem -ntoskrnl.exe KeInitializeEvent -ntoskrnl.exe ExInitializeResourceLite -ntoskrnl.exe ObfReferenceObject -ntoskrnl.exe IoRegisterFileSystem -ntoskrnl.exe IoRegisterShutdownNotification -ntoskrnl.exe IoCreateDevice -ntoskrnl.exe RtlInitUnicodeString -ntoskrnl.exe FsRtlNotifyVolumeEvent -ntoskrnl.exe IoRemoveShareAccess -ntoskrnl.exe FsRtlNotifyCleanup -ntoskrnl.exe FsRtlOplockIsFastIoPossible -ntoskrnl.exe FsRtlFastUnlockAll -ntoskrnl.exe IoGetRequestorProcess -ntoskrnl.exe FsRtlCheckOplock -ntoskrnl.exe ExAcquireResourceExclusiveLite -ntoskrnl.exe IoQueueWorkItem -ntoskrnl.exe FsRtlDoesNameContainWildCards pass -ntoskrnl.exe memmove -ntoskrnl.exe IoUpdateShareAccess -ntoskrnl.exe IoSetShareAccess -ntoskrnl.exe IoCheckShareAccess -ntoskrnl.exe FsRtlCurrentBatchOplock -ntoskrnl.exe IofCallDriver -ntoskrnl.exe KeWaitForSingleObject -ntoskrnl.exe IoBuildSynchronousFsdRequest -ntoskrnl.exe KeGetCurrentThread -ntoskrnl.exe MmProbeAndLockPages -ntoskrnl.exe IoAllocateMdl -ntoskrnl.exe IoBuildDeviceIoControlRequest -ntoskrnl.exe _alldiv pass -ntoskrnl.exe IoFreeIrp -ntoskrnl.exe KeClearEvent -ntoskrnl.exe KeSetEvent -ntoskrnl.exe ExReleaseResourceForThreadLite -ntoskrnl.exe IoBuildPartialMdl -ntoskrnl.exe IoMakeAssociatedIrp pass -ntoskrnl.exe MmMapLockedPagesSpecifyCache -ntoskrnl.exe FsRtlNotifyFullChangeDirectory -ntoskrnl.exe RtlUpcaseUnicodeString -ntoskrnl.exe RtlOemToUnicodeN -ntoskrnl.exe CcMapData -ntoskrnl.exe ExAcquireResourceSharedLite -ntoskrnl.exe ObReferenceObjectByHandle -ntoskrnl.exe IoFileObjectType -ntoskrnl.exe KeInitializeSpinLock -ntoskrnl.exe RtlOemStringToCountedUnicodeString -ntoskrnl.exe FsRtlIsFatDbcsLegal pass -ntoskrnl.exe RtlUnicodeStringToCountedOemString pass -ntoskrnl.exe RtlUnicodeToOemN -ntoskrnl.exe RtlFreeOemString -ntoskrnl.exe NlsOemLeadByteInfo -ntoskrnl.exe NlsMbOemCodePageTag -ntoskrnl.exe RtlUnicodeStringToOemString -ntoskrnl.exe RtlGenerate8dot3Name pass -ntoskrnl.exe RtlCompareMemory pass -ntoskrnl.exe RtlDelete pass -ntoskrnl.exe RtlSplay pass -ntoskrnl.exe RtlSubtreePredecessor pass -ntoskrnl.exe CcCopyRead -ntoskrnl.exe FsRtlCheckLockForReadAccess -ntoskrnl.exe ExAcquireSharedStarveExclusive -ntoskrnl.exe FsRtlNotifyUninitializeSync -ntoskrnl.exe RtlInsertElementGenericTable pass -ntoskrnl.exe RtlInsertElementGenericTableAvl pass -ntoskrnl.exe RtlInsertElementGenericTableFull pass -ntoskrnl.exe RtlLookupElementGenericTable pass -ntoskrnl.exe RtlLookupElementGenericTableAvl pass -ntoskrnl.exe RtlLookupElementGenericTableFull pass -ntoskrnl.exe RtlEnumerateGenericTableWithoutSplaying pass -ntoskrnl.exe RtlEnumerateGenericTableWithoutSplayingAvl pass -ntoskrnl.exe RtlInitializeGenericTable pass # 'pass'=>Arguments MUST be stdcall even if in .so file! -ntoskrnl.exe RtlInitializeGenericTableAvl pass # 'pass'=>Arguments MUST be stdcall even if in .so file! -ntoskrnl.exe RtlLookupElementGenericTableFullAvl pass -ntoskrnl.exe RtlInsertElementGenericTableFullAvl pass -ntoskrnl.exe FsRtlNotifyInitializeSync -ntoskrnl.exe FsRtlTeardownPerStreamContexts -ntoskrnl.exe RtlDeleteElementGenericTable pass -ntoskrnl.exe RtlDeleteElementGenericTableAvl pass -ntoskrnl.exe IoSetHardErrorOrVerifyDevice -ntoskrnl.exe ExRaiseStatus -ntoskrnl.exe ExReleaseResourceLite -ntoskrnl.exe CcUnpinData -ntoskrnl.exe ExAllocatePoolWithTag -ntoskrnl.exe IoFreeMdl -ntoskrnl.exe ExFreePoolWithTag -ntoskrnl.exe ExFreePool -ntoskrnl.exe RtlAssert -ntoskrnl.exe DbgPrint -ntoskrnl.exe ExIsResourceAcquiredExclusiveLite -ntoskrnl.exe InterlockedPopEntrySList -ntoskrnl.exe InterlockedPushEntrySList -ntoskrnl.exe CcRepinBcb -ntoskrnl.exe CcUnpinRepinnedBcb -ntoskrnl.exe FsRtlInitializeFileLock -ntoskrnl.exe RtlCompareUnicodeString -ntoskrnl.exe CcSetDirtyPinnedData -ntoskrnl.exe RtlSetBits pass -ntoskrnl.exe RtlInitializeBitMap pass -ntoskrnl.exe CcPinRead -ntoskrnl.exe FsRtlUninitializeLargeMcb pass -ntoskrnl.exe KeQuerySystemTime -ntoskrnl.exe FsRtlInitializeLargeMcb pass -ntoskrnl.exe RtlAnsiStringToUnicodeString -ntoskrnl.exe RtlUnicodeStringToAnsiString -ntoskrnl.exe FsRtlAreNamesEqual pass -ntoskrnl.exe ExDeleteNPagedLookasideList pass #==ExDeletePagedLookasideList -ntoskrnl.exe ExDeletePagedLookasideList pass #==ExDeleteNPagedLookasideList -ntoskrnl.exe RtlQueryRegistryValues -ntoskrnl.exe RtlAppendUnicodeToString -ntoskrnl.exe RtlCopyUnicodeString -ntoskrnl.exe ExInitializePagedLookasideList pass -ntoskrnl.exe ExInitializeNPagedLookasideList pass -ntoskrnl.exe ExFreeToPagedLookasideList pass -ntoskrnl.exe RtlTimeToTimeFields pass -ntoskrnl.exe FsRtlRemoveLargeMcbEntry pass -ntoskrnl.exe FsRtlLookupLargeMcbEntry pass -ntoskrnl.exe FsRtlAddLargeMcbEntry pass -ntoskrnl.exe RtlFindClearBits pass -ntoskrnl.exe RtlClearBits pass -ntoskrnl.exe FsRtlCheckLockForWriteAccess -ntoskrnl.exe CcCanIWrite -ntoskrnl.exe CcPinMappedData -ntoskrnl.exe ExAcquireFastMutexUnsafe -ntoskrnl.exe ExConvertExclusiveToSharedLite -ntoskrnl.exe ExIsResourceAcquiredSharedLite -ntoskrnl.exe ExLocalTimeToSystemTime -ntoskrnl.exe ExReleaseFastMutexUnsafe -ntoskrnl.exe ExSystemTimeToLocalTime -ntoskrnl.exe FsRtlAddToTunnelCache -ntoskrnl.exe FsRtlBalanceReads -ntoskrnl.exe FsRtlDeleteKeyFromTunnelCache -ntoskrnl.exe FsRtlDeleteTunnelCache -ntoskrnl.exe FsRtlDissectName pass -ntoskrnl.exe FsRtlFindInTunnelCache -ntoskrnl.exe FsRtlGetNextLargeMcbEntry pass -ntoskrnl.exe FsRtlInitializeOplock -ntoskrnl.exe FsRtlInitializeTunnelCache -ntoskrnl.exe FsRtlLegalAnsiCharacterArray pass -ntoskrnl.exe FsRtlLookupLastLargeMcbEntry pass -ntoskrnl.exe FsRtlLookupLastLargeMcbEntryAndIndex pass -ntoskrnl.exe FsRtlNotifyFullReportChange -ntoskrnl.exe FsRtlNumberOfRunsInLargeMcb pass -ntoskrnl.exe FsRtlTruncateLargeMcb pass -ntoskrnl.exe KeAreApcsDisabled -ntoskrnl.exe KeCancelTimer -ntoskrnl.exe KeInitializeDpc -ntoskrnl.exe KeInitializeTimer -ntoskrnl.exe KeNumberProcessors -ntoskrnl.exe KeRemoveQueueDpc -ntoskrnl.exe MmUnlockPages -ntoskrnl.exe MmUnmapLockedPages -ntoskrnl.exe RtlAreBitsClear pass -ntoskrnl.exe RtlAreBitsSet pass -ntoskrnl.exe RtlCompareString -ntoskrnl.exe RtlDowncaseUnicodeString -ntoskrnl.exe RtlEqualString -ntoskrnl.exe RtlFindLongestRunClear pass -ntoskrnl.exe RtlFreeUnicodeString -ntoskrnl.exe RtlNumberOfClearBits pass -ntoskrnl.exe RtlUpcaseUnicodeStringToCountedOemString -ntoskrnl.exe RtlUpperString -ntoskrnl.exe RtlxOemStringToUnicodeSize -ntoskrnl.exe SeExports -ntoskrnl.exe ZwClose -ntoskrnl.exe ZwOpenKey -ntoskrnl.exe ExfInterlockedInsertTailList -ntoskrnl.exe RtlTimeToSecondsSince1970 pass -ntoskrnl.exe RtlSecondsSince1970ToTime pass -ntoskrnl.exe RtlExtendedMagicDivide pass -ntoskrnl.exe RtlExtendedIntegerMultiply pass -ntoskrnl.exe ExAllocateFromPagedLookasideList wrap -ntoskrnl.exe CcMdlReadComplete undef -ntoskrnl.exe MmFlushImageSection -ntoskrnl.exe KeBugCheckEx undef -ntoskrnl.exe FsRtlIsNtstatusExpected pass -ntoskrnl.exe FsRtlFastCheckLockForRead undef -ntoskrnl.exe IoRaiseHardError undef -ntoskrnl.exe IoSetDeviceToVerify undef -ntoskrnl.exe IoGetDeviceToVerify undef -ntoskrnl.exe IoUnregisterFileSystem -ntoskrnl.exe FsRtlCopyRead undef -ntoskrnl.exe IoReleaseVpbSpinLock -ntoskrnl.exe IoAcquireVpbSpinLock -ntoskrnl.exe FsRtlNormalizeNtstatus undef -ntoskrnl.exe MmBuildMdlForNonPagedPool -ntoskrnl.exe CcWaitForCurrentLazyWriterActivity -ntoskrnl.exe FsRtlOplockFsctrl undef -ntoskrnl.exe SeSinglePrivilegeCheck undef -ntoskrnl.exe FsRtlProcessFileLock undef -ntoskrnl.exe FsRtlPrivateLock undef -ntoskrnl.exe FsRtlFastUnlockSingle undef -ntoskrnl.exe FsRtlFastUnlockAllByKey undef -ntoskrnl.exe FsRtlIsNameInExpression pass -ntoskrnl.exe CcMdlRead undef -ntoskrnl.exe CcSetReadAheadGranularity -ntoskrnl.exe FsRtlAllocateFileLock undef -ntoskrnl.exe FsRtlUninitializeOplock -ntoskrnl.exe FsRtlFreeFileLock undef -ntoskrnl.exe IoVerifyVolume undef -ntoskrnl.exe _allshr pass -ntoskrnl.exe _aullshr pass -ntoskrnl.exe ExQueueWorkItem -ntoskrnl.exe _except_handler3 -ntoskrnl.exe _allshl pass -ntoskrnl.exe DbgBreakPoint -ntoskrnl.exe FsRtlAllocatePool pass -ntoskrnl.exe CcGetFileObjectFromBcb undef -ntoskrnl.exe FsRtlUninitializeFileLock -ntoskrnl.exe FsRtlFastCheckLockForWrite undef -ntoskrnl.exe CcFlushCache -ntoskrnl.exe FsRtlGetNextFileLock -ntoskrnl.exe MmCanFileBeTruncated -ntoskrnl.exe IoDeleteSymbolicLink undef -ntoskrnl.exe IoCreateSymbolicLink -ntoskrnl.exe FsRtlCopyWrite undef -ntoskrnl.exe CcZeroData -ntoskrnl.exe CcPreparePinWrite -ntoskrnl.exe CcPrepareMdlWrite undef -ntoskrnl.exe CcCopyWrite -ntoskrnl.exe CcMdlWriteComplete undef -ntoskrnl.exe CcDeferWrite undef -ntoskrnl.exe CcIsThereDirtyData -ntoskrnl.exe CcSetAdditionalCacheAttributes -ntoskrnl.exe DbgPrintEx undef -ntoskrnl.exe ExAcquireSharedWaitForExclusive -ntoskrnl.exe ExAllocatePoolWithQuotaTag undef -ntoskrnl.exe ExGetExclusiveWaiterCount -ntoskrnl.exe ExGetSharedWaiterCount -ntoskrnl.exe ExfInterlockedAddUlong undef -ntoskrnl.exe FsRtlIsDbcsInExpression undef -ntoskrnl.exe FsRtlIsTotalDeviceFailure -ntoskrnl.exe FsRtlPostPagingFileStackOverflow undef -ntoskrnl.exe FsRtlPostStackOverflow undef -ntoskrnl.exe IoBuildAsynchronousFsdRequest -ntoskrnl.exe IoCheckEaBufferValidity undef -ntoskrnl.exe IoGetFileObjectGenericMapping -ntoskrnl.exe IoIsSystemThread -ntoskrnl.exe IoRaiseInformationalHardError undef -ntoskrnl.exe KeDelayExecutionThread -ntoskrnl.exe KeSetTimer -ntoskrnl.exe ProbeForRead undef -ntoskrnl.exe ProbeForWrite undef -ntoskrnl.exe SeAccessCheck -ntoskrnl.exe SeFilterToken undef -ntoskrnl.exe SeLockSubjectContext -ntoskrnl.exe SePrivilegeCheck -ntoskrnl.exe SeReleaseSubjectContext -ntoskrnl.exe SeUnlockSubjectContext -ntoskrnl.exe ZwQueryValueKey undef -ntoskrnl.exe _allrem pass -ntoskrnl.exe strncmp -ntoskrnl.exe ExInterlockedPushEntrySList -ntoskrnl.exe ExInterlockedPopEntrySList -ntoskrnl.exe SeCaptureSubjectContext -ntoskrnl.exe RtlLengthRequiredSid -ntoskrnl.exe RtlInitializeSid -ntoskrnl.exe RtlSubAuthoritySid -ntoskrnl.exe RtlCreateAcl -ntoskrnl.exe RtlAddAccessAllowedAce -ntoskrnl.exe RtlCreateSecurityDescriptor -ntoskrnl.exe RtlSetDaclSecurityDescriptor -ntoskrnl.exe SeAssignSecurity -ntoskrnl.exe RtlLengthSecurityDescriptor pass -ntoskrnl.exe SeValidSecurityDescriptor -ntoskrnl.exe VerSetConditionMask pass -ntoskrnl.exe RtlVerifyVersionInfo pass -ntoskrnl.exe RtlGetVersion -ntoskrnl.exe KeInitializeMutant -ntoskrnl.exe KeReleaseMutant -ntoskrnl.exe IoRegisterDriverReinitialization -ntoskrnl.exe PoQueueShutdownWorkItem -ntoskrnl.exe ZwCreateEvent -ntoskrnl.exe PsCreateSystemThread -ntoskrnl.exe IoCreateStreamFileObjectLite -ntoskrnl.exe CcSetLogHandleForFile -ntoskrnl.exe _alloca_probe pass # ntoskrnl.exe implementation is fully acceptable -ntoskrnl.exe IoAllocateErrorLogEntry pass -ntoskrnl.exe CcGetDirtyPages -ntoskrnl.exe ExReinitializeResourceLite -ntoskrnl.exe CcSetBcbOwnerPointer -ntoskrnl.exe IoSynchronousPageWrite -ntoskrnl.exe RtlFindClearRuns pass -ntoskrnl.exe RtlFindLastBackwardRunClear pass -ntoskrnl.exe ObQueryNameString -ntoskrnl.exe RtlLengthSid -ntoskrnl.exe SeAuditingFileEvents -ntoskrnl.exe CcRemapBcb -ntoskrnl.exe CcUnpinDataForThread -ntoskrnl.exe SeDeassignSecurity -ntoskrnl.exe FsRtlNotifyFilterChangeDirectory -ntoskrnl.exe RtlFindNextForwardRunClear pass -ntoskrnl.exe IoAcquireCancelSpinLock -ntoskrnl.exe IoReleaseCancelSpinLock -ntoskrnl.exe _global_unwind2 -ntoskrnl.exe RtlUnwind -ntoskrnl.exe _local_unwind2 pass -# we can pass iff "_local_unwind2 pass" as there is registered local handler to %fs:[0]: -ntoskrnl.exe _abnormal_termination wrap -ntoskrnl.exe FsRtlIncrementCcFastReadNoWait -ntoskrnl.exe FsRtlResetLargeMcb pass -ntoskrnl.exe RtlGetCompressionWorkSpaceSize pass -ntoskrnl.exe RtlDecompressFragment pass -ntoskrnl.exe KeSetPriorityThread -ntoskrnl.exe IoPageRead -ntoskrnl.exe RtlCompressBuffer pass -ntoskrnl.exe FsRtlSplitLargeMcb pass -ntoskrnl.exe captive_reactos_wcsncmp -ntoskrnl.exe MmGetSystemRoutineAddress -ntoskrnl.exe RtlEqualUnicodeString -ntoskrnl.exe RtlIsGenericTableEmpty pass -ntoskrnl.exe RtlRealSuccessor pass -ntoskrnl.exe PsGetVersion -ntoskrnl.exe RtlIsGenericTableEmptyAvl pass -ntoskrnl.exe RtlEnumerateGenericTable pass -ntoskrnl.exe RtlEnumerateGenericTableAvl pass -ntoskrnl.exe MmSetAddressRangeModified -ntoskrnl.exe RtlEqualSid -ntoskrnl.exe SeAuditingFileEventsWithContext - -hal.dll KfReleaseSpinLock -hal.dll KeGetCurrentIrql -hal.dll ExAcquireFastMutex -hal.dll ExReleaseFastMutex -hal.dll KfAcquireSpinLock -hal.dll HalReportResourceUsage undef -hal.dll HalAllProcessorsStarted undef -hal.dll HalQueryRealTimeClock undef -hal.dll HalAllocateAdapterChannel undef -hal.dll KeStallExecutionProcessor undef -hal.dll HalTranslateBusAddress undef -hal.dll HalGetBusDataByOffset undef -hal.dll HalSetBusDataByOffset undef -hal.dll KeQueryPerformanceCounter -hal.dll HalReturnToFirmware undef -hal.dll READ_PORT_UCHAR undef -hal.dll READ_PORT_USHORT undef -hal.dll READ_PORT_ULONG undef -hal.dll WRITE_PORT_UCHAR undef -hal.dll WRITE_PORT_USHORT undef -hal.dll WRITE_PORT_ULONG undef -hal.dll HalInitializeProcessor undef -hal.dll HalCalibratePerformanceCounter undef -hal.dll HalSetRealTimeClock undef -hal.dll HalHandleNMI undef -hal.dll HalBeginSystemInterrupt undef -hal.dll HalEndSystemInterrupt undef -hal.dll KeRaiseIrqlToSynchLevel undef -hal.dll KeAcquireInStackQueuedSpinLockRaiseToSynch undef -hal.dll HalInitSystem undef -hal.dll HalDisableSystemInterrupt undef -hal.dll HalEnableSystemInterrupt undef -hal.dll KeRaiseIrql -hal.dll KeLowerIrql -hal.dll HalClearSoftwareInterrupt undef -hal.dll KeReleaseSpinLock -hal.dll KeAcquireSpinLock -hal.dll ExTryToAcquireFastMutex -hal.dll KeAcquireSpinLockRaiseToSynch undef -hal.dll KeFlushWriteBuffer undef -hal.dll HalProcessorIdle undef -hal.dll HalReadDmaCounter undef -hal.dll IoMapTransfer undef -hal.dll IoFreeMapRegisters undef -hal.dll IoFreeAdapterChannel undef -hal.dll IoFlushAdapterBuffers undef -hal.dll HalFreeCommonBuffer undef -hal.dll HalAllocateCommonBuffer undef -hal.dll HalAllocateCrashDumpRegisters undef -hal.dll HalGetAdapter undef -hal.dll HalSetTimeIncrement undef -hal.dll HalGetEnvironmentVariable undef -hal.dll HalSetEnvironmentVariable undef -hal.dll KfRaiseIrql -hal.dll HalGetInterruptVector undef -hal.dll HalRequestSoftwareInterrupt undef -hal.dll KeAcquireInStackQueuedSpinLock -hal.dll KeReleaseInStackQueuedSpinLock -hal.dll KeRaiseIrqlToDpcLevel undef -hal.dll HalSystemVectorDispatchEntry undef -hal.dll KfLowerIrql -hal.dll HalStartProfileInterrupt undef -hal.dll HalSetProfileInterval undef -hal.dll HalStopProfileInterrupt undef -hal.dll KeAcquireQueuedSpinLockRaiseToSynch -hal.dll HalRequestIpi undef -hal.dll HalStartNextProcessor undef -hal.dll KeTryToAcquireQueuedSpinLock undef -hal.dll KeAcquireQueuedSpinLock -hal.dll KeReleaseQueuedSpinLock -hal.dll IoReadPartitionTable undef -hal.dll IoAssignDriveLetters undef -hal.dll KdPortSave undef -hal.dll KdPortRestore undef -hal.dll KdPortPollByte undef -hal.dll KdPortInitialize undef -hal.dll KdPortGetByte undef -hal.dll KdPortPutByte undef - -bootvid.dll VidInitialize undef -bootvid.dll VidDisplayString undef -bootvid.dll VidSetTextColor undef -bootvid.dll VidSolidColorFill undef -bootvid.dll VidBitBlt undef -bootvid.dll VidBufferToScreenBlt undef -bootvid.dll VidScreenToBufferBlt undef -bootvid.dll VidResetDisplay undef -bootvid.dll VidCleanUp undef -bootvid.dll VidSetScrollRegion undef - -kdcom.dll KdD0Transition undef -kdcom.dll KdD3Transition undef -kdcom.dll KdRestore undef -kdcom.dll KdReceivePacket undef -kdcom.dll KdDebuggerInitialize0 undef -kdcom.dll KdSave undef -kdcom.dll KdDebuggerInitialize1 undef -kdcom.dll KdSendPacket undef - -ksecdd.sys GenerateSessionKey undef -ksecdd.sys EfsGenerateKey undef -ksecdd.sys GenerateDirEfs undef -ksecdd.sys InitSecurityInterfaceW undef -ksecdd.sys EfsDecryptFek undef diff --git a/src/libcaptive/ke/exports.def b/src/libcaptive/ke/exports.def deleted file mode 100644 index 0467569..0000000 --- a/src/libcaptive/ke/exports.def +++ /dev/null @@ -1,144 +0,0 @@ -; $Id$ -; W32 symbols missing in reactos ntoskrnl.def and hal.def -; Copyright (C) 2002 Jan Kratochvil -; -; This program is free software; you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation; exactly version 2 of June 1991 is required -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program; if not, write to the Free Software -; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -EXPORTS - -ExFreePoolWithTag@8 -RtlInsertElementGenericTable@16 -RtlInsertElementGenericTableAvl@16 -RtlInsertElementGenericTableFull@24 -RtlInsertElementGenericTableFullAvl@24 -RtlLookupElementGenericTable@8 -RtlLookupElementGenericTableAvl@8 -RtlLookupElementGenericTableFull@16 -RtlLookupElementGenericTableFullAvl@16 -RtlEnumerateGenericTableWithoutSplaying@8 -RtlEnumerateGenericTableWithoutSplayingAvl@8 -RtlInitializeGenericTable@20 -RtlInitializeGenericTableAvl@20 -RtlDeleteElementGenericTable@8 -RtlDeleteElementGenericTableAvl@8 -CcInitializeCacheMap@20 -MmMapLockedPagesSpecifyCache@24 -CcUninitializeCacheMap@12 -RtlDelete@4 -FsRtlTeardownPerStreamContexts@4 -CcPurgeCacheSection@16 -RtlSplay@4 -KeAreApcsDisabled@0 -FsRtlLookupLastLargeMcbEntryAndIndex@16 -CcPinRead@24 -CcPinMappedData@20 -CcRepinBcb@4 -CcUnpinRepinnedBcb@12 -CcCanIWrite@16 -CcSetReadAheadGranularity@8 -RtlSubtreePredecessor@4 -_allshl DATA ; it is special-arguments function; not data -_allshr DATA ; it is special-arguments function; not data -_aullshr DATA ; it is special-arguments function; not data -SeLockSubjectContext@4 -SeUnlockSubjectContext@4 -SeValidSecurityDescriptor@8 -VerSetConditionMask@16 -RtlVerifyVersionInfo@16 -RtlGetVersion@4 -PoQueueShutdownWorkItem@4 -@KeAcquireQueuedSpinLock@4 -@KeReleaseQueuedSpinLock@8 -IoCreateStreamFileObjectLite@8 -CcSetLogHandleForFile@12 -@KeAcquireQueuedSpinLockRaiseToSynch@4 -_alloca_probe DATA ; it cannot be wrapped as it modifies the stack frame -CcSetAdditionalCacheAttributes@12 -CcGetDirtyPages@16 -CcSetBcbOwnerPointer@8 -RtlFindClearRuns@16 -RtlFindLastBackwardRunClear@12 -@HalClearSoftwareInterrupt@4 -@HalRequestSoftwareInterrupt@4 -@KeAcquireInStackQueuedSpinLock@8 -@KeAcquireInStackQueuedSpinLockRaiseToSynch@8 -@KeReleaseInStackQueuedSpinLock@4 -@KeTryToAcquireQueuedSpinLock@8 -HalAllocateCrashDumpRegisters@8 -HalSetProfileInterval@4 -HalSetTimeIncrement@4 -HalStartProfileInterrupt@4 -HalStopProfileInterrupt@4 -KdD0Transition@0 -KdD3Transition@0 -KdDebuggerInitialize0@4 -KdDebuggerInitialize1@4 -KdReceivePacket@20 -KdRestore@4 -KdSave@4 -KdSendPacket@16 -VidBitBlt@12 -VidBufferToScreenBlt@24 -VidCleanUp@0 -VidDisplayString@4 -VidInitialize@4 -VidResetDisplay@4 -VidScreenToBufferBlt@24 -VidSetScrollRegion@16 -VidSetTextColor@4 -VidSolidColorFill@20 -CcDeferWrite@24 -CcGetFileObjectFromBcb@4 -CcIsThereDirtyData@4 -CcMdlRead@20 -CcMdlWriteComplete@12 -CcPrepareMdlWrite@20 -CcPreparePinWrite@28 -CcWaitForCurrentLazyWriterActivity@0 -DbgPrintEx -FsRtlFreeFileLock@4 -IoIsSystemThread@4 -SeFilterToken -SeAuditingFileEvents@8 -CcRemapBcb@4 -CcUnpinDataForThread@8 -FsRtlNotifyFilterChangeDirectory@44 -GenerateSessionKey@4 -EfsGenerateKey@24 -GenerateDirEfs@20 -InitSecurityInterfaceW@0 -EfsDecryptFek@28 -RtlFindNextForwardRunClear@12 -_except_handler3 -_global_unwind2 -;_local_unwind2 -;FIXME:;_except_handler3 DATA ; it cannot be wrapped as it does some stack magic -;FIXME:;_global_unwind2 DATA ; it cannot be wrapped as it does some stack magic -_local_unwind2 DATA ; it cannot be wrapped as it does some stack magic -FsRtlIncrementCcFastReadNoWait@0 -_allmul DATA -_alldiv DATA -_allrem DATA -FsRtlResetLargeMcb@8 -_abnormal_termination:0 -captive_reactos_wcsncmp -captive_reactos_wcsncmp:12 -MmGetSystemRoutineAddress@4 -RtlIsGenericTableEmpty@4 -RtlIsGenericTableEmptyAvl@4 -RtlRealSuccessor@4 -RtlEnumerateGenericTable@8 -RtlEnumerateGenericTableAvl@8 -SeAuditingFileEventsWithContext@12 diff --git a/src/libcaptive/ke/kthread.c b/src/libcaptive/ke/kthread.c deleted file mode 100644 index b57ed06..0000000 --- a/src/libcaptive/ke/kthread.c +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * reactos kernel-part of threading emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/internal/ps.h" /* self */ -#include - - -/** - * KeInitializeThread: - * @Process: Initialized #PKPROCESS. - * @Thread: Thread structure to be initialized. - * @First: @Thread is the first single system thread . - * - * Initalizes a thread. Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. We hope it won't hurt. - */ -VOID KeInitializeThread(PKPROCESS Process,PKTHREAD Thread,BOOLEAN First) -{ - g_return_if_fail(Process!=NULL); - g_return_if_fail(Thread!=NULL); - - /* TODO:thread */ - g_return_if_fail(First==TRUE); -} diff --git a/src/libcaptive/ke/main.c b/src/libcaptive/ke/main.c deleted file mode 100644 index e7d2e71..0000000 --- a/src/libcaptive/ke/main.c +++ /dev/null @@ -1,33 +0,0 @@ -/* $Id$ - * reactos semaphore emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/ketypes.h" /* self; for KeNumberProcessors */ -#include - - -/** - * KeNumberProcessors: - * - * libcaptive is currently single-threaded single-processor emulation - * and therefore #KeNumberProcessors has always constant value 1. - * See also KeGetCurrentProcessorNumber() which should always return 0. - */ -CCHAR KeNumberProcessors=1; /* TODO:thread */ diff --git a/src/libcaptive/ke/sem.c b/src/libcaptive/ke/sem.c deleted file mode 100644 index a811b57..0000000 --- a/src/libcaptive/ke/sem.c +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id$ - * reactos semaphore emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include - - -/** - * KeInitializeSemaphore: - * @Semaphore: Memory to initialize as #KSEMAPHORE. - * @Count: Initial semaphore signal state. - * @Limit: Maximum semaphore signal state. - * - * Initalizes a semaphore. Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. - */ -VOID KeInitializeSemaphore(PKSEMAPHORE Semaphore,LONG Count,LONG Limit) -{ - g_return_if_fail(Semaphore!=NULL); - g_return_if_fail(Count>=0); - g_return_if_fail(Limit>=0); - g_return_if_fail(Count<=Limit); - - /* TODO:thread */ - Semaphore->Limit=Limit; -} diff --git a/src/libcaptive/ke/spinlock.c b/src/libcaptive/ke/spinlock.c deleted file mode 100644 index 440363d..0000000 --- a/src/libcaptive/ke/spinlock.c +++ /dev/null @@ -1,38 +0,0 @@ -/* $Id$ - * reactos spinlock emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include - - -/** - * KeInitializeSpinLock: - * @SpinLock: Caller supplied storage for the spinlock. - * - * Initalizes a spinlock. Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. #GMutex would be needed otherwise. - */ -VOID KeInitializeSpinLock(PKSPIN_LOCK SpinLock) -{ - g_return_if_fail(SpinLock!=NULL); - - /* TODO:thread */ -} diff --git a/src/libcaptive/ke/timer.c b/src/libcaptive/ke/timer.c deleted file mode 100644 index c4f9ab6..0000000 --- a/src/libcaptive/ke/timer.c +++ /dev/null @@ -1,147 +0,0 @@ -/* $Id$ - * reactos time handling functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include -#include - - -/* This file is based on 'wine/dlls/ntdll/time.c' */ - - -/* 1601 to 1970 is 369 years plus 89 leap days */ -#define SECS_1601_TO_1970 ((369*365+89)*G_GINT64_CONSTANT(86400)) - - -/** - * KeQuerySystemTime: - * @CurrentTime: Returns the current time. - * %NULL pointer value is forbidden. - * - * Returns the number of passed 100ns (1e-7) intervals from 1 Jan 1601. - */ -VOID KeQuerySystemTime(PLARGE_INTEGER CurrentTime) -{ -struct timeval tv; -int errint; - - g_return_if_fail(CurrentTime!=NULL); - - errint=gettimeofday( - &tv, /* tv; timeval */ - NULL); /* tz; timezone */ - g_assert(errint==0); - - CurrentTime->QuadPart=(tv.tv_sec+SECS_1601_TO_1970)*G_GINT64_CONSTANT(10000000)+tv.tv_usec*10; -} - - -/** - * KeSetTimer: - * @Timer: Previously initialized timer object. - * %NULL value is forbidden. - * @DueTime: If positive then absolute time to expire at. - * If negative then the relative time to expire at. - * @Dpc: If non %NULL then a #KDPC to be called when the timer expires. - * - * Sets the absolute or relative interval at which a timer object - * is to be set to the signaled state and optionally supplies a - * CustomTimerDpc to be executed when the timer expires. - * - * libcaptive does not support such timers and this function is a NOP there. - * - * Returns: %TRUE if the timer was already in the system timer queue. - * libcaptive always returns %FALSE. - */ -BOOLEAN KeSetTimer(PKTIMER Timer,LARGE_INTEGER DueTime,PKDPC Dpc) -{ - g_return_val_if_fail(Timer!=NULL,TRUE); - - /* NOP */ - - return FALSE; /* Timer was not yet in the system queue. */ -} - - -/** - * KeCancelTimer: - * @Timer: Timer to cancel. - * %NULL value is forbidden. - * - * Removes a timer from the system timer list. - * - * libcaptive does not support such timers and this function is a NOP there. - * - * Returns: %TRUE if the timer was running. - * libcaptive always returns %FALSE. - */ -BOOLEAN KeCancelTimer(PKTIMER Timer) -{ - g_return_val_if_fail(Timer!=NULL,TRUE); - - /* NOP */ - - return FALSE; /* Timer was not running. */ -} - - -/** - * KeInitializeTimer: - * @Timer: Caller supplied storage for the timer. - * - * Initalizes a kernel timer object. - * - * libcaptive does not support such timers and this function is a NOP there. - */ -VOID KeInitializeTimer(PKTIMER Timer) -{ - g_return_if_fail(Timer!=NULL); - - /* NOP */ -} - - -/** - * KeDelayExecutionThread: - * @WaitMode: Processor mode in which the caller is waiting. - * libcaptive requires %KernelMode value. - * @Altertable: Specifies if the wait is alertable. - * libcaptive requires %FALSE value. - * @Interval: Specifies the interval to wait. - * Pointer %NULL is forbidden. - * libcaptive ignores the value. - * - * Function puts the current thread into an alertable or nonalertable wait - * state for a given internal. libcaptive never waits. - * - * Returns: libcaptive returns %STATUS_SUCCESS (interval passed). - */ -NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode,BOOLEAN Alertable,PLARGE_INTEGER Interval) -{ - g_return_val_if_fail(WaitMode==KernelMode,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Alertable==FALSE,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Interval!=NULL,STATUS_INVALID_PARAMETER); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Interval=%lld, returning STATUS_SUCCESS",G_STRLOC, - (long long)Interval->QuadPart); - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/ke/wait.c b/src/libcaptive/ke/wait.c deleted file mode 100644 index 5006345..0000000 --- a/src/libcaptive/ke/wait.c +++ /dev/null @@ -1,61 +0,0 @@ -/* $Id$ - * reactos object wait emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include "reactos/ddk/status.h" /* for STATUS_SUCCESS */ -#include "reactos/napi/types.h" /* for NTSTATUS */ -#include -#include - - -/** - * KeWaitForSingleObject: - * @Object: Ignored. %NULL value is forbidden. - * @WaitReason: Ignored. - * @WaitMode: Ignored. - * @Alertable: Ignored. - * @Timeout: Ignored. - * - * Puts the current thread into a wait state until the - * given dispatcher @Object is set to signalled. - * Currently libcaptive doesn't use multithreading - * and thus this function is a NOP now. - * - * Returns: %STATUS_SUCCESS. - */ -NTSTATUS KeWaitForSingleObject - (PVOID Object,KWAIT_REASON WaitReason,KPROCESSOR_MODE WaitMode,BOOLEAN Alertable,PLARGE_INTEGER Timeout) -{ - g_return_val_if_fail(Object!=NULL,STATUS_INVALID_PARAMETER); - - /* ntfs.sys during IopMountFilesystem() will return STATUS_PENDING - * and it expects its ExQueueWorkItem() to be processed before evaluating - * the result of its driver call. - */ - while (g_main_context_iteration( - NULL, /* context; NULL means default one */ - FALSE)) /* may_block */ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: g_main_context_iteration() proceeded",G_STRLOC); - - - /* TODO:thread */ - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/ldr/Makefile.am b/src/libcaptive/ldr/Makefile.am deleted file mode 100644 index 36d77f8..0000000 --- a/src/libcaptive/ldr/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ -# automake source for the reactos's loader emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libldr.la -libldr_la_SOURCES= \ - loader.c diff --git a/src/libcaptive/ldr/loader.c b/src/libcaptive/ldr/loader.c deleted file mode 100644 index 51865ba..0000000 --- a/src/libcaptive/ldr/loader.c +++ /dev/null @@ -1,676 +0,0 @@ -/* $Id$ - * reactos ldr/ (loader) emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/ldr.h" /* self */ -#include "captive/ldr_exports.h" /* self */ -#include "reactos/internal/ldr.h" /* self */ -#include "captive/unicode.h" -#include "captive/rtl-file.h" -#include -#include -#include -#include "reactos/napi/types.h" -#include "reactos/internal/kd.h" /* for KDB_LOADDRIVER_HOOK */ -#include -#include /* for PROT_READ, MAP_SHARED */ -#include "captive/macros.h" -#include -#include "reactos/ntos/rtl.h" /* for InsertTailList() */ -#include "reactos/internal/debug.h" /* for assert() */ -#include /* for g_path_get_basename() */ -#include -#include "captive/options-module.h" - - -/* map: ExportAddress -> (struct captive_ModuleList_patchpoint *) */ -static GHashTable *captive_ModuleList_patchpoint_hash; - -/* initialize 'captive_ModuleList_patchpoint_hash' */ -static void captive_ModuleList_patchpoint_hash_init(void) -{ - if (captive_ModuleList_patchpoint_hash) - return; - captive_ModuleList_patchpoint_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - - -/* map: ExportAddress -> (CHAR *)funcname */ -static GHashTable *captive_ModuleList_function_disable_hash; - -/* initialize 'captive_ModuleList_function_disable_hash' */ -static void captive_ModuleList_function_disable_hash_init(void) -{ - if (captive_ModuleList_function_disable_hash) - return; - captive_ModuleList_function_disable_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - - -/* reactos/ntoskrnl/ldr/loader.c file-scope global declaration: */ -NTSTATUS LdrProcessModule(PVOID ModuleLoadBase,PUNICODE_STRING ModuleName,PMODULE_OBJECT *ModuleObject); -PVOID LdrGetExportAddress(PMODULE_OBJECT ModuleObject,char *Name,unsigned short Hint); - - -/* 'ntoskrnl/ldr/loader.c' file-scoped declaration: */ -VOID LdrpBuildModuleBaseName(PUNICODE_STRING BaseName,PUNICODE_STRING FullName); - - -static MODULE_OBJECT *captive_LdrLoadModule_gmodule(const gchar *Filename_utf8,const gchar *Filename_bslash_utf8) -{ -MODULE_OBJECT *r; -GModule *gmodule; -MODULE_TEXT_SECTION *ModuleTextSection; -gboolean errbool; - - g_return_val_if_fail(Filename_utf8!=NULL,NULL); - g_return_val_if_fail(Filename_bslash_utf8!=NULL,NULL); - g_return_val_if_fail(TRUE==g_module_supported(),NULL); - - gmodule=g_module_open(Filename_utf8, - 0); /* Flags; !LAZY */ - if (!gmodule) - g_message(g_module_error()); - g_assert(gmodule!=NULL); - - captive_new0(r); - - errbool=g_module_symbol(gmodule,"DriverEntry",&r->EntryPoint); - g_assert(errbool==TRUE); - - r->Base=(PVOID)gmodule; - r->Flags=MODULE_FLAG_COFF; /* some weird value - reactos uses MODULE_FLAG_PE */ - - RtlCreateUnicodeString(&r->FullName,captive_utf8_to_UnicodeString_alloca(Filename_bslash_utf8)->Buffer); - LdrpBuildModuleBaseName(&r->BaseName,&r->FullName); - - /* r->Length=0; */ - - /* Insert module */ - InsertTailList(&ModuleListHead,&r->ListEntry); - - captive_new0(ModuleTextSection); - /* ModuleTextSection->Base=0; */ - /* ModuleTextSection->Length=0; */ - ModuleTextSection->Name=g_memdup(r->BaseName.Buffer, - (captive_ucs2_strlen(r->BaseName.Buffer)+1)*sizeof(captive_ucs2)); - /* ModuleTextSection->OptionalHeader=NULL; */ - InsertTailList(&ModuleTextListHead,&ModuleTextSection->ListEntry); - r->TextSection=ModuleTextSection; - - return r; -} - - -/** - * captive_LdrLoadModule: - * @options_module: #captive_options_module structure describing the module to load. - * Loading of already loaded module is forbidden. - * @ModuleObjectp: Returns initialized module object. - * - * Load and initialize module to reactos using host OS functions. - * - * Returns: STATUS_SUCCESS if the module was loaded successfuly during the call. - */ -NTSTATUS captive_LdrLoadModule(struct captive_options_module *options_module,PMODULE_OBJECT *ModuleObjectp) -{ -PMODULE_OBJECT Module; -NTSTATUS err; -gchar *Filename_utf8=options_module->pathname_utf8; -gchar *Filename_bslash_utf8,*s; -UNICODE_STRING *Filename_bslash; - - *ModuleObjectp=NULL; - - /* Filename=~s#/#\\#g -> Filename_bslash to satisfy basename-derivations by reactos. */ - Filename_bslash_utf8=(/* de-const as we do not change the length */ gchar *)captive_strdup_alloca(Filename_utf8); - for (s=Filename_bslash_utf8;(s=strchr(s,'/'));s++) - *s='\\'; - Filename_bslash=captive_utf8_to_UnicodeString_alloca(Filename_bslash_utf8); - - switch (options_module->type) { - case CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY: g_assert_not_reached(); - - case CAPTIVE_OPTIONS_MODULE_TYPE_PE32: - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Loading module format: %s",G_STRLOC,"MZ/PE-32"); - /* examine/relocate the module */ - err=LdrProcessModule(options_module->u.pe32.base,Filename_bslash,&Module); - if (!NT_SUCCESS(err)) { - g_error("LdrLoadModule(): LdrProcessModule()=0x%08lX",(gulong)err); - goto err; - } - break; - - case CAPTIVE_OPTIONS_MODULE_TYPE_GMODULE: - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Loading module format: %s",G_STRLOC,"native .so"); - Module=captive_LdrLoadModule_gmodule(Filename_utf8,Filename_bslash_utf8); - g_assert(Module!=NULL); - } - - /* we were successful */ - *ModuleObjectp=Module; - - /* Hook for KDB on loading a driver. */ - KDB_LOADDRIVER_HOOK(Filename_bslash,Module); - - return STATUS_SUCCESS; - -err: - g_return_val_if_reached(err); -} - - -NTSTATUS LdrLoadModule(PUNICODE_STRING Filename,PMODULE_OBJECT *ModuleObject) -{ - return STATUS_OBJECT_NAME_NOT_FOUND; -} - - -/** - * captive_LdrpLoadAndCallImage: - * @ModuleObjectp: Returns PMODULE_OBJECT successfuly loaded. - * @options_module: #captive_options_module structure describing the module to load. - * Loading of already loaded module is forbidden despite original - * LdrpLoadAndCallImage(). - * @DriverEntry_DriverObject: argument #DriverObject of #PDRIVER_INITIALIZE call. - * @DriverEntry_RegistryPath: argument #RegistryPath of #PDRIVER_INITIALIZE call. - * - * Corresponds to reactos LdrpLoadAndCallImage() but it also provides arguments - * to pass to #PDRIVER_INITIALIZE call of module driver initialization. - * - * Returns: STATUS_SUCCESS if the driver module was loaded and initialized - * successfuly during this call. Ignore returned @ModuleObjectp if function failed. - */ -NTSTATUS captive_LdrpLoadAndCallImage(PMODULE_OBJECT *ModuleObjectp,struct captive_options_module *options_module, - PDRIVER_OBJECT DriverEntry_DriverObject,PUNICODE_STRING DriverEntry_RegistryPath) -{ -PDRIVER_INITIALIZE DriverEntry; -PMODULE_OBJECT ModuleObject_tmp; -NTSTATUS err; - -#if 0 /* TODO */ - /* check for duplicity */ - g_return_val_if_fail(LdrGetModuleObject(ModuleName)==NULL,STATUS_IMAGE_ALREADY_LOADED); -#endif - - /* provide our temporary storage if the caller doesn't want to know ModuleObject address */ - if (!ModuleObjectp) - ModuleObjectp=&ModuleObject_tmp; - - /* load the module */ - err=captive_LdrLoadModule(options_module,ModuleObjectp); - g_return_val_if_fail(NT_SUCCESS(err),err); - - /* initialize the module */ - DriverEntry=(PDRIVER_INITIALIZE)(*ModuleObjectp)->EntryPoint; - err=(NTSTATUS)captive_stdcall_call_8((CaptiveStdCallFunc8)DriverEntry, - DriverEntry_DriverObject, - DriverEntry_RegistryPath); - if (!NT_SUCCESS(err)) - goto err_LdrUnloadModule; - - /* assumed STATUS_SUCCESS */ - return err; - -err_LdrUnloadModule: - /* errors ignored */ - LdrUnloadModule(*ModuleObjectp); - *ModuleObjectp=NULL; -/* err: */ - g_return_val_if_reached(err); -} - - -/** - * captive_ModuleList_add_builtin: - * @FullName_utf8: String to fill in #PMODULE_OBJECT->FullName. - * @...: (const gchar *sym_name,void *sym_val) symbol list terminated by %NULL. - * - * Adds simulated built-in module to #ModuleListHead module list. - * It can be used for the functionality of reactos/ntoskrnl/ldr/loader.c/LdrInitModuleManagement(). - * libcaptive does not support Ordinals - we just pretend liner (%0-based) - * Ordinal numbers of the functions in given @... stdargs order. - * - * Returns: %TRUE if the module was successfuly added. - */ -gboolean captive_ModuleList_add_builtin(const gchar *FullName_utf8,...) -{ -MODULE_OBJECT *ModuleObject; -BOOLEAN errbool; -va_list ap; -const gchar *sym_name; -const void *sym_val; -gchar *basename_utf8; -IMAGE_DOS_HEADER *DosHeader; -IMAGE_NT_HEADERS *NTHeaders; -IMAGE_EXPORT_DIRECTORY *ExportDir; -guint symi,symN; /* index,number of passed stdarg sym_name/sym_val pairs */ -ptrdiff_t *NameList; /* filled by sym_name; MODULEOBJECT_BASE_OFFSET_MINUS()ed */ -WORD *OrdinalList; /* linear list - libcaptive doesn't support Ordinals */ -ptrdiff_t *FunctionList; /* filled by sym_val; MODULEOBJECT_BASE_OFFSET_MINUS()ed */ - - g_return_val_if_fail(FullName_utf8!=NULL,FALSE); - - captive_new0(ModuleObject); - /* A lot of offsets in the structures are relative to ModuleObject->Base */ -#define MODULEOBJECT_BASE_OFFSET_MINUS(addr) ((ptrdiff_t)((char *)addr-(char *)ModuleObject->Base)) - - ModuleObject->Flags = MODULE_FLAG_PE; - - /* fill ModuleObject->FullName - * ModuleObject->FullName should be probably "\\SYSTEM32\\..." style but - * we put there '/'-based UNIX filenames in libcaptive. - */ - errbool=RtlCreateUnicodeString(&ModuleObject->FullName,captive_utf8_to_UnicodeString_alloca(FullName_utf8)->Buffer); - if (!errbool) { - g_error("captive_ModuleList_add_builtin: RtlCreateUnicodeString()==FALSE"); - goto err_g_free_ModuleObject; - } - - /* fill ModuleObject->BaseName - * reactos/ntoskrnl/ldr/loader.c/LdrpBuildModuleBaseName() does this one - * but it is 'static' for that file and also it is stricly backslash based. - * ModuleObject->FullName should be probably "\\SYSTEM32\\..." style but - * we put there '/'-based UNIX filenames in libcaptive. - */ - basename_utf8=g_path_get_basename(FullName_utf8); - errbool=RtlCreateUnicodeString(&ModuleObject->BaseName,captive_utf8_to_UnicodeString_alloca(basename_utf8)->Buffer); - g_free(basename_utf8); - if (!errbool) { - g_error("captive_ModuleList_add_builtin: RtlCreateUnicodeString()==FALSE"); - goto err_g_free_ModuleObject; - } - - /* We must satisfy reactos/ntoskrnl/ldr/rtl.c/RtlImageDirectoryEntryToData(,,IMAGE_DIRECTORY_ENTRY_EXPORT) - * prepare module headers - */ - captive_new0(DosHeader); - ModuleObject->Base=DosHeader; /* link DosHeader to ModuleObject */ - DosHeader->e_magic=IMAGE_DOS_MAGIC; - captive_new0(NTHeaders); - DosHeader->e_lfanew=MODULEOBJECT_BASE_OFFSET_MINUS(NTHeaders); /* link NTHeaders to DosHeader */ - NTHeaders->Signature=IMAGE_PE_MAGIC; - NTHeaders->OptionalHeader.NumberOfRvaAndSizes=IMAGE_DIRECTORY_ENTRY_EXPORT+1; - NTHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size - =sizeof(*ExportDir); /* in bytes; just prevent LdrPEFixupForward() invocation */ - captive_new0(ExportDir); - NTHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress - =MODULEOBJECT_BASE_OFFSET_MINUS(ExportDir); /* link ExportDir to NTHeaders */ - ExportDir->Base=0; /* base Ordinal number; Ordinals are not supported by libcaptive */ - - /* count the number of symbols */ - va_start(ap,FullName_utf8); - for (symN=0;captive_va_arg(sym_name,ap);symN++) - captive_va_arg(sym_val,ap); - va_end(ap); - ExportDir->NumberOfNames=symN; - ExportDir->NumberOfFunctions=symN; - - /* allocate and link the symbol tables */ - captive_newn(NameList,symN); - ExportDir->AddressOfNames=(PDWORD *)MODULEOBJECT_BASE_OFFSET_MINUS(NameList); /* link NameList to ExportDir */ - captive_newn(OrdinalList,symN); - ExportDir->AddressOfNameOrdinals=(PWORD *)MODULEOBJECT_BASE_OFFSET_MINUS(OrdinalList); /* link OrdinalList to ExportDir */ - captive_newn(FunctionList,symN); - ExportDir->AddressOfFunctions=(PDWORD *)MODULEOBJECT_BASE_OFFSET_MINUS(FunctionList); /* link FunctionList to ExportDir */ - - /* fill in symbol tables */ - va_start(ap,FullName_utf8); - for (symi=0;symiListEntry); - return TRUE; - -err_g_free_ModuleObject: - g_free(ModuleObject); -/* err */ - g_return_val_if_reached(FALSE); -} - -static void instruction_fail(const guint8 *instr_base,gint offset_last,const gchar *location) -{ -char instr_buf[4*3+1],*s; - - g_return_if_fail(offset_last<=(gint)((sizeof(instr_buf)-1)/3)); - - s=instr_buf; - while (offset_last-->=0) - s+=sprintf(s," %02X",*instr_base++); - g_error("instruction_length(): Unhandled at %s:%s",location,instr_buf); - /* NOTREACHED */ -} - -static gsize instruction_length(const guint8 *instr) -{ -#define INSTRUCTION_FAIL(offset_last) instruction_fail(instr,(offset_last),G_STRLOC) - - if ((instr[0] & 0xF8)==0x50) /* push %regular-register */ - return 1; - if ((instr[0] & 0xF8)==0x58) /* pop %regular-register */ - return 1; - if ((instr[0] & 0xE7)==0x06) /* push %segment-register */ - return 1; - if ((instr[0] & 0xE7)==0x07 && instr[0]!=0x0F) /* pop %segment-register */ - return 1; - switch (instr[0]) { - case 0x33: /* xor GB,Ev */ - return 1+1; - case 0x64: /* prefix %fs */ - return instruction_length(instr+1); - case 0x68: /* push $quad-byte */ - return 1+4; - case 0x6A: /* push $single-byte */ - return 1+1; - case 0x80: - switch (instr[1]) { - case 0x3D: /* cmpb $byte,immediate-quad-indirect */ - return 1+1+4+1; /* 80 3D immediate-quad-indirect byte */ - case 0x7C: /* cmpb $byte,#immediate(%reg,1) */ - return 1+1+1+1+1; /* 80 7C address-mode immediate byte */ - default: INSTRUCTION_FAIL(1); - } - case 0x83: - switch (instr[1]) { - case 0x01: /* addl $byte,(%ecx) */ - return 1+1+1; - case 0x3D: /* cmpl $byte,immediate-quad-indirect */ - return 1+1+4+1; /* 83 3D immediate-quad-indirect byte */ - case 0x7C: /* cmpl $byte,#immediate(%reg,1) */ - return 1+1+1+1+1; /* 80 7C address-mode immediate byte */ - default: INSTRUCTION_FAIL(1); - } - case 0x8A: /* mov ??,?? */ - case 0x8B: /* mov Gb,Eb */ - switch (instr[1]) { - case 0x0D: /* mov immediate-quad-indirect,%ecx */ - return 1+1+4; - case 0x15: /* mov immediate-quad-indirect,%edx */ - return 1+1+4; - case 0x44: /* mov #offset(%reg,%reg,#mult),%reg */ - case 0x4C: /* mov #offset(%reg,#mult),%reg */ - case 0x54: /* mov #offset(%reg,#mult),%reg */ - return 1+1+1+1; /* 8B 44 address-mode offset */ - case 0xC0: /* mov %eax,%eax */ - return 2; - case 0xFF: /* mov %edi,%edi */ - return 2; - default: INSTRUCTION_FAIL(1); - } - case 0x8D: /* lea Gb,M */ - switch (instr[1]) { - case 0x44: /* mov #offset(%reg,%reg,#mult),%reg */ - return 4; /* 8B 44 address-mode offset */ - default: INSTRUCTION_FAIL(1); - } - case 0x8F: /* lea Gb,M */ - switch (instr[1]) { - case 0x04: - switch (instr[2]) { - case 0x24: /* popl (%esp,1) */ - return 3; - default: INSTRUCTION_FAIL(2); - } - default: INSTRUCTION_FAIL(1); - } - case 0x9C: /* pushf */ - return 1; - case 0x9D: /* popf */ - return 1; - case 0xA1: /* mov immediate-quad-indirect,%eax */ - return 1+4; - case 0xB8: /* mov $immediate-quad,%eax */ - return 1+4; - case 0xC2: /* ret $immediate-double */ - return 1+2; - case 0xCC: /* int $0x3 */ - return 1; - case 0xF0: /* lock prefix */ - return 1+instruction_length(instr+1); - case 0xFA: /* cli */ - return 1; - case 0xFB: /* sti */ - return 1; - case 0xFF: /* inc/dec Ev */ - return 2; - default: INSTRUCTION_FAIL(0); - } - g_assert_not_reached(); /* TODO:fill the table */ - /* NOTREACHED */ - return 0; - -#undef INSTRUCTION_FAIL -} - - - /* A lot of offsets in the structures are relative to ModuleObject->Base */ -#define MODULEOBJECT_BASE_OFFSET_PLUS(addr) ((gpointer)((char *)addr+(ptrdiff_t)ModuleObject->Base)) - -static void captive_ModuleList_patch_function_disable - (CHAR *funcname,PVOID *ExportAddressp,MODULE_OBJECT *ModuleObject /* user_data */) -{ -PVOID ExportAddress; - - g_return_if_fail(funcname!=NULL); - g_return_if_fail(ExportAddressp!=NULL); - g_return_if_fail(ModuleObject!=NULL); - - ExportAddress=(PVOID)MODULEOBJECT_BASE_OFFSET_PLUS(*ExportAddressp); - g_return_if_fail(ExportAddress!=NULL); - - /* Some alised name; safe to ignore as we checked for possible W32 binary 0xF4 - * hits during our initialization in captive_ModuleList_patch(). - */ - if (0xF4 /* hlt */ ==*(guint8 *)ExportAddress) - return; - - captive_ModuleList_function_disable_hash_init(); - - *(guint8 *)ExportAddress=0xF4; /* hlt */ - /* We may get aliased here; already existing entry is therefore allowed. */ - g_hash_table_insert(captive_ModuleList_function_disable_hash, - ExportAddress, /* key */ - funcname); /* value */ -} - - -/** - * captive_ModuleList_patch: - * @FullName_utf8: String to find #PMODULE_OBJECT by #FullName. - * @...: (const gchar *sym_name,void (*sym_val)(void),struct captive_ModuleList_patchpoint *patchpoint) symbol list terminated by %NULL. - * - * Patches existing @FullName_utf8 module to use for function named #sym_name - * pointer to the handler #sym_val. If #patchpoint is not %NULL it gets assigned the original - * pointer value (used for %pass keyword in #exports.captivesym). - * - * Put here 0xF4 'hlt' instead of 0xCC 'int $0x3; breakpoint' - * as 'hlt' will generate handled SIGSEGV instead of SIGTRAP which - * is used by gdb(1) during debugging. - * See also libcaptive/ps/signal.c/ sigaction_SIGSEGV(). - * - * Returns: %TRUE if the module was successfuly added. - */ -gboolean captive_ModuleList_patch(const gchar *FullName_utf8,...) -{ -MODULE_OBJECT *ModuleObject; -va_list ap; -IMAGE_EXPORT_DIRECTORY *ExportDir; -ptrdiff_t *NameList; /* filled by sym_name; MODULEOBJECT_BASE_OFFSET_PLUS()ed */ -WORD *OrdinalList; /* linear list - libcaptive doesn't support Ordinals */ -ptrdiff_t *FunctionList; /* filled by sym_val; MODULEOBJECT_BASE_OFFSET_PLUS()ed */ -ULONG ExportDirSize; -USHORT Idx; -PVOID ExportAddress,*ExportAddressp; -const gchar *sym_name; -void (*sym_val)(void); -struct captive_ModuleList_patchpoint *patchpoint,*patchpointpatch; -GHashTable *exportdir_hash; -gboolean errbool; - - g_return_val_if_fail(FullName_utf8!=NULL,FALSE); - - captive_ModuleList_patchpoint_hash_init(); - - ModuleObject=LdrGetModuleObject(captive_utf8_to_UnicodeString_alloca(g_path_get_basename(FullName_utf8))); - g_return_val_if_fail(ModuleObject!=NULL,FALSE); - - ExportDir=(PIMAGE_EXPORT_DIRECTORY)RtlImageDirectoryEntryToData(ModuleObject->Base, - TRUE,IMAGE_DIRECTORY_ENTRY_EXPORT,&ExportDirSize); - g_return_val_if_fail(ExportDir!=NULL,FALSE); - - NameList =MODULEOBJECT_BASE_OFFSET_PLUS(ExportDir->AddressOfNames); - OrdinalList =MODULEOBJECT_BASE_OFFSET_PLUS(ExportDir->AddressOfNameOrdinals); - FunctionList=MODULEOBJECT_BASE_OFFSET_PLUS(ExportDir->AddressOfFunctions); - - /* map (CHAR *)funcname->(PVOID *)ExportAddressp */ - exportdir_hash=g_hash_table_new(g_str_hash,g_str_equal); - - /* Initialize 'exportdir_hash' by all W32 exported functions. */ - for (Idx=0;IdxNumberOfNames;Idx++) { -CHAR *funcname=MODULEOBJECT_BASE_OFFSET_PLUS(NameList[Idx]); - - ExportAddressp=(PVOID *)(FunctionList+OrdinalList[Idx]); - ExportAddress=(PVOID)MODULEOBJECT_BASE_OFFSET_PLUS(*ExportAddressp); - if (0xF4 /* hlt */ ==*(guint8 *)ExportAddress) { - /* FIXME: 'data' type symbols should be permitted to have 0xF4 byte */ - g_error("%s: Function already patched although we did not touch it yet: %s",G_STRLOC,funcname); - g_assert_not_reached(); - } - g_assert(NULL==g_hash_table_lookup(exportdir_hash,funcname)); - g_hash_table_insert(exportdir_hash, - funcname, /* key */ - ExportAddressp); /* value */ - } - - /* Patch wished functions and remove them from 'exportdir_hash'. */ - va_start(ap,FullName_utf8); - while (captive_va_arg(sym_name,ap)) { - captive_va_arg(sym_val ,ap); - /* 'sym_val' may be NULL if 'data' type && "pass"ed */ - captive_va_arg(patchpoint,ap); /* 'data' type if ==NULL */ - captive_va_arg(patchpointpatch,ap); /* 'data' type or 'pass' in non-debug mode if ==NULL */ - ExportAddressp=g_hash_table_lookup(exportdir_hash,sym_name); - if (ExportAddressp==NULL) { - g_message("%s: Function not found for patchpoint (ignoring): %s",G_STRLOC,sym_name); - continue; - } - errbool=g_hash_table_remove(exportdir_hash,sym_name); - g_assert(errbool==TRUE); - if (!sym_val) { /* 'data' type && "pass"ed => do not corrupt it by 0xF4 */ - g_assert(!patchpoint); - continue; - } - ExportAddress=(PVOID)MODULEOBJECT_BASE_OFFSET_PLUS(*ExportAddressp); - *ExportAddressp=(PVOID)MODULEOBJECT_BASE_OFFSET_MINUS(sym_val); - if (((ULONG)ExportAddress >= (ULONG)ExportDir) && - ((ULONG)ExportAddress < (ULONG)ExportDir + ExportDirSize)) - g_assert_not_reached(); /* LdrPEFixupForward() needed */ - if (!patchpoint) /* 'data' type && !"pass"ed => do not corrupt it by 0xF4 */ - continue; - patchpoint->orig_w32_func=ExportAddress; - if (!patchpointpatch) /* 'pass' in non-debug mode */ - continue; - if (0xF4 /* hlt */ ==*patchpointpatch->orig_w32_func) /* Already patched by name-aliased function? */ - continue; - g_assert(0xF4 /* hlt */ !=*patchpointpatch->orig_w32_func); - patchpointpatch->orig_w32_2ndinstr=patchpointpatch->orig_w32_func - +instruction_length((guint8 *)patchpointpatch->orig_w32_func); - g_assert(0xF4 /* hlt */ !=*patchpointpatch->orig_w32_2ndinstr); - patchpointpatch->wrap_wrap_func=sym_val; - patchpointpatch->orig_w32_func_byte=*patchpointpatch->orig_w32_func; - patchpointpatch->orig_w32_2ndinstr_byte=*patchpointpatch->orig_w32_2ndinstr; - patchpointpatch->through_w32_func=FALSE; - g_assert(NULL==g_hash_table_lookup(captive_ModuleList_patchpoint_hash,patchpointpatch->orig_w32_func)); - g_hash_table_insert(captive_ModuleList_patchpoint_hash, - patchpointpatch->orig_w32_func, /* key */ - patchpointpatch); /* value */ - g_assert(NULL==g_hash_table_lookup(captive_ModuleList_patchpoint_hash,patchpointpatch->orig_w32_2ndinstr)); - g_hash_table_insert(captive_ModuleList_patchpoint_hash, - patchpointpatch->orig_w32_2ndinstr, /* key */ - patchpointpatch); /* value */ - *(guint8 *)ExportAddress=0xF4; /* hlt */ - } - va_end(ap); - - /* The remaining entries of 'exportdir_hash' are W32 native functions - * unspecified by .captivesym file; we patch them as not-implemented ones. - */ - g_hash_table_foreach(exportdir_hash, - (GHFunc)captive_ModuleList_patch_function_disable, /* func */ - ModuleObject); /* used_data; unused */ - - g_hash_table_destroy(exportdir_hash); - -#undef MODULEOBJECT_BASE_OFFSET_PLUS /* no longer valid */ -#undef MODULEOBJECT_BASE_OFFSET_MINUS /* no longer valid */ - return TRUE; -} - - -struct captive_ModuleList_patchpoint *captive_ModuleList_patchpoint_find(gconstpointer ExportAddress) -{ -struct captive_ModuleList_patchpoint *r; - - g_return_val_if_fail(ExportAddress!=NULL,NULL); - - captive_ModuleList_patchpoint_hash_init(); - - r=g_hash_table_lookup(captive_ModuleList_patchpoint_hash,ExportAddress); - g_return_val_if_fail(r!=NULL,NULL); - g_assert(r->orig_w32_func==ExportAddress || r->orig_w32_2ndinstr==ExportAddress); - - return r; -} - - -G_CONST_RETURN gchar *captive_ModuleList_function_disable_find(gconstpointer ExportAddress) -{ - g_return_val_if_fail(ExportAddress!=NULL,NULL); - - return g_hash_table_lookup(captive_ModuleList_function_disable_hash,ExportAddress); /* funcname */ -} - - -void *captive_Module_GetExportAddress(const gchar *ModuleName_utf8,const gchar *FunctionName) -{ -MODULE_OBJECT *ModuleObject; -void *r; - - g_return_val_if_fail(ModuleName_utf8!=NULL,NULL); - g_return_val_if_fail(FunctionName!=NULL,NULL); - - ModuleObject=LdrGetModuleObject(captive_utf8_to_UnicodeString_alloca(g_path_get_basename(ModuleName_utf8))); - g_return_val_if_fail(ModuleObject!=NULL,NULL); - - r=LdrGetExportAddress( - ModuleObject, /* ModuleObject */ - (/* de-const */char *)FunctionName, /* Name */ - -1); /*Hint*/ - g_return_val_if_fail(r!=NULL,NULL); - - return r; -} diff --git a/src/libcaptive/mm/Makefile.am b/src/libcaptive/mm/Makefile.am deleted file mode 100644 index 979512b..0000000 --- a/src/libcaptive/mm/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# $Id$ -# automake source for the reactos's mm/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libmm.la -libmm_la_SOURCES= \ - marea.c \ - mdl.c \ - memsafe.c \ - mminit.c \ - page.c \ - pool.c \ - routine.c \ - section.c diff --git a/src/libcaptive/mm/marea.c b/src/libcaptive/mm/marea.c deleted file mode 100644 index bd430b3..0000000 --- a/src/libcaptive/mm/marea.c +++ /dev/null @@ -1,95 +0,0 @@ -/* $Id$ - * reactos MemoryArea emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/internal/mm.h" /* self */ -#include -#include -#include "captive/macros.h" - - -/** - * MmCreateMemoryArea: - * @Process: #PEPROCESS owning the memory being allocated. Ignored by libcaptive. - * %NULL value is forbidden. - * @AddressSpace: #PMADDRESS_SPACE where to place the allocation. Ignored by libcaptive. - * %NULL value is forbidden. - * @Type: Unknown. Ignored by libcaptive (copied to target @Result). - * @BaseAddress: Requests/returns required/allocated memory fixed address. - * FIXME: Pointed value required %NULL by libcaptive. - * %NULL pointer is forbidden. - * @Length: Allocation length. %PAGE_SIZE round up by libcaptive (FIXME: needed?). - * @Attributes: Unknown. Ignored by libcaptive (copied to target @Result). - * @Result: Returns new allocated #MEMORY_AREA. Previous pointed value lost. - * %NULL pointer is forbidden. - * @FixedAddress: Whether @BaseAddress points to the required address. - * FIXME: %FALSE required by libcaptive. - * @TopDown: %TRUE if we should search the area from the top of memory address space. - * Ignored by libcaptive. - * - * Reserves the memory of size @Length from @AddressSpace. - * FIXME: libcaptive currently does not enqueue this allocation to @AddressSpace. - * - * libcaptive currently automatically fills the reserved memory space with a real - * read/write non-executable memory pages allocated by MmAllocateSection(). - * It is currently being (mis)used by ntoskrnl/cc/view.c/CcRosCreateCacheSegment(). - * This preallocation should not hurt as our memory just may get overriden - * by another one. - * - * Returns: %STATUS_SUCCESS if the allocation was successful. - * @Result will contain a new #MEMORY_AREA in such case. - */ -NTSTATUS MmCreateMemoryArea(PEPROCESS Process,PMADDRESS_SPACE AddressSpace, - ULONG Type,PVOID* BaseAddress,ULONG Length,ULONG Attributes,MEMORY_AREA** Result,BOOL FixedAddress,BOOL TopDown) -{ -MEMORY_AREA *marea; - - g_return_val_if_fail(Process!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(AddressSpace!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(BaseAddress!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Length>0,STATUS_INVALID_PARAMETER); - - /* FIXME: Fixed allocations not implemented yet */ - g_assert(*BaseAddress==NULL && !FixedAddress); - - /* round-up - is it needed? */ - Length=(Length|(PAGE_SIZE-1))+1; - - /* We allocate the memory although it is not expected from such W32 call */ - *BaseAddress=MmAllocateSection(Length); - g_assert(*BaseAddress!=NULL); - - /* FIXME: Why is reactos doring '(*BaseAddress)+=PAGE_SIZE' - * in ntoskrnl/mm/marea.c/MmCreateMemoryArea() ? - */ - - captive_new0(*Result); - marea=*Result; - marea->Type=Type; - marea->BaseAddress=*BaseAddress; - marea->Length=Length; - marea->Attributes=Attributes; - marea->LockCount=0; - marea->Process=Process; - marea->PageOpCount=0; - marea->DeleteInProgress=FALSE; - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/mm/mdl.c b/src/libcaptive/mm/mdl.c deleted file mode 100644 index 5e9f1f4..0000000 --- a/src/libcaptive/mm/mdl.c +++ /dev/null @@ -1,155 +0,0 @@ -/* $Id$ - * reactos MDL emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/mmfuncs.h" /* self */ -#include - - -/** - * MmProbeAndLockPages: - * @Mdl: Pointer to the #MDL specification structure to probe and lock. - * %NULL value is forbidden. - * @AccessMode: Access at which to lock the pages. %KernelMode required by libcaptive. - * @Operation: One of %IoReadAccess, %IoWriteAccess or %IoModifyAccess. - * - * Probles the specified @AccessMode and locks those pages specified by @Mdl to memory - * with the desired @AccessMode. - * libcaptive does NOP here as it just sets the %MDL_PAGES_LOCKED flag. - */ -VOID MmProbeAndLockPages(PMDL Mdl,KPROCESSOR_MODE AccessMode,LOCK_OPERATION Operation) -{ - g_return_if_fail(Mdl!=NULL); - g_return_if_fail(AccessMode==KernelMode /* || AccessMode==UserMode */); - - Mdl->MdlFlags|=MDL_PAGES_LOCKED; -} - - -/** - * MmUnlockPages: - * @Mdl: Pointer to the #MDL specification structure to unlock. - * %NULL value is forbidden. - * - * Unlock the pages specified by @Mdl from memory. - * libcaptive does NOP here as it just clears the %MDL_PAGES_LOCKED flag. - */ -VOID MmUnlockPages(PMDL Mdl) -{ - g_return_if_fail(Mdl!=NULL); - - Mdl->MdlFlags&=~MDL_PAGES_LOCKED; -} - - -/** - * MmMapLockedPages: - * @Mdl: Pointer to the #MDL specification structure to map. - * %NULL value is forbidden. - * @AccessMode: Access at which to lock the pages. %KernelMode required by libcaptive. - * - * Leaves the pages at their original location as they are never moved anyway - * by libcaptive. - * - * Returns: Address of the mapped pages base. - * This offset does not neet to be %PAGE_SIZE aligned. - */ -PVOID MmMapLockedPages(PMDL Mdl,KPROCESSOR_MODE AccessMode) -{ - g_return_val_if_fail(Mdl!=NULL,NULL); - g_assert(Mdl->StartVa!=NULL); - g_return_val_if_fail(AccessMode==KernelMode /* || AccessMode==UserMode */ ,NULL); - - if (Mdl->MdlFlags&MDL_MAPPED_TO_SYSTEM_VA) { - /* already mapped */ - g_assert(Mdl->MappedSystemVa==Mdl->StartVa+Mdl->ByteOffset); - } - else { - /* new mapping */ - Mdl->MappedSystemVa=Mdl->StartVa+Mdl->ByteOffset; - Mdl->MdlFlags|=MDL_MAPPED_TO_SYSTEM_VA; - } - - return Mdl->MappedSystemVa; -} - - -/** - * MmUnmapLockedPages: - * @BaseAddress: Address of the mapped pages base. - * This offset does not neet to be %PAGE_SIZE aligned. - * @Mdl: Pointer to the #MDL specification structure to unmap. - * - * Declares the specified @Mdl pages as unmapped. @BaseAddress - * is required to be previously returned by MmMapLockedPages(). - * You must not call this function twice without MmMapLockedPages() between. - */ -VOID MmUnmapLockedPages(PVOID BaseAddress,PMDL Mdl) -{ - g_return_if_fail(BaseAddress!=NULL); - g_return_if_fail(Mdl!=NULL); - g_return_if_fail(BaseAddress==Mdl->MappedSystemVa); - - /* No mapping is done for pages from MmBuildMdlForNonPagedPool(). */ - if (Mdl->MdlFlags&MDL_SOURCE_IS_NONPAGED_POOL) { - g_return_if_fail(!(Mdl->MdlFlags&MDL_MAPPED_TO_SYSTEM_VA)); - } - else { - g_return_if_fail(Mdl->MdlFlags&MDL_MAPPED_TO_SYSTEM_VA); - Mdl->MdlFlags&=~MDL_MAPPED_TO_SYSTEM_VA; - } - Mdl->MappedSystemVa=NULL; -} - -/** - * MmMapLockedPagesSpecifyCache: - * @Mdl: Pointer to the #MDL specification structure to map. - * %NULL value is forbidden. - * @AccessMode: Access at which to lock the pages. %KernelMode required by libcaptive. - * @CacheType: Suggested caching type. %MmNonCached, %MmCached or %MmWriteCombined required by libcaptive. - * @BaseAddress: Required block base address if @AccessMode is %UserMode. Ignored by libcaptive. - * @BugCheckOnFailure: Whether to call KeBugCheck() instead of returning %NULL. Ignored by libcaptive. - * @Priority: Suggested pages priority. %LowPagePriority, %NormalPagePriority or %HighPagePriority required by libcaptive. - * - * Leaves the pages at their original location as they are never moved anyway - * by libcaptive. This call is just a wrapper around MmMapLockedPages() in libcaptive. - * - * Returns: Address of the mapped pages base. - * This offset does not neet to be %PAGE_SIZE aligned. - */ -PVOID MmMapLockedPagesSpecifyCache(IN PMDL Mdl, - IN KPROCESSOR_MODE AccessMode,IN MEMORY_CACHING_TYPE CacheType,IN PVOID BaseAddress, - IN ULONG BugCheckOnFailure,IN MM_PAGE_PRIORITY Priority) -{ - g_return_val_if_fail(Mdl!=NULL,NULL); - g_return_val_if_fail(AccessMode==KernelMode /* || AccessMode==UserMode */ ,NULL); - g_return_val_if_fail(0 - || CacheType==MmNonCached - || CacheType==MmCached - || CacheType==MmWriteCombined, - NULL); - g_return_val_if_fail(0 - || Priority==LowPagePriority - || Priority==NormalPagePriority - || Priority==HighPagePriority, - NULL); - - return MmMapLockedPages(Mdl,AccessMode); -} diff --git a/src/libcaptive/mm/memsafe.c b/src/libcaptive/mm/memsafe.c deleted file mode 100644 index 0ce26e8..0000000 --- a/src/libcaptive/mm/memsafe.c +++ /dev/null @@ -1,84 +0,0 @@ -/* $Id$ - * reactos memory user/kernel memory handling functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/internal/mm.h" /* self */ -#include -#include - - -/** - * MmSafeCopyFromUser: - * @Dest: Destination memory area address. - * %NULL value is forbidden. - * @Src: Source memory area address. - * %NULL value is forbidden. - * @NumberOfBytes: Length of memory area. - * - * This function moves the data between two memory areas. - * Given memory areas must not overlap. - * libcaptive does not differentiate between user and kernel memory - this functions - * implements the simple memcpy() function. - * - * Returns: %STATUS_SUCCESS if the memory was copied successfuly. - */ -NTSTATUS MmSafeCopyFromUser(PVOID Dest,const VOID *Src,ULONG NumberOfBytes) -{ - g_return_val_if_fail(Dest!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Dest+NumberOfBytes>=Dest,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Src!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Src+NumberOfBytes>=Src,STATUS_INVALID_PARAMETER); - /* do not overlap: */ - g_return_val_if_fail((Dest+NumberOfBytes<=Src || Dest>=Src+NumberOfBytes),STATUS_INVALID_PARAMETER); - - memcpy(Dest,Src,NumberOfBytes); - - return STATUS_SUCCESS; -} - - -/** - * MmSafeCopyToUser: - * @Dest: Destination memory area address. - * %NULL value is forbidden. - * @Src: Source memory area address. - * %NULL value is forbidden. - * @NumberOfBytes: Length of memory area. - * - * This function moves the data between two memory areas. - * Given memory areas must not overlap. - * libcaptive does not differentiate between user and kernel memory - this functions - * implements the simple memcpy() function. - * - * Returns: %STATUS_SUCCESS if the memory was copied successfuly. - */ -NTSTATUS MmSafeCopyToUser(PVOID Dest,const VOID *Src,ULONG NumberOfBytes) -{ - g_return_val_if_fail(Dest!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Dest+NumberOfBytes>=Dest,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Src!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Src+NumberOfBytes>=Src,STATUS_INVALID_PARAMETER); - /* do not overlap: */ - g_return_val_if_fail((Dest+NumberOfBytes<=Src || Dest>=Src+NumberOfBytes),STATUS_INVALID_PARAMETER); - - memcpy(Dest,Src,NumberOfBytes); - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/mm/mminit.c b/src/libcaptive/mm/mminit.c deleted file mode 100644 index 76fa5f5..0000000 --- a/src/libcaptive/mm/mminit.c +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id$ - * reactos overall memory management emulation for reactos of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/mmfuncs.h" /* self */ -#include "reactos/ddk/mmtypes.h" /* for MmSmallSystem/MmMediumSystem/MmLargeSystem */ - - -/* CONFIG: */ -#define CAPTIVE_SYSTEM_SIZE (MmSmallSystem) - - -/** - * MmQuerySystemSize: - * - * Fixed constant. - * - * Returns: %$(top_srcdir)/src/libcaptive/mm/mminit.c/CAPTIVE_SYSTEM_SIZE. - */ -MM_SYSTEM_SIZE MmQuerySystemSize(VOID) -{ - return CAPTIVE_SYSTEM_SIZE; -} diff --git a/src/libcaptive/mm/page.c b/src/libcaptive/mm/page.c deleted file mode 100644 index 5778ce8..0000000 --- a/src/libcaptive/mm/page.c +++ /dev/null @@ -1,240 +0,0 @@ -/* $Id$ - * reactos spinlock emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/mm.h" /* self */ -#include "reactos/internal/mm.h" /* self */ -#include "reactos/ntos/types.h" /* for PVOID etc. */ -#include -#include /* for PROT_NONE etc. */ -#include - - -/** - * captive_flProtect_to_mmap_prot: - * @flProtect: reactos compatible constant such as %PAGE_READWRITE. - * - * Map reactos flProtect to mprotect(2)-compatible "prot" argument. - * - * Returns: mmap(2) compatible @prot argument. - */ -gint captive_flProtect_to_mmap_prot(ULONG flProtect) -{ - flProtect&=~PAGE_NOCACHE; /* too low level for libcaptive */ - flProtect&=~PAGE_SYSTEM; /* too low level for libcaptive */ - /* FIXME: what does mean PAGE_WRITETHROUGH ? */ - switch (flProtect) { - case PAGE_GUARD: return PROT_NONE; - case PAGE_NOACCESS: return PROT_NONE; - case PAGE_READONLY: return PROT_READ; - case PAGE_READWRITE: return PROT_READ|PROT_WRITE; - case PAGE_WRITECOPY: g_return_val_if_reached(PROT_NONE); /* FIXME: no multithreading supported */ - case PAGE_EXECUTE_READ: return PROT_EXEC|PROT_READ; - case PAGE_EXECUTE_READWRITE: return PROT_EXEC|PROT_READ|PROT_WRITE; - case PAGE_EXECUTE_WRITECOPY: g_return_val_if_reached(PROT_NONE); /* FIXME: no multithreading supported */ - } - g_return_val_if_reached(PROT_NONE); /* =unsupported flags */ -} - - -static GHashTable *captive_mmap_map_hash; - -static void captive_mmap_map_hash_init(void) -{ - if (captive_mmap_map_hash) - return; - captive_mmap_map_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - -/** - * captive_mmap_map_new: - * @addr: %PAGE_SIZE aligned address of memory block. - * %NULL value is forbidden. - * @len: %PAGE_SIZE aligned length of memory block. - * Value %0 is permitted. Value %-1 is forbidden. - * @mmap_prot: Protections for the memory block as specified by @prot of mprotect(2). - * - * Initialize the protection map for the specified memory block. - * Any existing protections in the specified block are forbidden. - * - * This function does not do any mprotect(2) style, it just stores - * the settings for the later %OR operations by MmSetPageProtect(). - * Caller is responsibel to set the same protections as the given @mmap_prot. - * - * Returns: %TRUE if the protection storage was successful. - */ -gboolean captive_mmap_map_new(gconstpointer addr,size_t len,int mmap_prot) -{ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: addr=%p,len=%lu,mmap_prot=0x%X",G_STRLOC,addr,(gulong)len,mmap_prot); - g_return_val_if_fail(addr!=NULL,FALSE); - g_return_val_if_fail((GPOINTER_TO_UINT(addr)&(PAGE_SIZE-1))==0,FALSE); - g_return_val_if_fail((len&(PAGE_SIZE-1))==0,FALSE); - g_return_val_if_fail(mmap_prot!=-1,FALSE); - - captive_mmap_map_hash_init(); - - while (len) { - g_return_val_if_fail(FALSE==g_hash_table_lookup_extended(captive_mmap_map_hash, - addr, /* lookup_key */ - NULL, /* orig_key */ - NULL), /* value */ - FALSE); - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: addr=%p,PAGE_SIZE=0x%X",G_STRLOC,addr,(guint)(PAGE_SIZE)); - g_hash_table_insert(captive_mmap_map_hash, - (gpointer)addr, /* key */ - GINT_TO_POINTER(mmap_prot)); /* value */ - - addr=(gconstpointer)(((const char *)addr)+PAGE_SIZE); - len-=PAGE_SIZE; - } - - return TRUE; -} - - -/** - * captive_mmap_map_get: - * @addr: %PAGE_SIZE aligned address of memory block. - * %NULL value is forbidden. - * - * Query the protection settings at @addr address. - * The given @addr block of %PAGE_SIZE must be already initialized - * by captive_mmap_map_new(). - * - * Returns: Protections of the page as specified by @prot of mprotect(2) - * if successful. Value %-1 if failed. - */ -gint captive_mmap_map_get(gconstpointer addr) -{ -gpointer r_gpointer; -gint r; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: addr=%p",G_STRLOC,addr); - g_return_val_if_fail(addr!=NULL,-1); - g_return_val_if_fail((GPOINTER_TO_UINT(addr)&(PAGE_SIZE-1))==0,-1); - - captive_mmap_map_hash_init(); - - g_return_val_if_fail(TRUE==g_hash_table_lookup_extended(captive_mmap_map_hash, - addr, /* lookup_key */ - NULL, /* orig_key */ - &r_gpointer), /* value */ - -1); - r=GPOINTER_TO_INT(r_gpointer); - - g_assert(r!=-1); - return r; -} - - -/** - * captive_mmap_map_set: - * @addr: %PAGE_SIZE aligned address of memory block. - * %NULL value is forbidden. - * @mmap_prot: Protections for the memory block as specified by @prot of mprotect(2). - * - * Set the protection settings at @addr address. - * The given @addr block of %PAGE_SIZE must be already initialized - * by captive_mmap_map_new(). - * - * Returns: %TRUE if the protections were successfuly set. - */ -gboolean captive_mmap_map_set(gconstpointer addr,int mmap_prot) -{ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: addr=%p,mmap_prot=0x%X",G_STRLOC,addr,mmap_prot); - g_return_val_if_fail(addr!=NULL,FALSE); - g_return_val_if_fail((GPOINTER_TO_UINT(addr)&(PAGE_SIZE-1))==0,FALSE); - g_return_val_if_fail(mmap_prot!=-1,FALSE); - - captive_mmap_map_hash_init(); - - g_return_val_if_fail(TRUE==g_hash_table_lookup_extended(captive_mmap_map_hash, - addr, /* lookup_key */ - NULL, /* orig_key */ - NULL), /* value */ - FALSE); - - g_hash_table_replace(captive_mmap_map_hash, - (gpointer)addr, /* key */ - GINT_TO_POINTER(mmap_prot)); /* value */ - - return TRUE; -} - -/** - * MmSetPageProtect: - * @Process: Attached during the execution if not %NULL. Ignored by #libcaptive. - * @Address: One page to modify the protecton bits of. - * @flProtect: Required protection flags to logically %OR to the previos ones. - * - * FIXME: Undocumented by reactos. %ORes the protection of one page located at @Address - * with protection flags @flProtect. Implemented by mprotect(2) by #libcaptive. - */ -VOID MmSetPageProtect(PEPROCESS Process,PVOID Address,ULONG flProtect) -{ -gint mmap_prot; -int err; - - g_return_if_fail(Address!=NULL); - - captive_mmap_map_hash_init(); - - /* 'Address' is not required to be PAGE_SIZE-aligned: - * reactos MmSetPageProtect() calls MmGetPageEntry(Address) with no such requirement. - * glib NOTE: YOU MAY NOT STORE POINTERS IN INTEGERS. - */ - Address=(VOID *)(((char *)Address)-(GPOINTER_TO_UINT(Address)&(PAGE_SIZE-1))); - /* This may be also invalid input 'Address' */ - g_assert(Address!=NULL); - - /* Prepare and updated ORed 'mmap_prot' in captive_mmap_map storage */ - mmap_prot=captive_flProtect_to_mmap_prot(flProtect); - mmap_prot|=captive_mmap_map_get(Address); - captive_mmap_map_set(Address,mmap_prot); - - /* protect one page; reactos call cannot return error codes */ - err=mprotect(Address,PAGE_SIZE,mmap_prot); - g_return_if_fail(err==0); - - /* success */ -} - - -/** - * MmGetPhysicalAddress: - * @vaddr: Virtual address to convert. - * - * Function converts address from the virtual address space to the physical one. - * As libcaptive unifies all the address spaces this function will return @vaddr directly there. - * - * Returns: Pure @vaddr extended to 64-bits of #PHYSICAL_ADDRESS (libcaptive-specific). - */ -PHYSICAL_ADDRESS MmGetPhysicalAddress(PVOID vaddr) -{ -PHYSICAL_ADDRESS r; - - r.QuadPart=0; - g_return_val_if_fail(vaddr!=NULL,r); - - g_assert(sizeof(vaddr)==sizeof(guint32)); - r.QuadPart=(guint32)vaddr; - - return r; -} diff --git a/src/libcaptive/mm/pool.c b/src/libcaptive/mm/pool.c deleted file mode 100644 index 4f37778..0000000 --- a/src/libcaptive/mm/pool.c +++ /dev/null @@ -1,159 +0,0 @@ -/* $Id$ - * reactos memory pools emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/mm.h" /* self */ -#include "reactos/internal/mm.h" /* self */ -#include "reactos/ntos/types.h" /* for PVOID etc. */ -#include -#include -#include - - -/* map PVOID->GUINT_TO_POINTER(ULONG Tag) */ -static GHashTable *memory_Tag_hash; - -static void memory_Tag_hash_init(void) -{ - if (memory_Tag_hash) - return; - memory_Tag_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - - -/** - * ExAllocatePoolWithTag: - * @PoolType: Type of memory to allocate. Safely ignored by libcaptive as it is - * too low level for it. - * @NumberOfBytes: Size of the requested allocation. Value 0 permitted (returns %NULL). - * @Tag: 4-bytes of block identification for debugging purposes and/or ExFreePoolWithTag(). - * Bit 7 (==%0x80 ) of each byte must be cleared. - * %PROTECTED_POOL with @Tag bit 31 set is not yet implemented. - * - * Allocates the specified memory block. libcaptive passes the allocation to - * g_malloc() and @Tag is marked to this allocation. - * - * Returns: Memory block base if successfuly allocated. %NULL otherwise. - * The allocated memory block is not cleared. - */ -PVOID ExAllocatePoolWithTag(ULONG PoolType,ULONG NumberOfBytes,ULONG Tag) -{ -PVOID r; - - g_return_val_if_fail((Tag&0x80808080)==0,NULL); - - memory_Tag_hash_init(); - - if (!NumberOfBytes) - return NULL; - /* FIXME: >=PAGE_SIZE allocations should be PAGE_SIZE aligned */ - r=g_malloc(NumberOfBytes); - - g_assert(FALSE==g_hash_table_lookup_extended(memory_Tag_hash, - r, /* lookup_key */ - NULL, /* orig_key */ - NULL)); /* value */ - g_hash_table_insert(memory_Tag_hash, - (gpointer)r, /* key */ - GUINT_TO_POINTER(Tag)); /* value */ - - return r; -} - -/** - * ExAllocatePool: - * @PoolType: Type of memory to allocate. Safely ignored by libcaptive as it is - * too low level for it. - * @NumberOfBytes: Size of the requested allocation. Value 0 permitted (returns %NULL). - * - * Allocates the specified memory block. Calls ExAllocatePoolWithTag() with - * @Tag value %0x00000000. At least this value seems to be assumed by WXP - * although it is not officially documented for W32. - * - * Returns: Memory block base if successfuly allocated. %NULL otherwise. - * The allocated memory block is not cleared. - */ -PVOID ExAllocatePool(POOL_TYPE PoolType,ULONG NumberOfBytes) -{ - /* FIXME: It would be better to mark such block as 'unTagged' but we would have - * to maintain some structure for 'memory_Tag_hash' values instead of just GUINT_TO_POINTER(). - */ - return ExAllocatePoolWithTag(PoolType,NumberOfBytes, - 0x00000000); /* Tag; reactos uses TAG_NONE ('None') but it W32 uses %0x00000000 */ -} - -/** - * ExFreePool: - * @Block: Base address of the memory block. %NULL value is forbidden. - * - * Deallocate the given memory block. Block must be already successfuly - * allocated by a previous ExAllocatePool() or ExAllocatePoolWithTag() call. - * You can no longer assume anything about this base address / memory block. - */ -VOID ExFreePool(IN PVOID Block) -{ -gboolean errbool; - - g_return_if_fail(Block!=NULL); - - memory_Tag_hash_init(); - - errbool=g_hash_table_remove(memory_Tag_hash,Block); - g_assert(errbool==TRUE); - - g_free(Block); -} - - -/** - * ExFreePoolWithTag: - * @Block: Base address of the memory block. %NULL value is forbidden. - * @Tag: 4-bytes of required block identification. - * Bit 7 (==%0x80 ) of each byte must be cleared. - * %PROTECTED_POOL with @Tag bit 31 set is not yet implemented. - * Value %0x0000000 is permitted for blocks marked with any Tag. - * - * Deallocate the given memory block. Block must be already successfuly - * allocated by a previous ExAllocatePoolWithTag() call. - * Block may be allocated by ExAllocatePool() if @Tag is passed %0x00000000. - * Please see more about @Tag in ExAllocatePool(). - * It is forbidden to pass invalid @Tag for @Block. - * - * You can no longer assume anything about this base address / memory block. - */ -VOID ExFreePoolWithTag(IN PVOID Block,IN ULONG Tag) -{ -gpointer memory_Tag_gpointer; -gboolean errbool; - - g_return_if_fail(Block!=NULL); - g_return_if_fail((Tag&0x80808080)==0); - - memory_Tag_hash_init(); - - errbool=g_hash_table_lookup_extended(memory_Tag_hash, - Block, /* lookup_key */ - NULL, /* orig_key */ - &memory_Tag_gpointer); /* value */ - g_return_if_fail(errbool==TRUE); - g_return_if_fail(!Tag || GPOINTER_TO_UINT(memory_Tag_gpointer)==Tag); - - ExFreePool(Block); -} diff --git a/src/libcaptive/mm/routine.c b/src/libcaptive/mm/routine.c deleted file mode 100644 index dbbaf58..0000000 --- a/src/libcaptive/mm/routine.c +++ /dev/null @@ -1,35 +0,0 @@ -/* $Id$ - * reactos MmGetSystemRoutineAddress() emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/types.h" /* for PVOID etc. */ -#include -#include "captive/unicode.h" - - -PVOID MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName) -{ - g_return_val_if_fail(captive_validate_UnicodeString(SystemRoutineName),NULL); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: SystemRoutineName=%s",G_STRLOC, - captive_UnicodeString_to_utf8_alloca(SystemRoutineName)); - - return NULL; -} diff --git a/src/libcaptive/mm/section.c b/src/libcaptive/mm/section.c deleted file mode 100644 index 7c5defa..0000000 --- a/src/libcaptive/mm/section.c +++ /dev/null @@ -1,95 +0,0 @@ -/* $Id$ - * reactos memory areas emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/mm.h" /* self, for captive_flProtect_to_mmap_prot() */ -#include "reactos/internal/mm.h" /* self */ -#include "reactos/ntos/types.h" /* for PVOID etc. */ -#include -#include /* for PROT_NONE etc. */ - - -/** - * MmAllocateSection: - * @Length: Length (in bytes) of the area to allocate. Does not have to be page - * aligned. Value 0 is forbidden. - * - * Allocates @Length area with %PAGE_READWRITE flags. - * - * Returns: Allocated address space if the allocation was successful. - */ -PVOID MmAllocateSection(IN ULONG Length) -{ -int mmap_prot=captive_flProtect_to_mmap_prot(PAGE_READWRITE); -PVOID r; - - g_return_val_if_fail(Length>0,NULL); - - Length=(Length|(PAGE_SIZE-1))+1; /* round up to PAGE_SIZE */ - - r=mmap( - NULL, /* start */ - Length, /* length */ - mmap_prot, /* prot */ - MAP_PRIVATE|MAP_ANONYMOUS, /* flags */ - -1, /* fd; ignored due to MAP_ANONYMOUS */ - 0); /* offset; ignored due to MAP_ANONYMOUS */ - g_return_val_if_fail(r!=NULL,NULL); - - captive_mmap_map_new(r,Length,mmap_prot); - - /* assumed r!=NULL */ - return r; -} - - -/** - * MmFlushImageSection: - * @SectionObjectPointer: Section to flush description. - * %NULL value is forbidden. - * @FlushType: %MmFlushForDelete or %MmFlushForWrite. - * - * Function flushes any cached #ImageSectionObject. - * libcaptive does not cache any images and therefore this function is a NOP there. - * - * Returns: %TRUE if the operation was successful. - */ -BOOLEAN MmFlushImageSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer,IN MMFLUSH_TYPE FlushType) -{ - g_return_val_if_fail(SectionObjectPointer!=NULL,FALSE); - g_return_val_if_fail(FlushType==MmFlushForDelete || FlushType==MmFlushForWrite,FALSE); - - g_return_val_if_fail(SectionObjectPointer->ImageSectionObject==NULL,FALSE); /* NOT IMPLEMENTED YET */ - - return TRUE; /* No section mapped or it was successfuly flushed. */ -} - - -BOOLEAN MmCanFileBeTruncated(IN PSECTION_OBJECT_POINTERS SectionObjectPointer,IN PLARGE_INTEGER NewFileSize) -{ - g_return_val_if_fail(SectionObjectPointer!=NULL,FALSE); /* means do not allow truncation */ - /* 'NewFileSize' may by NULL - * Passed as NULL by ntfs.sys of NT-5.1sp1; FIXME: What does it mean? - */ - - g_assert(!NewFileSize || NewFileSize->QuadPart>=0); - - return TRUE; /* allowed */ -} diff --git a/src/libcaptive/nt/Makefile.am b/src/libcaptive/nt/Makefile.am deleted file mode 100644 index 077dc68..0000000 --- a/src/libcaptive/nt/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ -# automake source for the reactos's nt/ emulation of libcaptive Makefile -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libnt.la -libnt_la_SOURCES= \ - ntevent.c diff --git a/src/libcaptive/nt/ntevent.c b/src/libcaptive/nt/ntevent.c deleted file mode 100644 index ddb9156..0000000 --- a/src/libcaptive/nt/ntevent.c +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * reactos support for event handling for reactos of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/zw.h" /* self */ -#include - - -/** - * ZwCreateEvent: - * @EventHandle: Returns new created #HANDLE. - * %NULL value is forbidden. - * @DesiredAccess: Required access privileges to the created event handle. - * @ObjectAttributes: Event object attributes by InitializeObjectAttributes(). - * %NULL value is forbidden. - * @ManualReset: Use %NotificationEvent instead of %SynchronizationEvent. - * @InitialState: initial state of the created @EventHandle. - * - * Direct pass to NtCreateEvent(). reactos aliases this call to NtCreateEvent() - * in its "reactos/iface/native/sysfuncs.lst" file. - * - * Returns: Return status code from NtCreateEvent(). - */ -NTSTATUS ZwCreateEvent(OUT PHANDLE EventHandle, - IN ACCESS_MASK DesiredAccess,IN POBJECT_ATTRIBUTES ObjectAttributes,IN BOOLEAN ManualReset,IN BOOLEAN InitialState) -{ - g_return_val_if_fail(EventHandle!=NULL,STATUS_INVALID_HANDLE); - g_return_val_if_fail(ObjectAttributes!=NULL,STATUS_INVALID_HANDLE); - - return NtCreateEvent(EventHandle,DesiredAccess,ObjectAttributes,ManualReset,InitialState); -} diff --git a/src/libcaptive/ob/Makefile.am b/src/libcaptive/ob/Makefile.am deleted file mode 100644 index 849be6c..0000000 --- a/src/libcaptive/ob/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# $Id$ -# automake source for the reactos's ob/ emulation of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libob.la -libob_la_SOURCES= \ - dirobj.c \ - handle.c \ - object.c diff --git a/src/libcaptive/ob/dirobj.c b/src/libcaptive/ob/dirobj.c deleted file mode 100644 index 5faabfc..0000000 --- a/src/libcaptive/ob/dirobj.c +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * reactos support for object directories handling for reactos of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/zw.h" /* self */ -#include "reactos/ntos/types.h" /* for PHANDLE */ -#include "reactos/napi/types.h" /* for NTSTATUS */ -#include - - -/** - * ZwCreateDirectoryObject: - * @DirectoryHandle: Returns pointer to the created directory object handle. - * %NULL value is forbidden. - * @DesiredAccess: Required access privileges to the created directory object handle. - * @ObjectAttributes: Directory object attributes by InitializeObjectAttributes(). - * %NULL value is forbidden. - * - * Direct pass to NtCreateDirectoryObject(). reactos aliases this call to NtCreateDirectoryObject() - * in its "reactos/iface/native/sysfuncs.lst" file. - * - * Returns: Return status code from NtCreateDirectoryObject(). - */ -NTSTATUS ZwCreateDirectoryObject - (OUT PHANDLE DirectoryHandle,IN ACCESS_MASK DesiredAccess,IN POBJECT_ATTRIBUTES ObjectAttributes) -{ - g_return_val_if_fail(DirectoryHandle!=NULL,STATUS_INVALID_HANDLE); - g_return_val_if_fail(ObjectAttributes!=NULL,STATUS_INVALID_HANDLE); - - return NtCreateDirectoryObject(DirectoryHandle,DesiredAccess,ObjectAttributes); -} diff --git a/src/libcaptive/ob/handle.c b/src/libcaptive/ob/handle.c deleted file mode 100644 index 3dc7db0..0000000 --- a/src/libcaptive/ob/handle.c +++ /dev/null @@ -1,53 +0,0 @@ -/* $Id$ - * reactos support for object handle handling for reactos of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/zw.h" /* self */ -#include "reactos/ntos/types.h" /* for HANDLE */ -#include "reactos/napi/types.h" /* for NTSTATUS */ -#include - - -/* libcaptive/ps/create.c: */ -extern const guint8 PsCreateSystemThread_bogusthread; - - -/** - * ZwClose: - * @Handle: Handle from some Zw*() create function. - * %NULL value is forbidden. - * - * Direct pass to NtClose(). reactos aliases this call to NtClose() - * in its "reactos/iface/native/sysfuncs.lst" file. - * - * Returns: Return status code from NtClose(). - */ -NTSTATUS ZwClose(HANDLE Handle) -{ - g_return_val_if_fail(Handle!=NULL,STATUS_INVALID_HANDLE); - - /* FIXME: libcaptive does not yet create the threads (thread objects) - * but ntfs.sys will ZwClose() immediately after its PsCreateSystemThread(). - */ - if (Handle==(HANDLE)&PsCreateSystemThread_bogusthread) - return STATUS_SUCCESS; - - return NtClose(Handle); -} diff --git a/src/libcaptive/ob/object.c b/src/libcaptive/ob/object.c deleted file mode 100644 index 04a7863..0000000 --- a/src/libcaptive/ob/object.c +++ /dev/null @@ -1,105 +0,0 @@ -/* $Id$ - * reactos support for object handling for reactos of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/obfuncs.h" /* self */ -#include -#include "reactos/ddk/status.h" -#include "reactos/ddk/exfuncs.h" /* for ExFreePool() */ -#include "captive/unicode.h" /* for captive_validate_UnicodeString() */ - - -/* reactos/ntoskrnl/ob/object.c: */ -extern POBJECT_HEADER BODY_TO_HEADER(PVOID body); - -/* reactos/ntoskrnl/ob/ntobj.c: */ -NTSTATUS internalNameBuilder(POBJECT_HEADER ObjectHeader,PUNICODE_STRING string); - - -/** - * ObQueryNameString: - * @Object: Object to identify the name from. - * %NULL value is forbidden. - * @ObjectNameInfo: Target structure to be filled with the @Object name. - * %NULL value is permitted. - * @Length: Length of @ObjectNameInfo allocated memory block. - * sizeof(*@ObjectNameInfo) is required by libcaptive. - * @ReturnLength: Returns the length of the unicode name string including the final 0-terminator in bytes. - * %NULL value is forbidden. - * - * Function detects the name of a given object @Object. The returned name - * string will start with backslash (absolute pathname) and it will be zero terminated. - * - * You can detect the name string length by passing %NULL for @ObjectNameInfo - * and %0 for @Length together. The requested string length will be returned by @ReturnLength. - * In such case the function return code will be %STATUS_INFO_LENGTH_MISMATCH. - * - * Returns: The unicode string name of @Object. Return code is %STATUS_SUCCESS. - * The only valid return code in the case of passed %NULL @ObjectNameInfo is %STATUS_INFO_LENGTH_MISMATCH. - */ -NTSTATUS ObQueryNameString(IN PVOID Object,OUT POBJECT_NAME_INFORMATION ObjectNameInfo,IN ULONG Length,OUT PULONG ReturnLength) -{ -OBJECT_HEADER *ObjectHeader; -NTSTATUS r; -UNICODE_STRING UnicodeString; - - g_return_val_if_fail(Object!=NULL,STATUS_INVALID_PARAMETER); - /* 'ObjectNameInfo' may be NULL */ - g_return_val_if_fail(ReturnLength!=NULL,STATUS_INVALID_PARAMETER); - - if (ObjectNameInfo) { - g_return_val_if_fail(Length!=sizeof(*ObjectNameInfo),STATUS_INFO_LENGTH_MISMATCH); - g_assert(sizeof(*ObjectNameInfo)==sizeof(UnicodeString)/* ==ObjectNameInfo->Name */); - } - else - g_return_val_if_fail(Length==0,STATUS_INFO_LENGTH_MISMATCH); - - ObjectHeader=BODY_TO_HEADER(Object); - - UnicodeString.Buffer=NULL; - UnicodeString.MaximumLength=0; - - do { - if (UnicodeString.Buffer) - ExFreePool(UnicodeString.Buffer); - UnicodeString.MaximumLength=MAX(0x100,UnicodeString.MaximumLength*2); - UnicodeString.Buffer=ExAllocatePool(PagedPool,UnicodeString.MaximumLength); - g_return_val_if_fail(UnicodeString.Buffer!=NULL,STATUS_NO_MEMORY); - - UnicodeString.Length=0; - r=internalNameBuilder(ObjectHeader,&UnicodeString); - } while (r==STATUS_BUFFER_TOO_SMALL); - - if (!NT_SUCCESS(r)) { - ExFreePool(UnicodeString.Buffer); - return r; - } - g_assert(captive_validate_UnicodeString(&UnicodeString)); /* ensure 0-termination */ - *ReturnLength=UnicodeString.Length+sizeof(*UnicodeString.Buffer); - - if (!ObjectNameInfo) { - ExFreePool(UnicodeString.Buffer); - /* Valid detection of the object name string length */ - return STATUS_INFO_LENGTH_MISMATCH; - } - - ObjectNameInfo->Name=UnicodeString; - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/po/Makefile.am b/src/libcaptive/po/Makefile.am deleted file mode 100644 index 5d2cf51..0000000 --- a/src/libcaptive/po/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ -# automake source for the power-facilities of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libpo.la -libpo_la_SOURCES= \ - shutdownwork.c diff --git a/src/libcaptive/po/shutdownwork.c b/src/libcaptive/po/shutdownwork.c deleted file mode 100644 index 4f08ef8..0000000 --- a/src/libcaptive/po/shutdownwork.c +++ /dev/null @@ -1,91 +0,0 @@ -/* $Id$ - * reactos PoQueueShutdownWorkItem() implementation by libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -/* no reactos prototype for PoQueueShutdownWorkItem() */ -#include "captive/ldr.h" /* self; for captive_PoQueueShutdownWorkItem_hooklist_invoke() */ -#include -#include -#include "reactos/ddk/extypes.h" /* for WORK_QUEUE_ITEM */ -#include "captive/macros.h" - - -static GHookList captive_PoQueueShutdownWorkItem_hooklist; - - -static void captive_PoQueueShutdownWorkItem_hooklist_init(void) -{ - if (captive_PoQueueShutdownWorkItem_hooklist.is_setup) - return; - - g_hook_list_init(&captive_PoQueueShutdownWorkItem_hooklist,sizeof(GHook)); -} - - -void captive_PoQueueShutdownWorkItem_hooklist_invoke(void) -{ - captive_PoQueueShutdownWorkItem_hooklist_init(); - - g_hook_list_invoke(&captive_PoQueueShutdownWorkItem_hooklist, - FALSE); /* may_recurse */ - g_hook_list_clear(&captive_PoQueueShutdownWorkItem_hooklist); -} - - -struct captive_work_queue_item { - PWORKER_THREAD_ROUTINE WorkerRoutine; - PVOID Parameter; - }; - -static void PoQueueShutdownWorkItem_func(struct captive_work_queue_item *captive_work_queue_item /* data */) -{ - g_return_if_fail(captive_work_queue_item!=NULL); - - /* typedef VOID CAPTIVE_STDCALL (*PWORKER_THREAD_ROUTINE)(IN PVOID Context); */ - - captive_stdcall_call_4((CaptiveStdCallFunc4)captive_work_queue_item->WorkerRoutine, - captive_work_queue_item->Parameter); /* Context */ - - g_free(captive_work_queue_item); -} - -NTSTATUS PoQueueShutdownWorkItem(IN PWORK_QUEUE_ITEM WorkItem) -{ -GHook *ghook; -struct captive_work_queue_item *captive_work_queue_item; - - g_return_val_if_fail(WorkItem!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(WorkItem->WorkerRoutine!=NULL,STATUS_INVALID_PARAMETER); - - captive_PoQueueShutdownWorkItem_hooklist_init(); - - captive_new(captive_work_queue_item); - captive_work_queue_item->WorkerRoutine=WorkItem->WorkerRoutine; - captive_work_queue_item->Parameter=WorkItem->Parameter; - - /* FIXME: Should we check for func/data dupes? Are they permitted by W32? */ - - ghook=g_hook_alloc(&captive_PoQueueShutdownWorkItem_hooklist); - ghook->func=PoQueueShutdownWorkItem_func; - ghook->data=captive_work_queue_item; - g_hook_append(&captive_PoQueueShutdownWorkItem_hooklist,ghook); - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/ps/Makefile.am b/src/libcaptive/ps/Makefile.am deleted file mode 100644 index 12854b1..0000000 --- a/src/libcaptive/ps/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# $Id$ -# automake source for the reactos's ps/ emulation of libcaptive Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libps.la -libps_la_SOURCES= \ - calltype.S \ - create.c \ - math.c \ - ps_reactos.c \ - signal.c \ - thread.c diff --git a/src/libcaptive/ps/calltype.S b/src/libcaptive/ps/calltype.S deleted file mode 100644 index c03b630..0000000 --- a/src/libcaptive/ps/calltype.S +++ /dev/null @@ -1,66 +0,0 @@ -/* $Id$ - * CAPTIVE_STDCALL calling by hand as GCC has it broken - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -/* - * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc4 )(gpointer arg0); - * gpointer captive_stdcall_call_4 (CaptiveStdCallFunc4 func,gpointer arg0); - */ - .globl captive_stdcall_call_4 -captive_stdcall_call_4: - pushl %ebp /* std stack frame */ - movl %esp,%ebp /* std stack frame */ - pushl 12(%ebp) /* arg0 */ - movl 8(%ebp),%eax /* func */ - call *%eax - /* keep '%eax' return value */ - leave - ret - -/* - * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc8 )(gpointer arg0,gpointer arg1); - * gpointer captive_stdcall_call_8 (CaptiveStdCallFunc8 func,gpointer arg0,gpointer arg1); - */ - .globl captive_stdcall_call_8 -captive_stdcall_call_8: - pushl %ebp /* std stack frame */ - movl %esp,%ebp /* std stack frame */ - pushl 16(%ebp) /* arg1 */ - pushl 12(%ebp) /* arg0 */ - movl 8(%ebp),%eax /* func */ - call *%eax - /* keep '%eax' return value */ - leave - ret - -/* - * typedef gpointer CAPTIVE_STDCALL (*CaptiveStdCallFunc12)(gpointer arg0,gpointer arg1,gpointer arg2); - * gpointer captive_stdcall_call_12(CaptiveStdCallFunc12 func,gpointer arg0,gpointer arg1,gpointer arg2); - */ - .globl captive_stdcall_call_12 -captive_stdcall_call_12: - pushl %ebp /* std stack frame */ - movl %esp,%ebp /* std stack frame */ - pushl 20(%ebp) /* arg2 */ - pushl 16(%ebp) /* arg1 */ - pushl 12(%ebp) /* arg0 */ - movl 8(%ebp),%eax /* func */ - call *%eax - /* keep '%eax' return value */ - leave - ret diff --git a/src/libcaptive/ps/create.c b/src/libcaptive/ps/create.c deleted file mode 100644 index 64691dc..0000000 --- a/src/libcaptive/ps/create.c +++ /dev/null @@ -1,61 +0,0 @@ -/* $Id$ - * reactos thread creation emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/psfuncs.h" /* self */ -#include -#include "reactos/ddk/status.h" - - -const guint8 PsCreateSystemThread_bogusthread; - -/** - * PsCreateSystemThread: - * @ThreadHandle: Returns the new thread handle. - * %NULL value is forbidden. - * @DesiredAccess: Requested access to the thread. - * @ObjectAttributes: Object attributes. - * %NULL value is permitted. - * @ProcessHandle: Handle of process thread will run in. - * Use %NULL to specify system process. - * @ClientId: Returns the new client id of the thread. - * %NULL value is permitted. - * @StartRoutine = Entry point for the new thread. - * %NULL value is forbidden. - * @StartContext = Argument supplied to the thread when it begins execution. - * %NULL value is permitted. - * - * Creates a new thread. - * FIXME: libcaptive does not create any thread, it is a NOP function there. - * - * Returns: %STATUS_SUCCESS if the operation was successful. - */ -NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle,ACCESS_MASK DesiredAccess,POBJECT_ATTRIBUTES ObjectAttributes, - HANDLE ProcessHandle,PCLIENT_ID ClientId,PKSTART_ROUTINE StartRoutine,PVOID StartContext) -{ - g_return_val_if_fail(ThreadHandle!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(StartRoutine!=NULL,STATUS_INVALID_PARAMETER); - - /* FIXME: Cooperative multitasking enqueue! */ - - *ThreadHandle=(HANDLE)&PsCreateSystemThread_bogusthread; - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/ps/math.c b/src/libcaptive/ps/math.c deleted file mode 100644 index 93816c5..0000000 --- a/src/libcaptive/ps/math.c +++ /dev/null @@ -1,138 +0,0 @@ -/* $Id$ - * long-value math emulation for support of ntoskrnl of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/types.h" -#include - - -/** - * _allmul: - * @a: First #LONGLONG multiplier. - * @b: Second #LONGLONG multiplier. - * - * Returns: @a * @b. No overflows are checked. - */ -LONGLONG _allmul(LONGLONG a,LONGLONG b) -{ - return a*b; -} - - -/** - * _alldiv: - * @a: #LONGLONG divisor. - * @b: #LONGLONG divider. - * Value %0 is forbidden. - * - * Returns: @a / @b. - */ -LONGLONG _alldiv(LONGLONG a,LONGLONG b) -{ - g_return_val_if_fail(b!=0,0); - - return a/b; -} - - -/** - * _allshl: - * @long_00to31: Lower part of 64-bit unsigned number to shift. - * @long_32to63: Upper part of 64-bit unsigned number to shift. - * @count: Number of bits to shift by. - * - * 64-bit shift left by @count bits. - * - * This is a special function which is declared as %data in *.def - * file ke/exports.def as it has three arguments passed in registers. - * - * Returns: (@long_32to63 @long_00to31) shifted left by @count bits. - */ -guint64 __attribute__((__stdcall__)) __attribute__((__regparm__(3))) _allshl( - guint32 long_00to31, /* %eax */ - guint32 long_32to63, /* %edx */ - guint8 count) /* %ecx */ -{ - return (((((guint64)long_32to63)<<32U)|long_00to31)<>count); -} - - -/** - * _aullshr: - * @long_00to31: Lower part of 64-bit unsigned number to shift. - * @long_32to63: Upper part of 64-bit unsigned number to shift. - * @count: Number of bits to shift by. - * - * 64-bit shift right by @count bits. - * - * This is a special function which is declared as %data in *.def - * file ke/exports.def as it has three arguments passed in registers. - * - * Returns: (@long_32to63 @long_00to31) unsigned-shifted right by @count bits. - */ -guint64 __attribute__((__stdcall__)) __attribute__((__regparm__(3))) _aullshr( - guint32 long_00to31, /* %eax */ - guint32 long_32to63, /* %edx */ - guint8 count) /* %ecx */ -{ - return (((((guint64)long_32to63)<<32U)|long_00to31)>>count); -} - - -/** - * _allrem: - * @divident: 64-bit signed divident. - * @divisor: 64-bit signed divisor. - * - * Calculates the signed modulo of two 64-bit numbers. - * - * FIXME: Are we expected to behave signed? - * - * Returns: Expression "divident%divisor". - */ -gint64 _allrem(gint64 divident,gint64 divisor) -{ - return divident%divisor; -} diff --git a/src/libcaptive/ps/ps_reactos.c b/src/libcaptive/ps/ps_reactos.c deleted file mode 100644 index 7a858d3..0000000 --- a/src/libcaptive/ps/ps_reactos.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $Id$ - * reactos processor emulation for support of ntoskrnl of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/ps_reactos.h" /* self */ -#include "captive/macros.h" - - -/* Do not use static variable here: - * We would not get ElectricFence checks on accesses - * in original ReactOS 'KPCR'/'IKPCR' structure manner. - */ -static captive_KPCR *captive_KeGetCurrentKPCR_KPCR; - -/** - * captive_KeGetCurrentKPCR: - * - * Returns the #PCR (Processor Control Region) structure for the - * current CPU. - * Currently libcaptive doesn't use multithreading - * and thus this function returns a constant pointer to one static structure. - * - * Returns: #captive_PKPCR type pointer to valid #captive_KPCR. - * This structure IS NOT binary compatible with reactos - you SHOULD NOT - * export this symbol for binary W32 modules. Anyone using this function - * is very low-level based and you would probably find many other - * compatibility problems afterwards - replace of such function is recommended. - */ -captive_PKPCR captive_KeGetCurrentKPCR(void) -{ - /* TODO:thread */ - if (!captive_KeGetCurrentKPCR_KPCR) - captive_new0(captive_KeGetCurrentKPCR_KPCR); - return captive_KeGetCurrentKPCR_KPCR; -} diff --git a/src/libcaptive/ps/signal.c b/src/libcaptive/ps/signal.c deleted file mode 100644 index 68a08b3..0000000 --- a/src/libcaptive/ps/signal.c +++ /dev/null @@ -1,443 +0,0 @@ -/* $Id$ - * UNIX signal handling for processor emulation for support of ntoskrnl of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#define _GNU_SOURCE 1 /* for sys/ucontext.h for REG_* */ - -#include "config.h" - -#include "captive/signal.h" /* self */ -#include -#include -#include -#include "captive/macros.h" -#include /* for struct ucontext */ -#include "captive/mm.h" /* for captive_mmap_map_get() */ -#include -#include "reactos/internal/mm.h" /* for PAGE_SIZE */ -#include "captive/ldr.h" /* for captive_ModuleList_patchpoint_find() */ -#include "captive/ldr_exports.h" /* for struct captive_ModuleList_patchpoint */ - - -int _abnormal_termination_orig(void); -extern greg_t fs_KPCR_ExceptionList; - -/** - * _abnormal_termination_wrap: - * - * This call can be also accessed as AbnormalTermination() or _abnormal_termination(). - * It is a captive wrapper around _abnormal_termination() function. - * - * Returns whether some exception occured in the current #try block we are currently - * #finish -ing. Any functions called from current #finish block will be considered - * for returning zero back again. It is forbidden to call this function outside - * of #finish block, result of such call is undefined. - * - * Exception handlers are registered from W32 binary in stack frames stored in "fs:[0x00000000]" - * value which gets mapped by libcaptive/ps/signal.c to #fs_KPCR_ExceptionList - * variable. - * - * If no exception handler was registered yet this function returns zero. - * - * See also RtlpDispatchException(). - * - * Returns: non-zero if some exception is now being handled as pending. - */ -int _abnormal_termination_wrap(void) -{ - /* No handler registered yet? ntoskrnl _abnormal_termination() does not handle it - * and I do not want to bother with registering toplevel handler. - */ - if (fs_KPCR_ExceptionList==(greg_t)-1) - return 0; - - return _abnormal_termination_orig(); -} - - -#if 0 - -/** - * RtlpDispatchException: - * @ExceptionRecord: Ignored by libcaptive. - * @Context: Ignored by libcaptive. - * - * Function definition to prevent inclusion of real RtlpDispatchException() implementation. - * Currently libcaptive never raises any exception - fix _abnormal_termination() if it changes. - * - * Returns: Never returns. Value %0 if it returns although it is impossible. - */ -ULONG RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,IN PCONTEXT Context) -{ - g_assert_not_reached(); - g_return_val_if_reached(0); -} - -#endif - - -/* =='KeGetCurrentKPCR()->ExceptionList'; - * libcaptive has reduced KPCR (named 'captive_KPCR') which - * does not contain this field - */ -greg_t fs_KPCR_ExceptionList=(greg_t)-1; - -/* FIXME */ -static greg_t fs_KPCR_Unknown638=0; - - -static gboolean instr_mov_greg_to_fsmem(int greg,const void *fsmem,struct ucontext *ucontext) -{ - if (fsmem==(const void *)0x00000000) { /* exception stack top pointer */ - /* moving from %esp is required to pass! */ - fs_KPCR_ExceptionList=ucontext->uc_mcontext.gregs[greg]; - return TRUE; - } - g_return_val_if_reached(FALSE); -} - -static gboolean instr_mov_immed_to_fsmem(greg_t immed,const void *fsmem,struct ucontext *ucontext) -{ - if (fsmem==(const void *)0x00000000) { /* exception stack top pointer */ - fs_KPCR_ExceptionList=immed; - return TRUE; - } - g_return_val_if_reached(FALSE); -} - -static gboolean instr_mov_fsmem_to_greg(const void *fsmem,int greg,struct ucontext *ucontext) -{ - if (fsmem==(const void *)0x00000000) { /* exception stack top pointer */ - /* moving to %esp is required to pass! */ - ucontext->uc_mcontext.gregs[greg]=fs_KPCR_ExceptionList; - return TRUE; - } - if (fsmem==(const void *)0x00000051) { /* =='KeGetCurrentKPCR()->Number' */ - g_return_val_if_fail(greg!=REG_ESP,FALSE); - ucontext->uc_mcontext.gregs[greg]=(greg_t)0; /* ==libcaptive version of KeGetCurrentProcessorNumber() */ - return TRUE; - } - if (fsmem==(const void *)0x00000124) { /* =='KeGetCurrentKPCR()->CurrentThread' */ - g_return_val_if_fail(greg!=REG_ESP,FALSE); - ucontext->uc_mcontext.gregs[greg]=(greg_t)captive_KeGetCurrentKPCR()->CurrentThread; - return TRUE; - } - g_return_val_if_reached(FALSE); -} - -static gboolean instr_push_fsmem(const void *fsmem,struct ucontext *ucontext) -{ - if (fsmem==(const void *)0x00000000) { /* exception stack top pointer */ - ucontext->uc_mcontext.gregs[REG_ESP]-=4; - *(greg_t *)ucontext->uc_mcontext.gregs[REG_ESP]=fs_KPCR_ExceptionList; - return TRUE; - } - g_return_val_if_reached(FALSE); -} - -static gboolean instr_pop_fsmem(const void *fsmem,struct ucontext *ucontext) -{ - if (fsmem==(const void *)0x00000000) { /* exception stack top pointer */ - fs_KPCR_ExceptionList=*(greg_t *)ucontext->uc_mcontext.gregs[REG_ESP]; - ucontext->uc_mcontext.gregs[REG_ESP]+=4; - return TRUE; - } - g_return_val_if_reached(FALSE); -} - -static gboolean instr_incl_fsmem(const void *fsmem,struct ucontext *ucontext) -{ - if (fsmem==(const void *)0x00000638) { /* Unknown638 */ - fs_KPCR_Unknown638++; - return TRUE; - } - g_return_val_if_reached(FALSE); -} - -static int op_regcode_to_greg(guint8 regcode) -{ - switch (regcode) { - case 0x00: return REG_EAX; - case 0x01: return REG_ECX; - case 0x02: return REG_EDX; - case 0x03: return REG_EBX; - case 0x04: return REG_ESP; - case 0x05: return REG_EBP; - case 0x06: return REG_ESI; - case 0x07: return REG_EDI; - } - g_return_val_if_reached(REG_EAX); -} - -static void sigaction_SIGSEGV(int signo,siginfo_t *siginfo,struct ucontext *ucontext) -{ -guint8 *reg_eip; -const void *reg_eip_aligned; -static const void *reg_eip_aligned_last_valid=NULL; /* performance cache */ - - g_return_if_fail(signo==SIGSEGV); - g_return_if_fail(siginfo->si_signo==SIGSEGV); - /* siginfo->si_code is weird, seen to have value 128 */ - - reg_eip=(void *)ucontext->uc_mcontext.gregs[REG_EIP]; - - /* 'reg_eip' is not yet PAGE_SIZE-aligned but we need the aligned ptr for captive_mmap_map_get(). - * glib NOTE: YOU MAY NOT STORE POINTERS IN INTEGERS. - */ - reg_eip_aligned=(const void *)(((char *)reg_eip)-(GPOINTER_TO_UINT(reg_eip)&(PAGE_SIZE-1))); - g_assert(reg_eip_aligned!=NULL); - - /* We do not expect any pages can get un-PROT_EXEC-ed - * and therefore we never invalidate our cache 'reg_eip_aligned_last_valid'. - */ - if (reg_eip_aligned_last_valid!=reg_eip_aligned) { - g_return_if_fail(!(captive_mmap_map_get(reg_eip_aligned)&PROT_EXEC)); - reg_eip_aligned_last_valid=reg_eip_aligned; - } - - /* all instruction notation comments are written in AT&T 'instr src,dest' syntax! */ - if (*reg_eip==0x64) { /* prefix '%fs:' */ - reg_eip++; - /* TODO:thread; %fs: is CPU-dependent */ - if (*reg_eip==0x0F) { /* two-byte opcode */ - reg_eip++; - if (*reg_eip==0xB6) { /* ??? */ - reg_eip++; - if (*reg_eip==0x05) { /* movzbl %fs:{reg_eip[1..4]},%eax */ - reg_eip++; - if (instr_mov_fsmem_to_greg(*(const void **)reg_eip,REG_EAX,ucontext)) { - reg_eip+=4; - goto ok; - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - if (*reg_eip==0xA3) { /* 'mov %eax,%fs:{reg_eip[1..4]}' */ - reg_eip++; - if (instr_mov_greg_to_fsmem(REG_EAX,*(const void **)reg_eip,ucontext)) { - reg_eip+=4; - goto ok; - } - g_assert_not_reached(); - } - if (*reg_eip==0x89) { /* prefix 0x89 */ - reg_eip++; - if ((*reg_eip & ~0x38)==0x05) { /* 'mov %{op_regcode_to_greg(*reg_eip[b3..b5])},%fs:{reg_eip[1..4]} */ - reg_eip++; - if (instr_mov_greg_to_fsmem(op_regcode_to_greg(reg_eip[-1]>>3U),*(const void **)reg_eip,ucontext)) { - reg_eip+=4; - goto ok; - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - if (*reg_eip==0xA1) { /* 'mov %fs:{reg_eip[1..4]},%eax' */ - reg_eip++; - if (instr_mov_fsmem_to_greg(*(const void **)reg_eip,REG_EAX,ucontext)) { - reg_eip+=4; - goto ok; - } - g_assert_not_reached(); - } - if (*reg_eip==0x8B) { /* prefix 0x8B */ - reg_eip++; - if ((*reg_eip & ~0x38)==0x05) { /* 'mov %fs:{reg_eip[1..4]},%{op_regcode_to_greg(*reg_eip[b3..b5])}' */ - reg_eip++; - if (instr_mov_fsmem_to_greg(*(const void **)reg_eip,op_regcode_to_greg(reg_eip[-1]>>3U),ucontext)) { - reg_eip+=4; - goto ok; - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - if (*reg_eip==0xFF) { /* prefix 0xFF */ - reg_eip++; - if (*reg_eip==0x05) { /* 'incl %fs:{reg_eip[1..4]}' */ - reg_eip++; - if (instr_incl_fsmem(*(const void **)reg_eip,ucontext)) { - reg_eip+=4; - goto ok; - } - g_assert_not_reached(); - } - if (*reg_eip==0x35) { /* 'pushl %fs:{reg_eip[1..4]}' */ - reg_eip++; - if (instr_push_fsmem(*(const void **)reg_eip,ucontext)) { - reg_eip+=4; - goto ok; - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - if (*reg_eip==0x8F) { /* prefix 0x0F */ - reg_eip++; - if (*reg_eip==0x05) { /* 'popl %fs:{reg_eip[1..4]}' */ - reg_eip++; - if (instr_pop_fsmem(*(const void **)reg_eip,ucontext)) { - reg_eip+=4; - goto ok; - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - if (*reg_eip==0xC7) { /* prefix 0xC7 */ - reg_eip++; - if (*reg_eip==0x05) { /* 'movl ${reg_eip[5..8]},%fs:{reg_eip[1..4]}' */ - reg_eip++; - if (instr_mov_immed_to_fsmem(((greg_t *)reg_eip)[1],*(const void **)reg_eip,ucontext)) { - reg_eip+=4+4; - goto ok; - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - - /* all instruction notation comments are written in AT&T 'instr src,dest' syntax! */ - if (*reg_eip==0x66) { /* prefix '%fs:' */ - reg_eip++; - /* TODO:thread; %fs: is CPU-dependent */ - if (*reg_eip==0x8E) { /* two-byte opcode */ - reg_eip++; - if (*reg_eip==0xE3) { /* 'mov %bx,%fs' */ - reg_eip++; - g_assert(0x30==(0xFFFF&ucontext->uc_mcontext.gregs[REG_EBX])); - /* 'reload' of %fs can be ignored */ - goto ok; - } - g_assert_not_reached(); - } - g_assert_not_reached(); - } - - if (*reg_eip==0xF4) { /* hlt; from captive_ModuleList_patch() */ -struct captive_ModuleList_patchpoint *patchpoint; -const gchar *funcname_disabled; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: reg_eip=%p; 0xF4 hit",G_STRLOC,reg_eip); - - if ((funcname_disabled=captive_ModuleList_function_disable_find( - reg_eip))) { /* ExportAddress */ - g_error("%s: Reached disabled W32 function: %s",G_STRLOC,funcname_disabled); - g_assert_not_reached(); - } - patchpoint=captive_ModuleList_patchpoint_find( - reg_eip); /* ExportAddress */ - g_assert(patchpoint!=NULL); - if (reg_eip==patchpoint->orig_w32_func) { - g_assert(0xF4 /* hlt */ ==*patchpoint->orig_w32_func); - g_assert(patchpoint->orig_w32_2ndinstr_byte ==*patchpoint->orig_w32_2ndinstr); - if (patchpoint->through_w32_func) { - *patchpoint->orig_w32_func=patchpoint->orig_w32_func_byte; - *patchpoint->orig_w32_2ndinstr=0xF4; /* hlt */ - } - else { /* !patchpoint->through_w32_func */ - reg_eip=(guint8 *)patchpoint->wrap_wrap_func; - } - goto ok; - } - if (reg_eip==patchpoint->orig_w32_2ndinstr) { - g_assert(patchpoint->orig_w32_func_byte ==*patchpoint->orig_w32_func); - g_assert(0xF4 /* hlt */ ==*patchpoint->orig_w32_2ndinstr); - g_assert(patchpoint->through_w32_func==TRUE); - *patchpoint->orig_w32_func=0xF4; /* hlt */ - *patchpoint->orig_w32_2ndinstr=patchpoint->orig_w32_2ndinstr_byte; - patchpoint->through_w32_func=FALSE; - goto ok; - } - g_assert_not_reached(); - } - - if (*reg_eip==0xFA) { /* cli */ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: reg_eip=%p; CLI neutralized",G_STRLOC,reg_eip); - *reg_eip=0x90; /* nop */ - goto ok; - } - - if (*reg_eip==0xFB) { /* sti */ - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: reg_eip=%p; STI neutralized",G_STRLOC,reg_eip); - *reg_eip=0x90; /* nop */ - goto ok; - } - - g_assert_not_reached(); - -ok: - ucontext->uc_mcontext.gregs[REG_EIP]=(greg_t)reg_eip; - /* success */ -} - -/** - * captive_signal_init: - * - * Initialize UNIX signal handling to be able to emulate foreign W32 - * instructions. These instructions must be located inside address - * space of foreign W32 binary code which is identified by successful - * call to captive_mmap_map_get() returning #PROT_EXEC bit set. - * This bit should be set from MmAllocateSection() called from - * ntoskrnl/ldr/loader.c/LdrPEProcessModule(). - * - * Currently emulated set is the access to %fs register offset %0 - * where the exception stack top pointer is located. - * - * Returns: %TRUE if successful. - */ -gboolean captive_signal_init(void) -{ -gint errint; -struct sigaction sigaction_struct; -sigset_t sigset; - - CAPTIVE_MEMZERO(&sigaction_struct); /* this structure may have unpredictable fields */ - - /* Init 'sigaction_struct.sa_mask'. */ - errint=sigemptyset(&sigaction_struct.sa_mask); - g_return_val_if_fail(errint==0,FALSE); - errint=sigaddset(&sigaction_struct.sa_mask,SIGSEGV); - g_return_val_if_fail(errint==0,FALSE); - - /* Set the signal sigaction handler. */ - sigaction_struct.sa_sigaction=(void (*)(int,siginfo_t *,void *))sigaction_SIGSEGV; - sigaction_struct.sa_flags=0 - |SA_SIGINFO; /* Use 'sa_sigaction' (not 'sa_handler') */ - errint=sigaction(SIGSEGV, - &sigaction_struct, /* act */ - NULL); /* oldact */ - g_return_val_if_fail(errint==0,FALSE); - - /* Enable SIGSEGV signal (should be default). */ - errint=sigemptyset(&sigset); - g_return_val_if_fail(errint==0,FALSE); - errint=sigaddset(&sigset,SIGSEGV); - g_return_val_if_fail(errint==0,FALSE); - errint=sigprocmask(SIG_UNBLOCK, - &sigset, /* set */ - NULL); /* oldset */ - g_return_val_if_fail(errint==0,FALSE); - - return TRUE; -} diff --git a/src/libcaptive/ps/thread.c b/src/libcaptive/ps/thread.c deleted file mode 100644 index 996d5a5..0000000 --- a/src/libcaptive/ps/thread.c +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id$ - * Kernel thread handling functions of ntoskrnl of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/kefuncs.h" /* self */ -#include "reactos/internal/ps.h" /* for PKTHREAD */ -#include - - -/** - * KeSetPriorityThread: - * @Thread: Driver thread structure address to set its priority. - * libcaptive currently supports only KeGetCurrentThread() value here. - * %NULL value is forbidden. - * @Priority: Wished new priority for @Thread. - * - * Sets thread priority to @Priority. Currently ignored by libcaptive. - * - * Returns: Previous priority of @Thread. libcaptive always returns 0. - */ -KPRIORITY KeSetPriorityThread(PKTHREAD Thread,KPRIORITY Priority) -{ - g_return_val_if_fail(Thread!=NULL,0); - g_return_val_if_fail(Thread==KeGetCurrentThread(),0); /* TODO:thread */ - - return 0; -} diff --git a/src/libcaptive/reactos/Makefile-reactos.am b/src/libcaptive/reactos/Makefile-reactos.am deleted file mode 100644 index 98a05fe..0000000 --- a/src/libcaptive/reactos/Makefile-reactos.am +++ /dev/null @@ -1,32 +0,0 @@ -# $Id$ -# automake source include for the autocopying of ReactOS part of libcaptive -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# assume such include for $(top_srcdir)/reactos/ as it is forbidden to do an include twice -#include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -# Turn on GNU world compatibility with frenzy reactos -# See the compat.h below for the details -# We will also permit direct including of reactos files -# (=without $(top_srcdir)/src/libcaptive/include/reactos/ wrappers) by this -# This preinclude is tested in include/roscfg.h which will fortunately gets -# included by some reactos include file -INCLUDES+=-DREACTOS_COMPAT -include $(top_srcdir)/src/libcaptive/include/reactos/compat.h - -%.c: $(top_srcdir)/reactos/$(subst src/libcaptive/reactos/,,$(subdir))/%.c - @$(RM) $@ - $(LN_S) $< $@ diff --git a/src/libcaptive/reactos/Makefile.am b/src/libcaptive/reactos/Makefile.am deleted file mode 100644 index 3fa9d14..0000000 --- a/src/libcaptive/reactos/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -# $Id$ -# automake source for the topsrclevel of ReactOS part of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# Take care to not to have -I. before -I$(top_srcdir)/reactos/... -# to not to loop itself during inclusing of original include files -# we are overriding here; it should be taken care about it in $(top_srcdir)/Makefile-head.am -# and $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am . - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am - -SUBDIRS=include hal ntoskrnl - -EXTRA_DIST+= \ - Makefile-reactos.am - -noinst_LTLIBRARIES=libreactos.la -libreactos_la_LIBADD= \ - hal/libhal.la \ - ntoskrnl/libntoskrnl.la -libreactos_la_SOURCES= diff --git a/src/libcaptive/reactos/hal/Makefile-hal.am b/src/libcaptive/reactos/hal/Makefile-hal.am deleted file mode 100644 index 4d7826d..0000000 --- a/src/libcaptive/reactos/hal/Makefile-hal.am +++ /dev/null @@ -1,19 +0,0 @@ -# $Id$ -# automake source include for compilation of "hal" ReactOS part of libcaptive -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -INCLUDES+=-D__NTHAL__ diff --git a/src/libcaptive/reactos/hal/Makefile.am b/src/libcaptive/reactos/hal/Makefile.am deleted file mode 100644 index d355f27..0000000 --- a/src/libcaptive/reactos/hal/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -# $Id$ -# automake source for the general hal subdir ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/hal/Makefile-hal.am - -SUBDIRS=halx86 - -EXTRA_DIST+= \ - Makefile-hal.am - -noinst_LTLIBRARIES=libhal.la -libhal_la_LIBADD= \ - halx86/libhalx86.la -libhal_la_SOURCES= diff --git a/src/libcaptive/reactos/hal/halx86/Makefile.am b/src/libcaptive/reactos/hal/halx86/Makefile.am deleted file mode 100644 index d466a8e..0000000 --- a/src/libcaptive/reactos/hal/halx86/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# $Id$ -# automake source for the captive-compatible halx86 ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/hal/Makefile-hal.am - -noinst_LTLIBRARIES=libhalx86.la -libhalx86_la_SOURCES= \ - fmutex.c \ - irql.c \ - spinlock.c -BUILT_SOURCES+=$(libhalx86_la_SOURCES) diff --git a/src/libcaptive/reactos/include/Makefile.am b/src/libcaptive/reactos/include/Makefile.am deleted file mode 100644 index c9b8d8a..0000000 --- a/src/libcaptive/reactos/include/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ -# automake source for the include dir ReactOS part of libcaptive Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am - -noinst_HEADERS+= \ - roscfg.h diff --git a/src/libcaptive/reactos/include/roscfg.h b/src/libcaptive/reactos/include/roscfg.h deleted file mode 100644 index f04bbb3..0000000 --- a/src/libcaptive/reactos/include/roscfg.h +++ /dev/null @@ -1,39 +0,0 @@ -/* $Id$ - * Include file simulating original ReactOS configuration file for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -/* captive project never includes this file directly - it may get included - * only from some .h/.c file of reactos sources. - * These sources have mandatory $(top_srcdir)/src/libcaptive/include/reactos/ - * wrappers protection (either by direct gcc "-include" option from Makefile-reactos.am - * or by mandatory "reactos/..." wrappers inclusion from regular source files. - */ -#ifndef _CAPTIVE_REACTOS_COMPAT_H -#error "$(top_srcdir)/src/libcaptive/include/reactos/compat.h pre-include NOT PRESENT!" -#endif - -#ifndef REACTOS_COMPAT -#error "REACTOS_COMPAT of $(top_srcdir)/src/libcaptive/include/reactos/compat.h NOT ACTIVE!" -#endif - - -#ifndef _CAPTIVE_REACTOS_ROSCFG_H -#define _CAPTIVE_REACTOS_ROSCFG_H 1 - - -#endif /* _CAPTIVE_REACTOS_ROSCFG_H */ diff --git a/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am b/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am deleted file mode 100644 index c1a1e8f..0000000 --- a/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am +++ /dev/null @@ -1,19 +0,0 @@ -# $Id$ -# automake source include for compilation of "ntoskrnl" ReactOS part of libcaptive -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -INCLUDES+=-D__NTOSKRNL__ diff --git a/src/libcaptive/reactos/ntoskrnl/Makefile.am b/src/libcaptive/reactos/ntoskrnl/Makefile.am deleted file mode 100644 index 7388719..0000000 --- a/src/libcaptive/reactos/ntoskrnl/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -SUBDIRS=dbg ex fs io ke ldr mm nt ob ps rtl se - -EXTRA_DIST+= \ - Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libntoskrnl.la -libntoskrnl_la_LIBADD= \ - dbg/libdbg.la \ - ex/libex.la \ - fs/libfs.la \ - io/libio.la \ - ke/libke.la \ - ldr/libldr.la \ - mm/libmm.la \ - nt/libnt.la \ - ob/libob.la \ - ps/libps.la \ - rtl/librtl.la \ - se/libse.la -libntoskrnl_la_SOURCES= diff --git a/src/libcaptive/reactos/ntoskrnl/dbg/Makefile.am b/src/libcaptive/reactos/ntoskrnl/dbg/Makefile.am deleted file mode 100644 index 2ac00b4..0000000 --- a/src/libcaptive/reactos/ntoskrnl/dbg/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" debug support ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libdbg.la -libdbg_la_SOURCES= \ - print.c -BUILT_SOURCES+=$(libdbg_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/ex/Makefile.am b/src/libcaptive/reactos/ntoskrnl/ex/Makefile.am deleted file mode 100644 index e913503..0000000 --- a/src/libcaptive/reactos/ntoskrnl/ex/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" ex/ ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libex.la -libex_la_SOURCES= \ - fmutex.c \ - list.c -BUILT_SOURCES+=$(libex_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/fs/Makefile.am b/src/libcaptive/reactos/ntoskrnl/fs/Makefile.am deleted file mode 100644 index e582faf..0000000 --- a/src/libcaptive/reactos/ntoskrnl/fs/Makefile.am +++ /dev/null @@ -1,29 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" fs/ ReactOS implementation Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libfs.la -libfs_la_SOURCES= \ - notify.c \ - oplock.c \ - util.c -BUILT_SOURCES+=$(libfs_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/io/Makefile.am b/src/libcaptive/reactos/ntoskrnl/io/Makefile.am deleted file mode 100644 index df6c48d..0000000 --- a/src/libcaptive/reactos/ntoskrnl/io/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" I/O ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libio.la -libio_la_SOURCES= \ - buildirp.c \ - cancel.c \ - cleanup.c \ - create.c \ - device.c \ - dir.c \ - file.c \ - fs.c \ - iomgr.c \ - irp.c \ - mdl.c \ - page.c \ - process.c \ - rw.c \ - share.c \ - shutdown.c \ - vpb.c -BUILT_SOURCES+=$(libio_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/ke/Makefile.am b/src/libcaptive/reactos/ntoskrnl/ke/Makefile.am deleted file mode 100644 index 843dca4..0000000 --- a/src/libcaptive/reactos/ntoskrnl/ke/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" kernel (ke/) ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libke.la -libke_la_SOURCES= \ - catch.c \ - critical.c \ - dpc.c \ - kqueue.c \ - mutex.c \ - queue.c \ - wait.c -BUILT_SOURCES+=$(libke_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/ldr/Makefile.am b/src/libcaptive/reactos/ntoskrnl/ldr/Makefile.am deleted file mode 100644 index 1d11628..0000000 --- a/src/libcaptive/reactos/ntoskrnl/ldr/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" loaders ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libldr.la -libldr_la_SOURCES= \ - loader.c \ - rtl.c -BUILT_SOURCES+=$(libldr_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/mm/Makefile.am b/src/libcaptive/reactos/ntoskrnl/mm/Makefile.am deleted file mode 100644 index 0f856b0..0000000 --- a/src/libcaptive/reactos/ntoskrnl/mm/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" memory management ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libmm.la -libmm_la_SOURCES= \ - aspace.c \ - mdl.c -BUILT_SOURCES+=$(libmm_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/nt/Makefile.am b/src/libcaptive/reactos/ntoskrnl/nt/Makefile.am deleted file mode 100644 index 9d568c3..0000000 --- a/src/libcaptive/reactos/ntoskrnl/nt/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" "nt/" ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libnt.la -libnt_la_SOURCES= \ - ntevent.c -BUILT_SOURCES+=$(libnt_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/ob/Makefile.am b/src/libcaptive/reactos/ntoskrnl/ob/Makefile.am deleted file mode 100644 index 4f46f4c..0000000 --- a/src/libcaptive/reactos/ntoskrnl/ob/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" object (ob/) ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libob.la -libob_la_SOURCES= \ - dirobj.c \ - handle.c \ - namespc.c \ - ntobj.c \ - object.c -BUILT_SOURCES+=$(libob_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/ps/Makefile.am b/src/libcaptive/reactos/ntoskrnl/ps/Makefile.am deleted file mode 100644 index 26f0b20..0000000 --- a/src/libcaptive/reactos/ntoskrnl/ps/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" process (ps/) ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libps.la -libps_la_SOURCES= \ - create.c \ - process.c \ - psmgr.c \ - thread.c -BUILT_SOURCES+=$(libps_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/rtl/Makefile.am b/src/libcaptive/reactos/ntoskrnl/rtl/Makefile.am deleted file mode 100644 index df6c0e8..0000000 --- a/src/libcaptive/reactos/ntoskrnl/rtl/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" runtimelib ReactOS implementation Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -SUBDIRS=i386 - -noinst_LTLIBRARIES=librtl.la -librtl_la_SOURCES= \ - dos8dot3.c \ - largeint.c \ - mem.c \ - nls.c \ - sprintf.c \ - unicode.c \ - wstring.c -librtl_la_LIBADD= \ - i386/libi386.la -BUILT_SOURCES+=$(librtl_la_SOURCES) diff --git a/src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile.am b/src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile.am deleted file mode 100644 index 4a77476..0000000 --- a/src/libcaptive/reactos/ntoskrnl/rtl/i386/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" i386 runtimelib ReactOS implementation Makefile -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libi386.la -libi386_la_SOURCES= \ - exception.c \ - seh.S -BUILT_SOURCES+=$(libi386_la_SOURCES) - -seh.S: $(top_srcdir)/reactos/$(subst src/libcaptive/reactos/,,$(subdir))/seh.s - @$(RM) $@ - $(LN_S) $< $@ - diff --git a/src/libcaptive/reactos/ntoskrnl/se/Makefile.am b/src/libcaptive/reactos/ntoskrnl/se/Makefile.am deleted file mode 100644 index f3b647e..0000000 --- a/src/libcaptive/reactos/ntoskrnl/se/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# $Id$ -# automake source for the "ntoskrnl.exe" security (se/) ReactOS implementation Makefile -# Copyright (C) 2002 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am -include $(top_srcdir)/src/libcaptive/reactos/Makefile-reactos.am -include $(top_srcdir)/src/libcaptive/reactos/ntoskrnl/Makefile-ntoskrnl.am - -noinst_LTLIBRARIES=libse.la -libse_la_SOURCES= \ - access.c \ - acl.c \ - luid.c \ - priv.c \ - sd.c \ - semgr.c \ - sid.c \ - token.c -BUILT_SOURCES+=$(libse_la_SOURCES) diff --git a/src/libcaptive/rtl/Makefile.am b/src/libcaptive/rtl/Makefile.am deleted file mode 100644 index b54b0c0..0000000 --- a/src/libcaptive/rtl/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# $Id$ -# automake source for the run-time-library of libcaptive Makefile -# Copyright (C) 2002-2005 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=librtl.la -librtl_la_SOURCES= \ - ctype.c \ - error.c \ - except.c \ - file.c \ - mem.c \ - memcpy.c \ - memmove.c \ - memset.c \ - string.c \ - unicode.c \ - unicode_reactos.c \ - version.c diff --git a/src/libcaptive/rtl/ctype.c b/src/libcaptive/rtl/ctype.c deleted file mode 100644 index ac38c0f..0000000 --- a/src/libcaptive/rtl/ctype.c +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id$ - * reactos character handling functions emulation of libcaptive - * Copyright (C) 2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include -#include "reactos/ntos/rtl.h" /* self */ -#include - - -/** - * captive_reactos_towupper: - * @c: Any-case character to convert. - * - * Wrapper of the system towupper() for the use by ReactOS. - * The ReactOS implementation does not provide full Unicode support. - * - * Returns: Uppercased @c. Original value is returned if the case cannot be - * changed. - */ -wchar_t captive_reactos_towupper(wchar_t c) -{ - return towupper(c); -} diff --git a/src/libcaptive/rtl/error.c b/src/libcaptive/rtl/error.c deleted file mode 100644 index 1b9fadd..0000000 --- a/src/libcaptive/rtl/error.c +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * Error handling implementation for reactos of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/rtl.h" /* self */ -#include - - -/** - * RtlAssert: - * @FailedAssertion: Failed-assertion expression given as string. - * %NULL value is forbidden. - * @FileName: Filename string where the assertion occured. - * %NULL value is forbidden. - * @LineNumber: Line number of @FileName where the assertion occured. - * @Message: Message to print. - * %NULL value is permitted. - * - * Prints the specified error message and bails out. - * This call never returns in libcaptive. - */ -VOID RtlAssert(PVOID FailedAssertion,PVOID FileName,ULONG LineNumber,PCHAR Message) -{ - g_return_if_fail(FailedAssertion!=NULL); - g_return_if_fail(FileName!=NULL); - - g_error("Assertion \'%s\' failed at %s line %d: %s\n", - (const gchar *)FailedAssertion,(const gchar *)FileName,(gint)LineNumber, - (Message ? Message : "(no message)")); - - g_assert_not_reached(); -} diff --git a/src/libcaptive/rtl/except.c b/src/libcaptive/rtl/except.c deleted file mode 100644 index 13f78f1..0000000 --- a/src/libcaptive/rtl/except.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $Id$ - * Implementation of reactos RtlpExecuteHandler() of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -/* No reactos public include prototype for RtlpExecuteHandlerForException() */ -#include -#include -#include "reactos/ntos/except.h" - - -EXCEPTION_DISPOSITION RtlpExecuteHandlerForException(PEXCEPTION_RECORD ExceptionRecord, - PEXCEPTION_REGISTRATION RegistrationFrame,PCONTEXT Context,PVOID DispatcherContext,PEXCEPTION_HANDLER ExceptionHandler) -{ -static gint nested=0; -EXCEPTION_DISPOSITION r; - - g_return_val_if_fail(ExceptionRecord!=NULL,ExceptionNestedException); - g_return_val_if_fail(RegistrationFrame!=NULL,ExceptionNestedException); - /* 'Context' can be NULL during ExRaiseStatus() */ - g_return_val_if_fail(DispatcherContext!=NULL,ExceptionNestedException); - g_return_val_if_fail(ExceptionHandler!=NULL,ExceptionNestedException); - - /* Nest-counting is provided here just for debugging reasons. */ - /* Nesting must be permitted for proper FSCTL_DISMOUNT_VOLUME execution. */ - - nested++; - r=(*ExceptionHandler)(ExceptionRecord,RegistrationFrame,Context,DispatcherContext); - nested--; - g_assert(nested>=0); - - g_assert(r==ExceptionContinueExecution || r==ExceptionContinueSearch); - return r; -} - - -EXCEPTION_DISPOSITION RtlpExecuteHandlerForUnwind(PEXCEPTION_RECORD ExceptionRecord, - PEXCEPTION_REGISTRATION RegistrationFrame,PCONTEXT Context,PVOID DispatcherContext,PEXCEPTION_HANDLER ExceptionHandler) -{ -static gint nested=0; -EXCEPTION_DISPOSITION r; - - g_return_val_if_fail(ExceptionRecord!=NULL,ExceptionNestedException); - g_return_val_if_fail(RegistrationFrame!=NULL,ExceptionNestedException); - /* 'Context' can be NULL during ExRaiseStatus() */ - g_return_val_if_fail(DispatcherContext!=NULL,ExceptionNestedException); - g_return_val_if_fail(ExceptionHandler!=NULL,ExceptionNestedException); - - /* Nest-counting is provided here just for debugging reasons. */ - if (nested) - g_assert_not_reached(); - - nested++; - r=(*ExceptionHandler)(ExceptionRecord,RegistrationFrame,Context,DispatcherContext); - nested--; - g_assert(!nested); - - g_assert(r==ExceptionContinueExecution || r==ExceptionContinueSearch); - return r; -} diff --git a/src/libcaptive/rtl/file.c b/src/libcaptive/rtl/file.c deleted file mode 100644 index c821474..0000000 --- a/src/libcaptive/rtl/file.c +++ /dev/null @@ -1,200 +0,0 @@ -/* $Id$ - * Internal (rtl/) file handling utilities of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/rtl-file.h" /* self */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "reactos/internal/mm.h" /* for PAGE_SIZE */ -#include - - -/* map: address -> GSIZE_TO_POINTER(length) */ -static GHashTable *captive_rtl_file_mmap_hash; - -/* initialize 'captive_rtl_file_mmap_hash' */ -static void captive_rtl_file_mmap_hash_init(void) -{ - if (captive_rtl_file_mmap_hash) - return; - captive_rtl_file_mmap_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - -/** - * captive_rtl_file_mmap: - * @lenp: returns the file length if successful. %NULL pointer permitted. - * @path: File pathname to open(2). - * @open_flags: open(2) parameter #flags such as %O_RDONLY. - * @mmap_prot: mmap(2) parameter #prot such as %PROT_READ. - * @mmap_flags: mmap(2) parameter #flags such as %MAP_SHARED. - * - * mmap(2) the whole file into memory. - * - * Returns: address base with mmap(2)ed file (and @lenp filled) or #NULL if error. - */ -gpointer captive_rtl_file_mmap(size_t *lenp,const gchar *path,int open_flags,int mmap_prot,int mmap_flags) -{ -gpointer r; -int fd; -size_t len; -off_t lenoff; - - captive_rtl_file_mmap_hash_init(); - - /* FIXME: use g_filename_from_utf8() on 'path' */ - fd=open(path,open_flags); - if (fd==-1) { - g_error("captive_rtl_file_mmap(\"%s\"): open: %m",path); - goto err; - } - - lenoff=lseek(fd,0,SEEK_END); - if (lenoff==(off_t)-1) { - g_assert_not_reached(); - goto err_close; - } - len=(size_t)lenoff; - if (lenp) - *lenp=len; - - r=mmap( - 0, /* start */ - len, /* len */ - mmap_prot, - mmap_flags, - fd, - 0 /* offset */ - ); - if (r==MAP_FAILED || r==NULL) { - g_assert_not_reached(); - goto err_close; - } - - if (close(fd)) { - g_assert_not_reached(); - goto err_munmap; - } - - /* should make no difference with g_hash_table_replace() - * as we are using (g_direct_hash,g_direct_equal) - */ - g_hash_table_insert(captive_rtl_file_mmap_hash, - r,GSIZE_TO_POINTER(len)); /* key,value */ - - return r; - -err_munmap: - /* errors ignored */ - munmap(r,len); -err_close: - /* errors ignored */ - close(fd); -err: - g_return_val_if_reached(NULL); -} - -/** - * captive_rtl_file_munmap: - * @base: file base address returned by captive_rtl_file_mmap(). %NULL pointer forbidden. - * - * munmap(2) the whole file and destroy all its resources. - */ -void captive_rtl_file_munmap(gpointer base) -{ -gpointer len_ptr; /* GSIZE_TO_POINTER(off_t len) */ -gboolean found; - - g_return_if_fail(base!=NULL); - - captive_rtl_file_mmap_hash_init(); - - /* report if 'base' not found */ - found=g_hash_table_lookup_extended(captive_rtl_file_mmap_hash, - base, /* lookup_key */ - NULL, /* orig_key */ - &len_ptr); /* value */ - g_return_if_fail(found==TRUE); - - /* remove 'base' from our database */ - found=g_hash_table_remove(captive_rtl_file_mmap_hash, - base); /* key */ - g_return_if_fail(found==TRUE); /* just a warning would be also possible */ - - /* munmap() has no return value */ - munmap(base,GPOINTER_TO_SIZE(len_ptr)); -} - - -/** - * captive_rtl_file_read: - * @fd: file-descriptor to read data from. - * @bufsizep: Returns the size of resulting data. - * %NULL pointer is permitted. - * - * Reads the whole file into memory. - * - * Returns: address base of the memory being filled with file contents. - * Free the area by g_free() if no longer used. - */ -gpointer captive_rtl_file_read(gint fd,gsize *bufsizep) -{ -off_t lenoff,gotoff; -GString *r_GString; -void *buf; -ssize_t readgot; - - errno=0; - lenoff=lseek(fd,0,SEEK_END); - switch (lenoff) { - case (off_t)-1: - if (errno!=ESPIPE) - g_assert_not_reached(); - lenoff=PAGE_SIZE; - break; - case 0: - return NULL; - default: - gotoff=lseek(fd,0,SEEK_SET); - g_assert(gotoff==0); - } - r_GString=g_string_sized_new(lenoff); - buf=g_malloc(lenoff); /* do not use g_alloca() - the buffer may be big! */ - while ((readgot=read(fd,buf,lenoff))>0) { - g_assert(readgot<=lenoff); - r_GString=g_string_append_len(r_GString,buf,readgot); - } - g_assert(readgot==0); /* EOF */ - g_free(buf); - - if (bufsizep) - *bufsizep=r_GString->len; - return g_string_free(r_GString, - FALSE); /* free_segment */ -} diff --git a/src/libcaptive/rtl/generictable.c b/src/libcaptive/rtl/generictable.c deleted file mode 100644 index 3b4d79d..0000000 --- a/src/libcaptive/rtl/generictable.c +++ /dev/null @@ -1,877 +0,0 @@ -/* $Id$ - * Implementation of Rtl*GenericTable*() of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/rtl.h" /* self */ -#include -#include -#include -#include -#include -#include "captive/macros.h" -#include - - -struct table_info { - RTL_GENERIC_TABLE *GenericTable; - /* g_tree_nnodes() is expensive! Use 'GenericTable->ElementCount'. */ - /* map (struct table_key_info *)->(struct table_key_info *) */ - GTree *gtree; - struct table_key_info **array; /* NULL or valid items */ - struct table_key_info **enumerate_arrayp; /* NULL if not inside enumeration */ - /* Used for tracking of parent of unfound element for 'NodeOrParent' */ - const struct table_key_info *last_table_key_info_compare_func_a_table_key_info; - const struct table_key_info *last_table_key_info_compare_func_b_table_key_info; - }; - -struct table_key_info { - struct table_info *table_info; - gpointer key; - size_t key_size; /* may be NULL if unknown */ - }; - -/* map PRTL_GENERIC_TABLE->(struct table_info *) */ -static GHashTable *GenericTable_to_table_info_hash; - -static void GenericTable_to_table_info_hash_init(void) -{ - if (GenericTable_to_table_info_hash) - return; - GenericTable_to_table_info_hash=g_hash_table_new(g_direct_hash,g_direct_equal); -} - - -/* Internal to table_info_array_new(). - * Complies to 'GTraverseFunc'. - */ -static gboolean table_info_array_new_func - (struct table_key_info *key_info,struct table_key_info *value_info,struct table_key_info ***r_fillptr) -{ - /* Do not validate_table_key_info() here to prevent loop. */ - g_return_val_if_fail(key_info!=NULL,TRUE); - g_return_val_if_fail(value_info!=NULL,TRUE); - g_return_val_if_fail(key_info==value_info,TRUE); - g_return_val_if_fail(r_fillptr,TRUE); - g_return_val_if_fail(*r_fillptr,TRUE); - - **r_fillptr=key_info; - *r_fillptr++; - - return FALSE; /* continue traversal */ -} - -/* It is valid to return NULL if 0==table_info->GenericTable->ElementCount */ -static struct table_key_info **table_info_array_new(const struct table_info *table_info) -{ -struct table_key_info **r,**r_fill; - - g_return_val_if_fail(table_info!=NULL,NULL); - /* Do not validate_table_info() here to prevent loop. */ - g_return_val_if_fail(table_info->GenericTable!=NULL,NULL); - - captive_newn(r,table_info->GenericTable->ElementCount); - r_fill=r; - g_tree_foreach(table_info->gtree, - (GTraverseFunc)table_info_array_new_func, /* func */ - &r_fill); /* user_data */ - g_assert(r_fill==r+table_info->GenericTable->ElementCount); - - return r; -} - -/* Internal to validate_GenericTable(). - * Complies to 'GTraverseFunc'. - */ -static gboolean validate_GenericTable_func - (struct table_key_info *key_info,struct table_key_info *value_info,const struct table_info *table_info) -{ -RTL_GENERIC_TABLE *GenericTable; - - g_return_val_if_fail(key_info!=NULL,TRUE); - g_return_val_if_fail(value_info!=NULL,TRUE); - g_return_val_if_fail(key_info==value_info,TRUE); - /* Do not validate_table_info() here to prevent loop. */ - g_return_val_if_fail(table_info!=NULL,TRUE); - g_return_val_if_fail(key_info->table_info==table_info,TRUE); - - GenericTable=table_info->GenericTable; - g_assert(GenericEqual==(*GenericTable->CompareRoutine)(GenericTable,key_info->key,key_info->key)); - - return FALSE; /* continue traversal */ -} - -static gboolean validate_GenericTable(RTL_GENERIC_TABLE *GenericTable) -{ -const struct table_info *table_info; - - g_return_val_if_fail(GenericTable!=NULL,FALSE); - - GenericTable_to_table_info_hash_init(); - /* do not use GenericTable_to_table_info() here to prevent deadlocks! */ - table_info=g_hash_table_lookup(GenericTable_to_table_info_hash,GenericTable); - g_return_val_if_fail(table_info!=NULL,FALSE); - - g_return_val_if_fail(table_info->GenericTable==GenericTable,FALSE); - g_return_val_if_fail(table_info->gtree!=NULL,FALSE); - g_tree_foreach(table_info->gtree, - (GTraverseFunc)validate_GenericTable_func, /* func */ - (gpointer/*de-const*/)table_info); /* user_data */ - - g_return_val_if_fail(GenericTable->RootElement==NULL,FALSE); /* we do not store it inside */ - g_return_val_if_fail(GenericTable->ElementCount==(ULONG)g_tree_nnodes(table_info->gtree),FALSE); - g_return_val_if_fail(GenericTable->CompareRoutine!=NULL,FALSE); - g_return_val_if_fail(GenericTable->AllocateRoutine!=NULL,FALSE); - g_return_val_if_fail(GenericTable->FreeRoutine!=NULL,FALSE); - - /* check the 'array' validitity if it is valid (==if exists) */ - if (table_info->array) { - /* check postponed here as it requires a pretty consistent structure */ -struct table_key_info **array_check=table_info_array_new(table_info); - - g_assert(0==memcmp(table_info->array,array_check,sizeof(*array_check)*table_info->GenericTable->ElementCount)); - g_free(array_check); - } - g_return_val_if_fail(!table_info->enumerate_arrayp - || table_info->enumerate_arrayparray+GenericTable->ElementCount, - FALSE); - - return TRUE; -} - - -static gboolean validate_table_info(const struct table_info *table_info) -{ - g_return_val_if_fail(table_info!=NULL,FALSE); - g_return_val_if_fail(table_info->GenericTable!=NULL,FALSE); - - g_return_val_if_fail(TRUE==validate_GenericTable(table_info->GenericTable),FALSE); - - return TRUE; -} - - -static struct table_info *GenericTable_to_table_info(RTL_GENERIC_TABLE *GenericTable) -{ -struct table_info *r; - - g_return_val_if_fail(GenericTable!=NULL,NULL); - - GenericTable_to_table_info_hash_init(); - r=g_hash_table_lookup(GenericTable_to_table_info_hash,GenericTable); - g_return_val_if_fail(TRUE==validate_table_info(r),NULL); - - return r; -} - - -static gboolean validate_table_key_info(const struct table_key_info *table_key_info) -{ - g_return_val_if_fail(table_key_info!=NULL,FALSE); - - g_return_val_if_fail(TRUE==validate_table_info(table_key_info->table_info),FALSE); - g_return_val_if_fail(table_key_info->key!=NULL,FALSE); - /* key_size may be NULL if it is unknown */ - - return TRUE; -} - - -static gboolean table_info_array_create(struct table_info *table_info) -{ - g_return_val_if_fail(TRUE==validate_table_info(table_info),FALSE); - - if (!table_info->array) - table_info->array=table_info_array_new(table_info); - - return TRUE; -} - -static gboolean table_info_array_delete(struct table_info *table_info) -{ - g_return_val_if_fail(TRUE==validate_table_info(table_info),FALSE); - - g_free(table_info->array); - table_info->array=NULL; - table_info->enumerate_arrayp=NULL; /* enumeration no longer possible */ - - return TRUE; -} - - -/* Returns: -1 if not found, >=0 if position found. */ -static gint table_info_array_find_key_compare(struct table_info *table_info,gpointer key) -{ -RTL_GENERIC_TABLE *GenericTable; -gint r,i; - - g_return_val_if_fail(TRUE==validate_table_info(table_info),-1); - - table_info_array_create(table_info); - GenericTable=table_info->GenericTable; - r=-1; /* not yet found */ - for (i=0;(ULONG)iGenericTable->ElementCount;i++) - if (GenericEqual==(*GenericTable->CompareRoutine)(GenericTable,table_info->array[i]->key,key)) { - g_assert(r==-1); - r=i; - } - return r; -} - - -/* Returns: -1 if not found, >=0 if position found. */ -static gint table_info_array_find_key_pointer(struct table_info *table_info,gpointer key) -{ -gint r,i; - - g_return_val_if_fail(TRUE==validate_table_info(table_info),-1); - - table_info_array_create(table_info); - r=-1; /* not yet found */ - for (i=0;(ULONG)iGenericTable->ElementCount;i++) - if (table_info->array[i]==key) { - g_assert(r==-1); - r=i; - } - return r; -} - - -/* Complies with 'GCompareDataFunc'. */ -static gint table_key_info_compare_func - (const struct table_key_info *a_table_key_info,const struct table_key_info *b_table_key_info,struct table_info *table_info) -{ -RTL_GENERIC_TABLE *GenericTable; - - g_return_val_if_fail(TRUE==validate_table_key_info(a_table_key_info),FALSE); - g_return_val_if_fail(TRUE==validate_table_key_info(b_table_key_info),FALSE); - g_return_val_if_fail(TRUE==validate_table_info(table_info),FALSE); - g_return_val_if_fail(table_info==a_table_key_info->table_info,FALSE); - g_return_val_if_fail(table_info==b_table_key_info->table_info,FALSE); - - table_info->last_table_key_info_compare_func_a_table_key_info=a_table_key_info; - table_info->last_table_key_info_compare_func_b_table_key_info=b_table_key_info; - - GenericTable=table_info->GenericTable; - switch ((*GenericTable->CompareRoutine)(GenericTable,a_table_key_info->key,b_table_key_info->key)) { - case GenericLessThan: return -1; - case GenericGreaterThan: return +1; - case GenericEqual: return 0; - default: g_assert_not_reached(); - } - g_return_val_if_reached(0); -} - - -/* Complies with 'GDestroyNotify'. - * It has the problem that no user_data are passed here! - */ -static void table_key_info_destroy_func(struct table_key_info *table_key_info) -{ -RTL_GENERIC_TABLE *GenericTable; - - g_return_if_fail(TRUE==validate_table_key_info(table_key_info)); - - GenericTable=table_key_info->table_info->GenericTable; - (*GenericTable->FreeRoutine)(GenericTable,table_key_info->key); - g_free(table_key_info); -} - - -/** - * RtlInitializeGenericTable: - * @GenericTable: Already allocated memory where the GenericTable header is initialized. - * %NULL value is forbidden. - * @CompareRoutine: Routine returning %GenericLessThan, %GenericGreaterThan or %GenericEqual for two items. - * %NULL value is forbidden. - * @AllocateRoutine: Item memory allocator. - * %NULL value is forbidden. - * @FreeRoutine: Item memory deallocator. - * %NULL value is forbidden. - * - * Initializes @GenericTable. Such GenericTable can never be destroyed. - */ -VOID RtlInitializeGenericTable(IN OUT PRTL_GENERIC_TABLE GenericTable, - IN PVOID CompareRoutine,IN PVOID AllocateRoutine,IN PVOID FreeRoutine,IN ULONG UserParameter) -{ -struct table_info *table_info; - - g_return_if_fail(GenericTable!=NULL); - g_return_if_fail(CompareRoutine!=NULL); - g_return_if_fail(AllocateRoutine!=NULL); - g_return_if_fail(FreeRoutine!=NULL); - - GenericTable_to_table_info_hash_init(); - g_assert(g_hash_table_lookup(GenericTable_to_table_info_hash,GenericTable)==NULL); - - CAPTIVE_MEMZERO(GenericTable); - GenericTable->ElementCount=0; - GenericTable->CompareRoutine=CompareRoutine; - GenericTable->AllocateRoutine=AllocateRoutine; - GenericTable->FreeRoutine=FreeRoutine; - GenericTable->UserParameter=UserParameter; - - captive_new0(table_info); - table_info->GenericTable=GenericTable; - table_info->gtree=g_tree_new_full( - (GCompareDataFunc)table_key_info_compare_func, /* key_compare_func */ - table_info, /* key_compare_data */ - (GDestroyNotify)table_key_info_destroy_func, /* key_destroy_func */ - NULL); /* value_destroy_func */ - table_info->array=NULL; /* deleted now */ - table_info->enumerate_arrayp=NULL; /* not yet enumerating */ - - g_hash_table_insert(GenericTable_to_table_info_hash,GenericTable,table_info); - g_assert(TRUE==validate_GenericTable(GenericTable)); -} - - -/** - * RtlInsertElementGenericTable: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * @Element: Pointer to your buffer for the data to copy to the inserted element. - * %NULL value is forbidden. - * @ElementSize: Size of @Element to copy. - * %0 value is forbidden. - * @NewElement: Optionally returns whether new element was created. - * %NULL value is permitted. - * - * If @Element does not exist in @GenericTable yet it will allocate and copy @Element - * to new memory block, the function will return %TRUE in @NewElement and it will return - * the address of the new allocated element. - * - * If @Element already exists in @GenericTable it the function will return %FALSE in @NewElement - * and it will return you the pointer to the old element data already existing in @GenericTable. - * - * Returns: Pointer to a fresh allocated element or a pointer to the already existing - * element in @GenericTable. Function will never return @Element address unless the passed - * @Element address is the already copied instance linked to @GenericTable. - */ -PVOID RtlInsertElementGenericTable(IN OUT PRTL_GENERIC_TABLE GenericTable, - IN PVOID Element,IN ULONG ElementSize,PBOOLEAN NewElement OPTIONAL) -{ -struct table_info *table_info; -struct table_key_info *Element_table_key_info,*r_table_key_info; -gpointer Element_table_key_info_key_new; - - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),NULL); - g_return_val_if_fail(Element!=NULL,NULL); - g_return_val_if_fail(ElementSize>0,NULL); - - table_info=GenericTable_to_table_info(GenericTable); - captive_new(Element_table_key_info); - Element_table_key_info->table_info=table_info; - Element_table_key_info->key=Element; - Element_table_key_info->key_size=ElementSize; - if ((r_table_key_info=g_tree_lookup(table_info->gtree,Element_table_key_info))) { - /* found existing key */ - g_free(Element_table_key_info); - if (NewElement) - *NewElement=FALSE; - return r_table_key_info->key; - } - - /* Insert new item. */ - table_info_array_delete(table_info); - /* Copy the Element data. */ - Element_table_key_info_key_new=(*GenericTable->AllocateRoutine)( - GenericTable, /* Table */ - Element_table_key_info->key_size); /* ByteSize */ - g_assert(Element_table_key_info_key_new!=NULL); - memcpy(Element_table_key_info_key_new,Element_table_key_info->key,Element_table_key_info->key_size); - Element_table_key_info->key=Element_table_key_info_key_new; - - g_tree_insert(table_info->gtree, - Element_table_key_info, /* key */ - Element_table_key_info); /* value */ - GenericTable->ElementCount++; - if (NewElement) - *NewElement=TRUE; - g_assert(TRUE==validate_GenericTable(GenericTable)); - - return Element_table_key_info->key; -} - - -/** - * RtlInsertElementGenericTableFull: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * @Element: Pointer to your buffer for the data to copy to the inserted element. - * %NULL value is forbidden. - * @ElementSize: Size of @Element to copy. - * %0 value is forbidden. - * @NewElement: Optionally returns whether new element was created. - * %NULL value is permitted. - * @NodeOrParent: Value returned by RtlLookupElementGenericTableFull(). - * %NULL value is permitted iff @SearchResult==%TableEmptyTree. - * @SearchResult: Value returned by RtlLookupElementGenericTableFull(). - * - * See RtlInsertElementGenericTable() for the functionality description. - * You must call RtlLookupElementGenericTableFull() before this function with - * no @GenericTable modifications between these two calls. - * - * Additional two parameters @NodeOrParent and @SearchResult should make the - * operation faster although libcaptive only sanity checks them. - * libcaptive implements this function only as a wrapper around RtlInsertElementGenericTable(). - * - * Returns: Pointer to a fresh allocated element or a pointer to the already existing - * element in @GenericTable. Function will never return @Element address unless the passed - * @Element address is the already copied instance linked to @GenericTable. - */ -PVOID RtlInsertElementGenericTableFull(PRTL_GENERIC_TABLE GenericTable, - PVOID Element,ULONG ElementSize,PBOOLEAN NewElement OPTIONAL,PVOID NodeOrParent,TABLE_SEARCH_RESULT SearchResult) -{ -struct table_info *table_info; -gint Element_pos_entry,Element_pos,NodeOrParent_pos_entry,NodeOrParent_pos; -ULONG ElementCount_entry; -PVOID r; -BOOLEAN NewElement_tmp; -PVOID NodeOrParent_check; -TABLE_SEARCH_RESULT SearchResult_check; - - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),NULL); - g_return_val_if_fail(Element!=NULL,NULL); - g_return_val_if_fail(ElementSize>0,NULL); - - RtlLookupElementGenericTableFull(GenericTable,Element,&NodeOrParent_check,&SearchResult_check); - g_assert(NodeOrParent_check==NodeOrParent); - g_assert(SearchResult_check==SearchResult); - - if (!NewElement) - NewElement=&NewElement_tmp; - table_info=GenericTable_to_table_info(GenericTable); - Element_pos_entry=table_info_array_find_key_compare(table_info,Element); - NodeOrParent_pos_entry=(NodeOrParent==NULL ? -1 : table_info_array_find_key_compare(table_info,NodeOrParent)); - ElementCount_entry=GenericTable->ElementCount; - - r=RtlInsertElementGenericTable(GenericTable,Element,ElementSize,NewElement); - g_assert(r!=NULL); - Element_pos=table_info_array_find_key_compare(table_info,Element); - g_assert(Element_pos==table_info_array_find_key_compare(table_info,r)); - NodeOrParent_pos=(NodeOrParent==NULL ? -1 : table_info_array_find_key_compare(table_info,NodeOrParent)); - - switch (SearchResult) { - case TableEmptyTree: - g_assert(ElementCount_entry==0); - g_assert(GenericTable->ElementCount==1); /* just inserted */ - g_assert(r!=Element); - g_assert(*NewElement); - g_assert(Element_pos_entry==-1); - g_assert(Element_pos==0); - g_assert(NodeOrParent==NULL); - g_assert(NodeOrParent_pos_entry==-1); - g_assert(NodeOrParent_pos==-1); - break; - case TableFoundNode: - g_assert(ElementCount_entry>=1); - g_assert(ElementCount_entry==GenericTable->ElementCount); - g_assert(r==Element); - g_assert(!*NewElement); - g_assert(Element_pos_entry>=0); - g_assert(Element_pos==Element_pos_entry); - g_assert(NodeOrParent!=NULL); - g_assert(GenericEqual==(*GenericTable->CompareRoutine)(GenericTable,Element,NodeOrParent)); - g_assert(NodeOrParent_pos_entry!=-1); - g_assert(NodeOrParent_pos_entry==Element_pos_entry); - g_assert(NodeOrParent_pos==NodeOrParent_pos_entry); - break; - case TableInsertAsLeft: - g_assert(ElementCount_entry+1==GenericTable->ElementCount); - g_assert(r!=Element); - g_assert(*NewElement); - g_assert(Element_pos_entry==-1); - g_assert(Element_pos>=0); - g_assert(NodeOrParent!=NULL); - g_assert(GenericLessThan==(*GenericTable->CompareRoutine)(GenericTable,Element,NodeOrParent)); - g_assert(NodeOrParent_pos_entry!=-1); - g_assert(NodeOrParent_pos==NodeOrParent_pos_entry+1); - g_assert(Element_pos+1==NodeOrParent_pos); - break; - case TableInsertAsRight: - g_assert(ElementCount_entry+1==GenericTable->ElementCount); - g_assert(r!=Element); - g_assert(*NewElement); - g_assert(Element_pos_entry==-1); - g_assert(Element_pos>=0); - g_assert(NodeOrParent!=NULL); - g_assert(GenericGreaterThan==(*GenericTable->CompareRoutine)(GenericTable,Element,NodeOrParent)); - g_assert(NodeOrParent_pos_entry!=-1); - g_assert(NodeOrParent_pos==NodeOrParent_pos_entry+0); - g_assert(Element_pos-1==NodeOrParent_pos); - break; - - default: - g_assert_not_reached(); - } - return r; -} - -/** - * RtlDeleteElementGenericTable: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * @Element: Pointer to your buffer to locate the right element of @GenericTable you want to delete. - * %NULL value is forbidden. - * - * Deletes the specified @Element from @GenericTable. Memory referenced - * by @Element is used only to find the right element of @GenericTable. - * - * Returns: %TRUE iff @Element was found (and therefore successfuly deleted). - */ -BOOLEAN RtlDeleteElementGenericTable(PRTL_GENERIC_TABLE GenericTable,PVOID Element) -{ -struct table_info *table_info; -struct table_key_info *Element_table_key_info; - - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),FALSE); - g_return_val_if_fail(Element!=NULL,FALSE); - - table_info=GenericTable_to_table_info(GenericTable); - captive_new_alloca(Element_table_key_info); - Element_table_key_info->table_info=table_info; - Element_table_key_info->key=Element; - Element_table_key_info->key_size=0; /* 0 means unknown */ - if (!g_tree_lookup(table_info->gtree,Element_table_key_info)) { - /* not found */ - return FALSE; - } - - /* delete the item */ - g_assert(GenericTable->ElementCount>=1); - table_info_array_delete(table_info); - g_tree_remove(table_info->gtree,Element_table_key_info); - GenericTable->ElementCount--; - g_assert(TRUE==validate_GenericTable(GenericTable)); - - return TRUE; -} - - -/** - * RtlLookupElementGenericTable: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * @Element: Pointer to your buffer for the data to locate the right element of @GenericTable. - * %NULL value is forbidden. - * - * This call is just a parameter-reduced wrapper around RtlLookupElementGenericTableFull(). - * - * Returns: Data pointer to data of the element found in @GenericTable. - * %NULL value if no such element was found in @GenericTable. - */ -PVOID RtlLookupElementGenericTable(PRTL_GENERIC_TABLE GenericTable,PVOID Element) -{ -PVOID NodeOrParent_tmp; -TABLE_SEARCH_RESULT SearchResult_tmp; - - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),NULL); - g_return_val_if_fail(Element!=NULL,NULL); - - return RtlLookupElementGenericTableFull(GenericTable,Element,&NodeOrParent_tmp,&SearchResult_tmp); -} - - -/** - * RtlLookupElementGenericTableFull: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * @Element: Pointer to your buffer for the data to locate the right element of @GenericTable. - * %NULL value is forbidden. - * @NodeOrParentp: Returns %NULL if %TableEmptyTree. Returns function return value if %TableFoundNode. - * Returns the data pointer of the possible (it would be the sure parent after insert) parent node - * if %TableInsertAsLeft or TableInsertAsRight. - * %NULL value is forbidden. FIXME: Is it forbidden by W32? - * @SearchResultp: Returns %TableEmptyTree, %TableFoundNode, %TableInsertAsLeft or %TableInsertAsRight - * according to the behaviour for the following RtlInsertElementGenericTableFull(). - * %NULL value is forbidden. FIXME: Is it forbidden by W32? - * - * Attempts to find the specified @Element in @GenericTable. - * - * Returns: Data pointer to data of the element found in @GenericTable. - * %NULL value if no such element was found in @GenericTable. - */ -PVOID RtlLookupElementGenericTableFull(PRTL_GENERIC_TABLE GenericTable, - PVOID Element,OUT PVOID *NodeOrParentp,OUT TABLE_SEARCH_RESULT *SearchResultp) -{ -struct table_info *table_info; -struct table_key_info *Element_table_key_info; -const struct table_key_info *parent_table_key_info,*found_table_key_info; -gint leftorright; - - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),NULL); - g_return_val_if_fail(Element!=NULL,NULL); - g_return_val_if_fail(NodeOrParentp!=NULL,NULL); - g_return_val_if_fail(SearchResultp!=NULL,NULL); - - /* empty table? */ - if (RtlIsGenericTableEmpty(GenericTable)) { - if (NodeOrParentp) - *NodeOrParentp=NULL; - if (SearchResultp) - *SearchResultp=TableEmptyTree; - return NULL; - } - - /* try to find */ - table_info=GenericTable_to_table_info(GenericTable); - captive_new_alloca(Element_table_key_info); - Element_table_key_info->table_info=table_info; - Element_table_key_info->key=Element; - Element_table_key_info->key_size=0; /* 0 means unknown */ - table_info->last_table_key_info_compare_func_a_table_key_info=NULL; - table_info->last_table_key_info_compare_func_b_table_key_info=NULL; - found_table_key_info=g_tree_lookup(table_info->gtree,Element_table_key_info); - g_assert(table_info->last_table_key_info_compare_func_a_table_key_info!=NULL); /* tree is not empty */ - g_assert(table_info->last_table_key_info_compare_func_b_table_key_info!=NULL); /* tree is not empty */ - g_assert(0 /* at least one table_key_info_compare_func() must be always the looked up 'Element_table_key_info' */ - || table_info->last_table_key_info_compare_func_a_table_key_info==Element_table_key_info - || table_info->last_table_key_info_compare_func_b_table_key_info==Element_table_key_info); - g_assert(0 /* at most one table_key_info_compare_func() must be always the looked up 'Element_table_key_info' */ - || table_info->last_table_key_info_compare_func_a_table_key_info!=Element_table_key_info - || table_info->last_table_key_info_compare_func_b_table_key_info!=Element_table_key_info); - - /* found? */ - if (found_table_key_info) { - if (NodeOrParentp) - *NodeOrParentp=found_table_key_info->key; - if (SearchResultp) - *SearchResultp=TableFoundNode; - return found_table_key_info->key; - } - - /* not found: TableInsertAsLeft or TableInsertAsRight? */ - parent_table_key_info=(table_info->last_table_key_info_compare_func_a_table_key_info==Element_table_key_info - ? table_info->last_table_key_info_compare_func_b_table_key_info - : table_info->last_table_key_info_compare_func_a_table_key_info); - if (NodeOrParentp) - *NodeOrParentp=parent_table_key_info->key; - leftorright=table_key_info_compare_func(parent_table_key_info,Element_table_key_info,table_info); - g_assert(leftorright!=0); /* it would be already 'TableFoundNode' in such case */ - if (SearchResultp) - *SearchResultp=(leftorright<0 ? TableInsertAsLeft : TableInsertAsRight); - return NULL; -} - - -/** - * RtlEnumerateGenericTable: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * Passing empty table is permitted (returns %NULL value immediately). - * @Restart: %TRUE to start the enumeration from the start. - * %FALSE value is forbidden if enumeration was not yet started or @GenericTable - * was modified in the meanwhile. - * - * Returns element data pointer for each item containe in @GenericTable in the sorted order. - * - * You may proceed at most one pending enumeration for one @GenericTable. - * Use RtlEnumerateGenericTableWithoutSplaying() if you want multiple enumerations for @GenericTable at once. - * - * FIXME: Does W32 handle @GenericTable modifications during pending RtlEnumerateGenericTable()? - * - * Returns: Next (or first if @Restart) element of @GenericTable. - * %NULL value if no more entries are found. It is permitted to call this function - * multiple times with @Restart==%FALSE even if all the entries were already enumerated - * as long as @GenericTable is not modified (returns %NULL for each such call). - */ -PVOID RtlEnumerateGenericTable(PRTL_GENERIC_TABLE GenericTable,BOOLEAN Restart) -{ -PVOID *r; -struct table_info *table_info; - - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),NULL); - table_info=GenericTable_to_table_info(GenericTable); - /* If !Restart we must already started enumeration - * or we must not modify GenericTable in the meanwhile. - */ - g_return_val_if_fail(Restart || table_info->enumerate_arrayp,NULL); - - if (Restart) { - table_info_array_create(table_info); - table_info->enumerate_arrayp=table_info->array; - } - if (!table_info->enumerate_arrayp) /* end reached */ - return NULL; - g_assert(table_info->enumerate_arrayp< table_info->array+GenericTable->ElementCount); /* OK even if empty table */ - r=(*table_info->enumerate_arrayp)->key; - table_info->enumerate_arrayp++; - g_assert(table_info->enumerate_arrayp<=table_info->array+GenericTable->ElementCount); - /* End of enumeration? */ - if (table_info->enumerate_arrayp==table_info->array+GenericTable->ElementCount) - table_info->enumerate_arrayp=NULL; - - return r; -} - - -/** - * RtlEnumerateGenericTableWithoutSplaying: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * Passing empty table is permitted (returns %NULL value immediately). - * @RestartKey: Pointer to undeterminable storage #PVOID to keep track of the enumeration progess. - * Initialize the pointed value to %NULL to start the enumeration from the start. - * Non %NULL pointer value is forbidden if enumeration of this @RestartKey was not yet started or @GenericTable - * was modified in the meanwhile. - * %NULL pointer is forbidden. - * - * Returns element data pointer for each item containe in @GenericTable in the sorted order. - * - * You may proceed multiple enumerations for one @GenericTable by using different @RestartKey - * pointer to track each enumeration state. You may find RtlEnumerateGenericTable() - * easier if just one enumeration at once is needed. - * - * FIXME: Does W32 handle @GenericTable modifications during pending RtlEnumerateGenericTableWithoutSplaying()? - * - * FIXME: Detect possible modifications of @GenericTable reliably. Modification sequence number - * must be introduced for such feature. - * - * Returns: Next (or first if *@RestartKey==%NULL on entry) element of @GenericTable. - * %NULL value if no more entries are found. It is permitted to call this function - * multiple times without nullifying of *@RestartKey even if all the entries were already enumerated - * as long as @GenericTable is not modified (returns %NULL for each such call). - * Function may modify the value pointed at by @RestartKey. - */ -PVOID RtlEnumerateGenericTableWithoutSplaying(PRTL_GENERIC_TABLE GenericTable,PVOID *RestartKey) -{ -struct table_info *table_info; -gint RestartKey_pos; - - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),NULL); - g_return_val_if_fail(RestartKey!=NULL,NULL); - - table_info=GenericTable_to_table_info(GenericTable); - - /* Empty? */ - if (!GenericTable->ElementCount) { - /* either unitialized '*RestartKey' by caller or a modification in the meantime */ - g_assert(!*RestartKey); - return NULL; - } - - /* Restart? */ - if (!*RestartKey) { - table_info_array_create(table_info); - *RestartKey=table_info->array[0]; - return *RestartKey; - } - - /* Modifications in the meanwhile? FIXME: We may miss some. */ - g_assert(!GenericTable->ElementCount || table_info->array!=NULL); - - RestartKey_pos=table_info_array_find_key_pointer(table_info,*RestartKey); - /* May fail on some modification in the meantime. */ - g_assert(RestartKey_pos>=0); - - RestartKey_pos++; - /* End of enumeration? */ - if ((ULONG)RestartKey_pos==GenericTable->ElementCount) { - /* Do not modify '*RestartKey' to keep returning NULL forever */ - return NULL; - } - - g_assert((ULONG)RestartKey_posElementCount); - *RestartKey=table_info->array[RestartKey_pos]; - return *RestartKey; -} - - -/** - * RtlGetElementGenericTable: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * @I: %0 based index of the requested element. - * Value >=RtlNumberGenericTableElements(@GenericTable) is permitted by W32 documentation. - * Value >=RtlNumberGenericTableElements(@GenericTable) is currently forbidden by libcaptive - * for debugging purposes. - * - * Returns the @I -th element of sorted elements of @GenericTable. - * - * Returns: Requested element or %NULL if @I>=RtlNumberGenericTableElements(@GenericTable). - * Currently libcaptive can never return %NULL. - */ -PVOID RtlGetElementGenericTable(PRTL_GENERIC_TABLE GenericTable,ULONG I) -{ -struct table_info *table_info; - - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),NULL); - - /* Catch such case for debugging purposes as it is permitted by W32 docs. */ - g_assert(IElementCount); - if (I>=GenericTable->ElementCount) - return NULL; - - table_info=GenericTable_to_table_info(GenericTable); - table_info_array_create(table_info); - return table_info->array[I]; -} - - -/** - * RtlNumberGenericTableElements: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * - * Count the elements of @GenericTable; - * - * Returns: Number of elements stored in @GenericTable. - */ -ULONG RtlNumberGenericTableElements(IN PRTL_GENERIC_TABLE GenericTable) -{ - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),0); - - return GenericTable->ElementCount; -} - - -/** - * RtlIsGenericTableEmpty: - * @GenericTable: Existing GenericTable initialized by RtlInitializeGenericTable(). - * %NULL value is forbidden. - * - * Check if the @GenericTable is empty. - * - * Returns: %TRUE iff 0==RtlNumberGenericTableElements(@GenericTable). - */ -BOOLEAN RtlIsGenericTableEmpty(IN PRTL_GENERIC_TABLE GenericTable) -{ - g_return_val_if_fail(TRUE==validate_GenericTable(GenericTable),TRUE); - - return !GenericTable->ElementCount; -} - - -#if 0 /* AVL structure not yet implemented */ -VOID RtlInitializeGenericTableAvl(PRTL_AVL_TABLE AvlTable,PRTL_AVL_COMPARE_ROUTINE CompareRoutine, - PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine,PRTL_AVL_FREE_ROUTINE FreeRoutine,PVOID UserParameter); -PVOID RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE AvlTable,PVOID Element,ULONG ElementSize,PBOOLEAN NewElement OPTIONAL); -PVOID RtlInsertElementGenericTableFullAvl(PRTL_AVL_TABLE AvlTable, - PVOID Element,ULONG ElementSize,PBOOLEAN NewElement OPTIONAL,PVOID NodeOrParent,TABLE_SEARCH_RESULT SearchResult); -BOOLEAN RtlDeleteElementGenericTableAvl(PRTL_AVL_TABLE AvlTable,PVOID Element); -PVOID RtlLookupElementGenericTableAvl(PRTL_AVL_TABLE AvlTable,PVOID Element); -PVOID RtlLookupElementGenericTableFullAvl(PRTL_AVL_TABLE AvlTable, - PVOID Element,OUT PVOID *NodeOrParent,OUT TABLE_SEARCH_RESULT *SearchResult); -PVOID RtlEnumerateGenericTableAvl(PRTL_AVL_TABLE AvlTable,BOOLEAN Restart); -PVOID RtlEnumerateGenericTableWithoutSplayingAvl(PRTL_AVL_TABLE AvlTable,PVOID *RestartKey); -PVOID RtlGetElementGenericTableAvl(PRTL_AVL_TABLE AvlTable,ULONG I); -ULONG RtlNumberGenericTableElementsAvl(PRTL_AVL_TABLE AvlTable); -BOOLEAN RtlIsGenericTableEmptyAvl(PRTL_AVL_TABLE AvlTable); -#endif /* 0 */ diff --git a/src/libcaptive/rtl/mem.c b/src/libcaptive/rtl/mem.c deleted file mode 100644 index 150f71d..0000000 --- a/src/libcaptive/rtl/mem.c +++ /dev/null @@ -1,85 +0,0 @@ -/* $Id$ - * reactos memory user/kernel memory handling functions emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/internal/safe.h" /* self */ -#include -#include -#include "reactos/ddk/status.h" - - -/** - * MmCopyFromCaller: - * @Dest: Destination memory area address. - * %NULL value is forbidden. - * @Src: Source memory area address. - * %NULL value is forbidden. - * @NumberOfBytes: Length of memory area. - * - * This function moves the data between two memory areas. - * Given memory areas must not overlap. - * libcaptive does not differentiate between user and kernel memory - this functions - * implements the simple memcpy() function. - * - * Returns: %STATUS_SUCCESS if the memory was copied successfuly. - */ -NTSTATUS MmCopyFromCaller(PVOID Dest,const VOID *Src,ULONG NumberOfBytes) -{ - g_return_val_if_fail(Dest!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Dest+NumberOfBytes>=Dest,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Src!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Src+NumberOfBytes>=Src,STATUS_INVALID_PARAMETER); - /* do not overlap: */ - g_return_val_if_fail((Dest+NumberOfBytes<=Src || Dest>=Src+NumberOfBytes),STATUS_INVALID_PARAMETER); - - memcpy(Dest,Src,NumberOfBytes); - - return STATUS_SUCCESS; -} - - -/** - * MmCopyToCaller: - * @Dest: Destination memory area address. - * %NULL value is forbidden. - * @Src: Source memory area address. - * %NULL value is forbidden. - * @NumberOfBytes: Length of memory area. - * - * This function moves the data between two memory areas. - * Given memory areas must not overlap. - * libcaptive does not differentiate between user and kernel memory - this functions - * implements the simple memcpy() function. - * - * Returns: %STATUS_SUCCESS if the memory was copied successfuly. - */ -NTSTATUS MmCopyToCaller(PVOID Dest,const VOID *Src,ULONG NumberOfBytes) -{ - g_return_val_if_fail(Dest!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Dest+NumberOfBytes>=Dest,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Src!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Src+NumberOfBytes>=Src,STATUS_INVALID_PARAMETER); - /* do not overlap: */ - g_return_val_if_fail((Dest+NumberOfBytes<=Src || Dest>=Src+NumberOfBytes),STATUS_INVALID_PARAMETER); - - memcpy(Dest,Src,NumberOfBytes); - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/rtl/memcpy.c b/src/libcaptive/rtl/memcpy.c deleted file mode 100644 index 330888d..0000000 --- a/src/libcaptive/rtl/memcpy.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * captive_reactos_memcpy() for reactos wrapper of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/rtl.h" /* self */ -#include -#include - - -/** - * captive_reactos_memcpy: - * @to: Target memory area. - * %NULL value is forbidden. - * @from: Source memory area. - * %NULL value is forbidden. - * @count: Length of the area. - * Value %0 is permitted (NOP in such case). - * - * Simple wrapper around system memcpy() to prevent possible declaration conflicts. - * - * Returns: The same pointer @to as received. - */ -void *captive_reactos_memcpy(void *to,const void *from, size_t count) -{ -void *r; - - g_return_val_if_fail(to!=NULL,NULL); - g_return_val_if_fail(from!=NULL,NULL); - - r=memcpy(to,from,count); - g_assert(r==to); - - return r; -} diff --git a/src/libcaptive/rtl/memmove.c b/src/libcaptive/rtl/memmove.c deleted file mode 100644 index 827a5ae..0000000 --- a/src/libcaptive/rtl/memmove.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * captive_reactos_memmove() for reactos wrapper of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/rtl.h" /* self */ -#include -#include - - -/** - * captive_reactos_memmove: - * @dest: Target memory area. - * %NULL value is forbidden. - * @src: Source memory area. - * %NULL value is forbidden. - * @count: Length of the area. - * Value %0 is permitted (NOP in such case). - * - * Simple wrapper around system memmove() to prevent possible declaration conflicts. - * - * Returns: The same pointer @dest as received. - */ -void *captive_reactos_memmove(void *dest,const void *src, size_t count) -{ -void *r; - - g_return_val_if_fail(dest!=NULL,NULL); - g_return_val_if_fail(src!=NULL,NULL); - - r=memmove(dest,src,count); - g_assert(r==dest); - - return r; -} diff --git a/src/libcaptive/rtl/memset.c b/src/libcaptive/rtl/memset.c deleted file mode 100644 index b48be23..0000000 --- a/src/libcaptive/rtl/memset.c +++ /dev/null @@ -1,49 +0,0 @@ -/* $Id$ - * captive_reactos_memset() for reactos wrapper of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/rtl.h" /* self */ -#include -#include - - -/** - * captive_reactos_memset: - * @src: Memory area to fill. - * %NULL value is forbidden. - * @val: #guint8 byte value to fill the area by. - * @count: Length of the area. - * Value %0 is permitted (NOP in such case). - * - * Simple wrapper around system memset() to prevent possible declaration conflicts. - * - * Returns: The same pointer @src as received. - */ -void *captive_reactos_memset(void *src, int val, size_t count) -{ -void *r; - - g_return_val_if_fail(src!=NULL,NULL); - - r=memset(src,val,count); - g_assert(r==src); - - return r; -} diff --git a/src/libcaptive/rtl/splaylinks.c b/src/libcaptive/rtl/splaylinks.c deleted file mode 100644 index 8fb288f..0000000 --- a/src/libcaptive/rtl/splaylinks.c +++ /dev/null @@ -1,83 +0,0 @@ -/* $Id$ - * Implementation of RTL_SPLAY_LINKS functions of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/rtltypes.h" /* self */ -#include - - -/** - * RtlDelete: - * @Links: Node to delete. - * %NULL value is forbidden. - * - * Deletes the given node from its tree. - * - * Returns: New root of the given tree. It may be %NULL if the tree becomes empty. - */ -PRTL_SPLAY_LINKS RtlDelete(PRTL_SPLAY_LINKS Links) -{ -RTL_SPLAY_LINKS *root,**selfp; - - g_return_val_if_fail(Links!=NULL,NULL); - - for (root=Links;root->Parent!=root;) { - g_assert(root->Parent!=NULL); - root=root->Parent; - } - if (root==Links) - selfp=&root; - else if (Links->Parent->LeftChild==Links) - selfp=&Links->Parent->LeftChild; - else if (Links->Parent->RightChild==Links) - selfp=&Links->Parent->RightChild; - else g_assert_not_reached(); /* should not happen if the structures are valid */ - - if (!Links->LeftChild) - *selfp=Links->RightChild; - else if (!Links->RightChild) - *selfp=Links->LeftChild; - else g_assert_not_reached(); /* FIXME: NOT IMPLEMENTED YET */ - - /* FIXME: rebalance: NOT IMPLEMENTED YET */ - - return root; -} - - -/** - * RtlSplay: - * @Links: Root of the tree to rebalance. - * %NULL value is forbidden. - * - * Rebalances the tree for optimal heights and effective operations. - * FIXME: Currently a NOP in libcaptive. - * - * Returns: New root of the rebalanced tree. - * It may or it may not be equal to the given @Links. - */ -PRTL_SPLAY_LINKS RtlSplay(PRTL_SPLAY_LINKS Links) -{ - g_return_val_if_fail(Links!=NULL,NULL); - - /* FIXME: rebalance: NOT IMPLEMENTED YET */ - - return Links; -} diff --git a/src/libcaptive/rtl/string.c b/src/libcaptive/rtl/string.c deleted file mode 100644 index a776b4e..0000000 --- a/src/libcaptive/rtl/string.c +++ /dev/null @@ -1,106 +0,0 @@ -/* $Id$ - * captive_reactos_str*() for reactos wrappers of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ntos/rtl.h" /* self */ -#include -#include - - -/** - * captive_reactos_strchr: - * @s: 0-terminated string to search @c in. - * %NULL value is forbidden. - * @c: #guint8 byte to search for in @s. - * - * Simple wrapper around system strchr() to prevent possible declaration conflicts. - * - * Returns: Pointer to the found @c in @s or %NULL if not found. - */ -char *captive_reactos_strchr(const char *s, int c) -{ - g_return_val_if_fail(s!=NULL,NULL); - - return strchr(s,c); -} - - -/** - * captive_reactos_strcmp: - * @s1: 0-terminated first string to compare. - * %NULL value is forbidden. - * @s2: 0-terminated second string to compare. - * %NULL value is forbidden. - * - * Simple wrapper around system strcmp() to prevent possible declaration conflicts. - * - * Returns: integer less than, equal to, or greater than zero if @s1 (or the - * first n bytes thereof) is found, respectively, to be less than, to match, or - * be greater than @s2. - */ -int captive_reactos_strcmp(const char *s1, const char *s2) -{ - g_return_val_if_fail(s1!=NULL,0); - g_return_val_if_fail(s2!=NULL,0); - - return strcmp(s1,s2); -} - - -/** - * captive_reactos_strcpy: - * @to: Target memory to copy @from to. - * %NULL value is forbidden. - * @s2: 0-terminated string to copy to @to. - * %NULL value is forbidden. - * - * Simple wrapper around system strcpy() to prevent possible declaration conflicts. - * - * Returns: The same pointer @to as received. - */ -char *captive_reactos_strcpy(char *to, const char *from) -{ -char *r; - - g_return_val_if_fail(to!=NULL,NULL); - g_return_val_if_fail(from!=NULL,NULL); - - r=strcpy(to,from); - g_assert(r==to); - - return r; -} - - -/** - * captive_reactos_strlen: - * @str: 0-terminated string to measure its length. - * %NULL value is forbidden. - * - * Simple wrapper around system strlen() to prevent possible declaration conflicts. - * - * Returns: Number of characters in @str. - */ -size_t captive_reactos_strlen(const char *str) -{ - g_return_val_if_fail(str!=NULL,0); - - return strlen(str); -} diff --git a/src/libcaptive/rtl/unicode.c b/src/libcaptive/rtl/unicode.c deleted file mode 100644 index 3198002..0000000 --- a/src/libcaptive/rtl/unicode.c +++ /dev/null @@ -1,681 +0,0 @@ -/* $Id$ - * Unicode add-ons to reactos ntoskrnl/rtl/unicode.c for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/unicode.h" /* self */ -#include "captive/unicode_reactos.h" /* for captive_ucs2 */ -#include -#include -#include -#include -#include "reactos/napi/types.h" /* for PUNICODE_STRING etc. */ -#include "reactos/unicode.h" -#include "captive/macros.h" -#include -#include /* for wcslen() */ -#include -#include - - -/* CONFIG: */ -/* Use simplified g_malloc() functions as wrappers around g_alloca() ones. - */ -#define FUNCMALLOC_FROM_ALLOCA 1 - - -/* compiler sanity */ -static gboolean captive_validate_unicode_types(void) -{ - g_return_val_if_fail(4==sizeof(gunichar),FALSE); - g_return_val_if_fail(2==sizeof(WCHAR),FALSE); - g_return_val_if_fail(1==sizeof(CHAR),FALSE); - - return TRUE; -} - - -/** - * captive_validate_ucs4: - * @string_ucs4: #const #gunichar * type string to validate. - * Invalid string input is forbidden. - * - * Checks the validity of all 32-bit unicharacters of 0-terminated string. - * It is required to have characters complying to g_unichar_validate(). - * - * Returns: %TRUE if the string is valid. - */ -gboolean captive_validate_ucs4(const gunichar *string_ucs4) -{ -const gunichar *cs_ucs4; - - g_return_val_if_fail(captive_validate_unicode_types(),FALSE); - g_return_val_if_fail(string_ucs4!=NULL,FALSE); - - for (cs_ucs4=string_ucs4;*cs_ucs4;cs_ucs4++) - g_return_val_if_fail(g_unichar_validate(*cs_ucs4),FALSE); - - return TRUE; -} - - -/** - * captive_validate_ucs2_fixlen: - * @string_ucs2: #const #captive_ucs2 * type string to validate. - * Invalid string input is forbidden. - * UTF-16 encoded strings are forbidden. - * @string_ucs2_fixlen: Number of characters from @string_ucs2 to check. - * captive_ucs2_strlen(@string_ucs2)>=@string_ucs2_fixlen is required. - * Negative value is forbidden. - * - * Checks the validity of first @string_ucs2_fixlen 16-bit unicharacters of @string_ucs2. - * It is required to have characters complying to g_unichar_validate(). - * String length must be equal or larger than @string_ucs2_fixlen; - * - * Returns: %TRUE if the string is valid. - */ -gboolean captive_validate_ucs2_fixlen(const captive_ucs2 *string_ucs2,glong string_ucs2_fixlen) -{ -const captive_ucs2 *cs_ucs2; - - g_return_val_if_fail(captive_validate_unicode_types(),FALSE); - g_return_val_if_fail(string_ucs2!=NULL,FALSE); - g_return_val_if_fail(string_ucs2_fixlen>=0,FALSE); - - /* g_unichar_validate() will reject surrogates (G_UNICODE_SURROGATE) */ - for (cs_ucs2=string_ucs2;cs_ucs2Buffer),FALSE); - g_return_val_if_fail(string_UnicodeString!=NULL,FALSE); - g_return_val_if_fail(string_UnicodeString->Length%sizeof(*string_UnicodeString->Buffer)==0,FALSE); - g_return_val_if_fail(string_UnicodeString->MaximumLength - >=string_UnicodeString->Length+sizeof(*string_UnicodeString->Buffer),FALSE); - g_return_val_if_fail(string_UnicodeString->Length==sizeof(*string_UnicodeString->Buffer)* - captive_ucs2_strlen(string_UnicodeString->Buffer) - ,FALSE); - - g_return_val_if_fail(captive_validate_ucs2(string_UnicodeString->Buffer),FALSE); - - return TRUE; -} - - -/** - * captive_validate_UnicodeString_noterm: - * @string_UnicodeString_noterm: #PUNICODE_STRING type string to validate. - * Invalid string input is forbidden. - * - * Checks the internal consistency of the given @string_UnicodeString. - * It is required to have characters complying to g_unichar_validate(). - * @string_UnicodeString_noterm does not neet to be zero-terminated. - * - * Returns: %TRUE if the string is valid. - */ -gboolean captive_validate_UnicodeString_noterm(const UNICODE_STRING *string_UnicodeString_noterm) -{ -const WCHAR *cwp; - - g_return_val_if_fail(captive_validate_unicode_types(),FALSE); - g_return_val_if_fail(sizeof(WCHAR)==sizeof(*string_UnicodeString_noterm->Buffer),FALSE); - g_return_val_if_fail(string_UnicodeString_noterm!=NULL,FALSE); - g_return_val_if_fail(string_UnicodeString_noterm->Length%sizeof(*string_UnicodeString_noterm->Buffer)==0,FALSE); - g_return_val_if_fail(string_UnicodeString_noterm->MaximumLength>=string_UnicodeString_noterm->Length,FALSE); - - for ( - cwp=string_UnicodeString_noterm->Buffer; - cwpBuffer - +(string_UnicodeString_noterm->Length/sizeof(*string_UnicodeString_noterm->Buffer)); - cwp++) - g_return_val_if_fail(*cwp!=0,FALSE); - - g_return_val_if_fail(captive_validate_ucs2_fixlen(string_UnicodeString_noterm->Buffer, - string_UnicodeString_noterm->Length/sizeof(*string_UnicodeString_noterm->Buffer)), - FALSE); - - return TRUE; -} - - -/** - * captive_validate_AnsiString: - * @string_AnsiString: #PANSI_STRING type string to validate. - * Invalid string input is forbidden. - * - * Checks the internal consistency of the given @string_AnsiString. - * - * Returns: %TRUE if the string is valid. - */ -gboolean captive_validate_AnsiString(const ANSI_STRING *string_AnsiString) -{ - g_return_val_if_fail(captive_validate_unicode_types(),FALSE); - g_return_val_if_fail(sizeof(CHAR)==sizeof(*string_AnsiString->Buffer),FALSE); - g_return_val_if_fail(string_AnsiString!=NULL,FALSE); - g_return_val_if_fail(string_AnsiString->MaximumLength>=string_AnsiString->Length+1,FALSE); - g_return_val_if_fail(string_AnsiString->Length==strlen(string_AnsiString->Buffer),FALSE); - - return TRUE; -} - - -/** - * captive_ucs2_compare: - * @string_a_ucs2: First string of type #const #gunichar2 * in pure UCS-2. - * Invalid string input is forbidden. UTF-16 encoded pairs are forbidden. - * @string_b_ucs2: Second string of type #const #gunichar2 * in pure UCS-2. - * Invalid string input is forbidden. UTF-16 encoded pairs are forbidden. - * - * Compares case-sensitively @string_a_ucs2 and @string_b_ucs2. - * - * Returns: %TRUE if @string_a_ucs2 and @string_b_ucs2 are the same. - */ -gboolean captive_ucs2_compare(const captive_ucs2 *string_a_ucs2,const captive_ucs2 *string_b_ucs2) -{ -guint ui; - - g_return_val_if_fail(captive_validate_ucs2(string_a_ucs2),FALSE); - g_return_val_if_fail(captive_validate_ucs2(string_b_ucs2),FALSE); - - ui=0; - do { - if (string_a_ucs2[ui]!=string_b_ucs2[ui]) - return FALSE; - } while (string_a_ucs2[ui++]); - return TRUE; -} - - -/** - * captive_UnicodeString_compare: - * @string_a_UnicodeString: First string of type #PUNICODE_STRING. - * Invalid string input is forbidden. - * @string_b_UnicodeString: Second string of type #PUNICODE_STRING. - * Invalid string input is forbidden. - * - * Compares case-sensitively @string_a_UnicodeString and @string_b_UnicodeString. - * - * Returns: %TRUE if @string_a_UnicodeString and @string_b_UnicodeString are the same. - */ -gboolean captive_UnicodeString_compare - (const UNICODE_STRING *string_a_UnicodeString,const UNICODE_STRING *string_b_UnicodeString) -{ - g_return_val_if_fail(captive_validate_UnicodeString(string_a_UnicodeString),FALSE); - g_return_val_if_fail(captive_validate_UnicodeString(string_b_UnicodeString),FALSE); - - if (string_a_UnicodeString->Length!=string_b_UnicodeString->Length) - return FALSE; - return captive_ucs2_compare(string_a_UnicodeString->Buffer,string_b_UnicodeString->Buffer); -} - - -/** - * captive_ucs2_compare_insensitive: - * @string_a_ucs2: First string of type #const #gunichar2 * in pure UCS-2. - * Invalid string input is forbidden. UTF-16 encoded pairs are forbidden. - * @string_b_ucs2: Second string of type #const #gunichar2 * in pure UCS-2. - * Invalid string input is forbidden. UTF-16 encoded pairs are forbidden. - * - * Compares case-insensitively @string_a_ucs2 and @string_b_ucs2. - * - * Returns: %TRUE if @string_a_ucs2 and @string_b_ucs2 are the same. - */ -gboolean captive_ucs2_compare_insensitive(const captive_ucs2 *string_a_ucs2,const captive_ucs2 *string_b_ucs2) -{ -guint ui; - - g_return_val_if_fail(captive_validate_ucs2(string_a_ucs2),FALSE); - g_return_val_if_fail(captive_validate_ucs2(string_b_ucs2),FALSE); - - ui=0; - do { - if (g_unichar_toupper(string_a_ucs2[ui])!=g_unichar_toupper(string_b_ucs2[ui])) - return FALSE; - } while (string_a_ucs2[ui++]); - return TRUE; -} - - -/** - * captive_UnicodeString_compare_insensitive: - * @string_a_UnicodeString: First string of type #PUNICODE_STRING. - * Invalid string input is forbidden. - * @string_b_UnicodeString: Second string of type #PUNICODE_STRING. - * Invalid string input is forbidden. - * - * Compares case-insensitively @string_a_UnicodeString and @string_b_UnicodeString. - * - * Returns: %TRUE if @string_a_UnicodeString and @string_b_UnicodeString are the same. - */ -gboolean captive_UnicodeString_compare_insensitive - (const UNICODE_STRING *string_a_UnicodeString,const UNICODE_STRING *string_b_UnicodeString) -{ - g_return_val_if_fail(captive_validate_UnicodeString(string_a_UnicodeString),FALSE); - g_return_val_if_fail(captive_validate_UnicodeString(string_b_UnicodeString),FALSE); - - if (string_a_UnicodeString->Length!=string_b_UnicodeString->Length) - return FALSE; - return captive_ucs2_compare_insensitive(string_a_UnicodeString->Buffer,string_b_UnicodeString->Buffer); -} - - -/* detect required memory size for g_alloca() */ -size_t _captive_UnicodeString_to_utf8_alloca_internal_sizeof(const UNICODE_STRING *string_UnicodeString) -{ -glong length; -size_t r; -const WCHAR *cwcharp; - - g_return_val_if_fail(captive_validate_UnicodeString(string_UnicodeString),1); - - /* measure 'string_UnicodeString->Buffer' length in UTF-8 to 'r' */ - cwcharp=string_UnicodeString->Buffer; - r=0; - for (length=string_UnicodeString->Length/sizeof(*string_UnicodeString->Buffer);length;length--) { -gint utf8len; - - utf8len=g_unichar_to_utf8( - *cwcharp++, /* c */ - NULL); /* outbuf=NULL => just the length will be computed */ - g_assert(utf8len>=0); - r+=utf8len; - } - g_assert(*cwcharp==0); - r++; /* '\0'-termination */ - - /* utf8 byte-size */ - return r; -} - -/* transfer 'string_UnicodeString' to memory in 'mem' as utf8 w/o any further allocations */ -void _captive_UnicodeString_to_utf8_alloca_internal_fill(gchar *mem,const UNICODE_STRING *string_UnicodeString) -{ -const WCHAR *cwcharp; -#ifndef G_DISABLE_ASSERT -gchar *mem_orig=mem; -#endif /* G_DISABLE_ASSERT */ - - g_return_if_fail(mem!=NULL); - if (!captive_validate_UnicodeString(string_UnicodeString)) { - *mem='\0'; - g_return_if_reached(); - } - - /* We can't use any glib string conversions as UNICODE_STRING uses ucs2! */ - /* We can't use any glib string conversions as we need to write the string - * to our supplied memory storage but glib always g_malloc()s it - */ - /* copy 'string_UnicodeString->Buffer' to 'mem' */ - for (cwcharp=string_UnicodeString->Buffer;*cwcharp;cwcharp++) { -gint utf8len; - - utf8len=g_unichar_to_utf8( - (gunichar)*cwcharp, /* c */ - mem); /* outbuf */ - g_assert(utf8len>=0); - mem+=utf8len; - } - *mem='\0'; - - g_assert((size_t)((mem+1)-mem_orig) == _captive_UnicodeString_to_utf8_alloca_internal_sizeof(string_UnicodeString)); - g_assert(captive_validate_utf8(mem_orig)); -} - - -/** - * captive_UnicodeString_to_utf8_malloc: - * @string_UnicodeString: #PUNICODE_STRING type of string to convert. - * - * g_malloc()-based conversion from #PUNICODE_STRING to plain #utf8 string. - * You must free the result with g_free() function. - * - * Returns: #const #gchar * g_malloc()ed converted string @string_UnicodeString. - */ -gchar *captive_UnicodeString_to_utf8_malloc(const UNICODE_STRING *string_UnicodeString) -{ -gchar *r; -#ifndef FUNCMALLOC_FROM_ALLOCA -glong utf16_read,utf8_written; -GError *err; -#endif /* !FUNCMALLOC_FROM_ALLOCA */ - - g_return_val_if_fail(captive_validate_UnicodeString(string_UnicodeString),g_strdup("")); - -#ifdef FUNCMALLOC_FROM_ALLOCA - - r=g_malloc(_captive_UnicodeString_to_utf8_alloca_internal_sizeof(string_UnicodeString)); - _captive_UnicodeString_to_utf8_alloca_internal_fill(r,string_UnicodeString); - -#else - - err=NULL; /* not precleared by g_utf8_to_utf16()! */ - r=g_utf16_to_utf8( - (const gunichar2 *)string_UnicodeString->Buffer, /* str */ - -1, /* len=>'\0'-terminated */ - &utf16_read, /* items_read; counted in unichar2 (NOT UTF-16 characters or bytes!) */ - &utf8_written, /* items_written; counted in bytes (NOT UTF-8 characters!) */ - &err); - if (err) { - g_warning("%s: utf16_read=%ld,utf8_written=%ld: %s",G_STRLOC, - (long)utf16_read,(long)utf8_written,err->message); - g_error_free(err); - g_assert(r==NULL); - g_return_val_if_reached(g_strdup("")); - } - g_assert(r!=NULL); - - g_assert(utf16_read==(glong)(string_UnicodeString->length/sizeof(*string_UnicodeString->Buffer))); - g_assert(utf6_written==strlen(r)); - -#endif /* !FUNCMALLOC_FROM_ALLOCA */ - - g_assert(captive_validate_utf8(r)); - - return r; -} - - -/* detect required memory size for g_alloca() */ -size_t _captive_utf8_to_UnicodeString_alloca_internal_sizeof(const gchar *string_utf8) -{ - g_return_val_if_fail(captive_validate_utf8(string_utf8),1); - - /* find the value for PUNICODE_STRING->MaximumLength */ - return 0 - +sizeof(UNICODE_STRING) - +sizeof(WCHAR)*(g_utf8_strlen(string_utf8, - -1 /* max; -1 means '\0'-terminated */ - )+1); /* '\0'-termination */ -} - -static void terminate_static_UnicodeString(UNICODE_STRING *string_UnicodeString,glong length) -{ - /* 'string_UnicodeString' is not yet valid in this point! */ - g_return_if_fail(string_UnicodeString!=NULL); - g_return_if_fail(length>=0); - - string_UnicodeString->Length=length*sizeof(WCHAR); - string_UnicodeString->MaximumLength=(length+1)*sizeof(WCHAR); - string_UnicodeString->Buffer[length]=0; - - g_assert(captive_validate_UnicodeString(string_UnicodeString)); -} - -/* transfer 'string_UnicodeString' to memory in 'mem' w/o any further allocations */ -void _captive_utf8_to_UnicodeString_alloca_internal_fill(UNICODE_STRING *mem,const gchar *string_utf8) -{ -gunichar2 *utf16; -captive_ucs2 *ucs2; -glong utf8_read,utf16_written; -GError *err; - - g_return_if_fail(mem!=NULL); - mem->Buffer=(PWSTR)(((char *)mem)+sizeof(*mem)); /* for terminate_static_UnicodeString() below */ - if (!captive_validate_utf8(string_utf8)) { - terminate_static_UnicodeString(mem,0); - g_return_if_reached(); - } - - err=NULL; /* not precleared by g_utf8_to_utf16()! */ - utf16=g_utf8_to_utf16( - string_utf8, /* str */ - -1, /* len=>'\0'-terminated */ - &utf8_read, /* items_read; counted in bytes (NOT chars!) */ - &utf16_written, /* items_written; counted in UTF-16 characters (NOT unichar2 or bytes!) */ - &err); - if (err) { - g_warning("%s: utf8_read=%ld,utf16_written=%ld: %s",G_STRLOC, - (long)utf8_read,(long)utf16_written,err->message); - g_error_free(err); - g_assert(utf16==NULL); - terminate_static_UnicodeString(mem,0); - g_return_if_reached(); - } - g_assert(utf16!=NULL); - - /* Check for UCS-2 compliance (reject if surrogates inside) */ - g_assert(captive_validate_ucs2((const captive_ucs2 *)utf16)); - /* valid UCS-2 */ - ucs2=(captive_ucs2 *)utf16; - - g_assert(utf8_read==(glong)strlen(string_utf8)); - g_assert(utf16_written==captive_ucs2_strlen(ucs2)); - - /* check of validity of _captive_utf8_to_UnicodeString_alloca_internal_sizeof() result */ - g_assert((gchar *)(mem->Buffer+(utf16_written+1)) /* +1 => '\0'-termination */ - == ((gchar *)mem)+_captive_utf8_to_UnicodeString_alloca_internal_sizeof(string_utf8)); - - memcpy(mem->Buffer,ucs2,sizeof(WCHAR)*(utf16_written+1)); - g_free(ucs2); - terminate_static_UnicodeString(mem,utf16_written); - - g_assert(captive_validate_UnicodeString(mem)); -} - - -/** - * captive_utf8_to_UnicodeString_malloc: - * @string_utf8: #const #gchar * string in #utf8 to convert. - * - * g_malloc()-based conversion from plain #utf8 string to #PUNICODE_STRING. - * You must free the result with g_free() function. - * - * Returns: #PUNICODE_STRING g_malloc()ed converted string @string_utf8. - */ -PUNICODE_STRING captive_utf8_to_UnicodeString_malloc(const gchar *string_utf8) -{ -UNICODE_STRING *r; -#ifndef FUNCMALLOC_FROM_ALLOCA -gunichar *ucs4; -glong utf8_read,ucs4_written; -GError *err; -#endif /* !FUNCMALLOC_FROM_ALLOCA */ - - g_return_val_if_fail(captive_validate_utf8(string_utf8),captive_utf8_to_UnicodeString_malloc("")); - -#ifdef FUNCMALLOC_FROM_ALLOCA - - r=g_malloc(_captive_utf8_to_UnicodeString_alloca_internal_sizeof(string_utf8)); - _captive_utf8_to_UnicodeString_alloca_internal_fill(r,string_utf8); - -#else - -#error "FIXME: NOT IMPLEMENTED" - -#endif /* !FUNCMALLOC_FROM_ALLOCA */ - - g_assert(captive_validate_UnicodeString(r)); - - return r; -} - - -/* map: (const gunichar *) -> (const gunichar2 *); UCS-4 -> UTF-16 */ -static GHashTable *captive_ucs4_to_utf16_hash; - -static void captive_ucs4_to_utf16_hash_init(void) -{ - if (captive_ucs4_to_utf16_hash) - return; - captive_ucs4_to_utf16_hash=g_hash_table_new_full( - g_direct_hash, /* hash_func */ - g_direct_equal, /* key_equal_func */ - (GDestroyNotify)NULL, /* key_destroy_func; we require persistent strings as input */ - (GDestroyNotify)g_free); /* value_destroy_func; result of g_ucs4_to_utf16() */ -} - -/** - * captive_ucs4_to_utf16_const: - * @string_ucs4: #const #gunichar * type of persistent string to convert. - * This string MUST remain readable with the same content forever. - * - * Constant string conversion from 32-bit #wchar_t to 16-bit (possible pairs of) UTF-16. - * You may not modify the result in any way. - * - * It is guaranteed to get two different string addresses for two different - * input addresses even if the input strings content is the same. - * Otherwise we would behave as #GCC option %-fmerge-constants which - * results in %C non-conforming behaviour. - * - * FIXME: UTF-16 encoding IS NOT IMPLEMENTED. - * - * See also captive_ucs4_to_ucs2_const(). - * - * Returns: #const #gunichar2 * converted string @string_ucs4. - */ -const gunichar2 *captive_ucs4_to_utf16_const(const gunichar *string_ucs4) -{ -glong ucs4_read,utf16_written; -GError *err; -const gunichar2 *r_lookup; -gunichar2 *r; - - g_return_val_if_fail(captive_validate_ucs4(string_ucs4),captive_ucs4_to_utf16_const((const gunichar *)L"")); - - captive_ucs4_to_utf16_hash_init(); - - /* found already existing item in the table */ - if ((r_lookup=g_hash_table_lookup(captive_ucs4_to_utf16_hash, - string_ucs4) /* key */ - )) { - return r_lookup; - } - - /* Prepare 'r' as UTF-16 */ - err=NULL; /* not precleared by g_ucs4_to_utf16()! */ - r=g_ucs4_to_utf16( - (const gunichar *)string_ucs4, /* str */ - -1, /* len; -1 means '\0'-termination */ - &ucs4_read, /* items_read; counted in chars (==unichars; NOT bytes!) */ - &utf16_written, /* items_written; counted in gunichar2 (NOT chars or bytes!) */ - &err); - if (err) { - g_warning("%s: ucs4_read=%ld,utf16_written=%ld: %s",G_STRLOC, - (long)ucs4_read,(long)utf16_written,err->message); - g_error_free(err); - g_assert(r==NULL); - g_return_val_if_reached(captive_ucs4_to_utf16_const((const gunichar *)L"")); - } - g_assert(r!=NULL); - g_assert(ucs4_read==(glong)wcslen((const wchar_t *)string_ucs4)); - /* FIXME: We don't have captive_utf16_strlen() */ - g_assert(utf16_written==(glong)captive_ucs2_strlen((const gunichar2 *)r)); - /* (ucs4_read==utf16_written) check would discard any double-pair UTF-16 encodings - * but this function is designed as UTF-16 compliant. - */ - - /* store new item to the table */ - g_hash_table_insert(captive_ucs4_to_utf16_hash, - (gpointer)string_ucs4, /* key; de-const */ - r); /* value */ - -#if 0 /* We don't have captive_validate_utf16() */ - g_assert(captive_validate_utf16(r)); -#endif - - return r; -} diff --git a/src/libcaptive/rtl/unicode_reactos.c b/src/libcaptive/rtl/unicode_reactos.c deleted file mode 100644 index bfef593..0000000 --- a/src/libcaptive/rtl/unicode_reactos.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id$ - * Unicode support used also for reactos files for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/unicode_reactos.h" /* self */ -#include "captive/unicode.h" -#include -#include - - -/** - * captive_ucs4_to_ucs2_const: - * @string_ucs4: #const #gunichar * type of persistent string to convert. - * This string MUST remain readable with the same content forever. - * This string MUST be convertible to UCS-2 string. - * - * Constant string conversion from 32-bit #wchar_t to 16-bit #wchar_t. - * You may not modify the result in any way. - * - * It is guaranteed to get two different string addresses for two different - * input addresses even if the input strings content is the same. - * Otherwise we would behave as #GCC option %-fmerge-constants which - * results in %C non-conforming behaviour. - * - * Returns: #const #captive_ucs2 * converted string @string_ucs4. - */ -const captive_ucs2 *captive_ucs4_to_ucs2_const(const gunichar *string_ucs4) -{ -const captive_ucs2 *r; - - g_return_val_if_fail(captive_validate_ucs4(string_ucs4),captive_ucs4_to_ucs2_const((const gunichar *)L"")); - - r=(const captive_ucs2 *)captive_ucs4_to_utf16_const(string_ucs4); - - /* Here we can bail out on non-UCS-2 compliant UTF-16 string */ - g_return_val_if_fail(captive_validate_ucs2(r),captive_ucs4_to_ucs2_const((const gunichar *)L"")); - - return r; -} diff --git a/src/libcaptive/rtl/version.c b/src/libcaptive/rtl/version.c deleted file mode 100644 index ca432d7..0000000 --- a/src/libcaptive/rtl/version.c +++ /dev/null @@ -1,89 +0,0 @@ -/* $Id$ - * Internal (rtl/) reactos versioning functions of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -/* no include file for RtlGetVersion() in reactos */ -#include -#include "reactos/ntos/types.h" -#include "reactos/ddk/status.h" -#include "captive/macros.h" - - -typedef struct _OSVERSIONINFOW { - ULONG dwOSVersionInfoSize; - ULONG dwMajorVersion; - ULONG dwMinorVersion; - ULONG dwBuildNumber; - ULONG dwPlatformId; - WCHAR szCSDVersion[128]; - } RTL_OSVERSIONINFOW,*PRTL_OSVERSIONINFOW; - -typedef struct _OSVERSIONINFOEXW { /* sizeof==284 */ - ULONG dwOSVersionInfoSize; - ULONG dwMajorVersion; - ULONG dwMinorVersion; - ULONG dwBuildNumber; - ULONG dwPlatformId; - WCHAR szCSDVersion[128]; - USHORT wServicePackMajor; - USHORT wServicePackMinor; - USHORT wSuiteMask; - UCHAR wProductType; - UCHAR wReserved; -} RTL_OSVERSIONINFOEXW,*PRTL_OSVERSIONINFOEXW; - - -/** - * RtlGetVersion: - * @lpVersionInformation: Returns system version information. - * - * Functions looks at field #dwOSVersionInfoSize of @lpVersionInformation - * containing sizeof() of the passed structure to autodetect what it should - * in fact fill in. - * libcaptive currently supports only #RTL_OSVERSIONINFOEXW. - * libcaptive returns version info corresponding to Microsoft Windows XP Service Pack 1. - * - * Returns: %STATUS_SUCCESS if @lpVersionInformation was filled successfuly. - */ -NTSTATUS RtlGetVersion(OUT PRTL_OSVERSIONINFOW lpVersionInformation) -{ - g_return_val_if_fail(lpVersionInformation!=NULL,STATUS_INVALID_PARAMETER); - - switch (lpVersionInformation->dwOSVersionInfoSize) { - case sizeof(RTL_OSVERSIONINFOEXW): { -RTL_OSVERSIONINFOEXW *verinfoexw=(RTL_OSVERSIONINFOEXW *)lpVersionInformation; - - verinfoexw->dwMajorVersion=5; /* NT-5.1 == Microsoft Windows XP */ - verinfoexw->dwMinorVersion=1; - verinfoexw->dwBuildNumber=2600; - verinfoexw->dwPlatformId=2; /* ==Wine::VER_PLATFORM_WIN32_NT */ - CAPTIVE_MEMZERO(verinfoexw->szCSDVersion); /* FIXME: should be L"Service Pack 1" ? */ - verinfoexw->wServicePackMajor=1; /* Wine uses 0 */ - verinfoexw->wServicePackMinor=0; - verinfoexw->wSuiteMask=0; - verinfoexw->wProductType=1; /* ==Wine::VER_NT_WORKSTATION, possible also VER_NT_DOMAIN_CONTROLLER or VER_NT_SERVER */ - verinfoexw->wReserved=0; - } break; - default: - g_assert_not_reached(); /* NOT YET IMPLEMENTED */ - } - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/sandbox/FileInfo.c b/src/libcaptive/sandbox/FileInfo.c deleted file mode 100644 index 1c5bb89..0000000 --- a/src/libcaptive/sandbox/FileInfo.c +++ /dev/null @@ -1,129 +0,0 @@ -/* $Id$ - * CORBA/ORBit server side of GnomeVFSFileInfo handling - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "FileInfo.h" /* self */ -#include - - -GnomeVFSResult captive_sandbox_file_info_corba_to_captive - (GnomeVFSFileInfo *file_info_captive,const Captive_GnomeVFSFileInfo *file_info_corba) -{ - g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info_corba!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - file_info_captive->valid_fields=0; - file_info_captive->name=g_strdup(file_info_corba->name); - if (file_info_corba->type_valid) { - file_info_captive->type=file_info_corba->type; - file_info_captive->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_TYPE; - } - if (file_info_corba->permissions_valid) { - file_info_captive->permissions=file_info_corba->permissions; - file_info_captive->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS; - } - if (file_info_corba->size_valid) { - file_info_captive->size=file_info_corba->size; - file_info_captive->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_SIZE; - } - if (file_info_corba->block_count_valid) { - file_info_captive->block_count=file_info_corba->block_count; - file_info_captive->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT; - } - if (file_info_corba->atime) { - file_info_captive->atime=file_info_corba->atime; - file_info_captive->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_ATIME; - } - if (file_info_corba->mtime) { - file_info_captive->mtime=file_info_corba->mtime; - file_info_captive->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_MTIME; - } - if (file_info_corba->ctime) { - file_info_captive->ctime=file_info_corba->ctime; - file_info_captive->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_CTIME; - } - if (file_info_corba->flags_valid) { - file_info_captive->flags=file_info_corba->flags; - file_info_captive->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_FLAGS; - } - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_file_info_captive_to_corba - (Captive_GnomeVFSFileInfo *file_info_corba,const GnomeVFSFileInfo *file_info_captive) -{ - g_return_val_if_fail(file_info_corba!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (!file_info_captive->name) - file_info_corba->name=CORBA_string_dup(""); - else - file_info_corba->name=CORBA_string_dup(file_info_captive->name); - if ((file_info_corba->type_valid=!!(file_info_captive->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_TYPE))) - file_info_corba->type=file_info_captive->type; - if ((file_info_corba->permissions_valid=!!(file_info_captive->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS))) - file_info_corba->permissions=file_info_captive->permissions; - if ((file_info_corba->size_valid=!!(file_info_captive->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_SIZE))) - file_info_corba->size=file_info_captive->size; - if ((file_info_corba->block_count_valid=!!(file_info_captive->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT))) - file_info_corba->block_count=file_info_captive->block_count; - file_info_corba->atime=(!(file_info_captive->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_ATIME) ? 0 : file_info_captive->atime); - file_info_corba->mtime=(!(file_info_captive->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_MTIME) ? 0 : file_info_captive->mtime); - file_info_corba->ctime=(!(file_info_captive->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_CTIME) ? 0 : file_info_captive->ctime); - if ((file_info_corba->flags_valid=!!(file_info_captive->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_FLAGS))) - file_info_corba->flags=file_info_captive->flags; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_file_info_set_mask_captive_to_corba - (Captive_GnomeVFSFileInfo *file_info_corba,const GnomeVFSFileInfo *file_info_captive,GnomeVFSSetFileInfoMask mask) -{ - g_return_val_if_fail(file_info_corba!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - /* uninitialized: file_info_corba->name */ - file_info_corba->type_valid=CORBA_FALSE; - file_info_corba->permissions_valid=CORBA_FALSE; - file_info_corba->size_valid=CORBA_FALSE; - file_info_corba->block_count_valid=CORBA_FALSE; - file_info_corba->atime=0; - file_info_corba->mtime=0; - file_info_corba->ctime=0; - file_info_corba->flags_valid=CORBA_FALSE; - - if (!(mask&GNOME_VFS_SET_FILE_INFO_NAME)) - file_info_corba->name=CORBA_string_dup(""); - else - file_info_corba->name=CORBA_string_dup(file_info_captive->name); - if ((file_info_corba->permissions_valid=!!(mask&GNOME_VFS_SET_FILE_INFO_PERMISSIONS))) - file_info_corba->permissions=file_info_captive->permissions; - /* Not implemented by libcaptive: GNOME_VFS_SET_FILE_INFO_OWNER */ - if (mask&GNOME_VFS_SET_FILE_INFO_TIME) { - file_info_corba->atime=file_info_captive->atime; - file_info_corba->mtime=file_info_captive->mtime; - file_info_corba->ctime=file_info_captive->ctime; - } - - return GNOME_VFS_OK; -} diff --git a/src/libcaptive/sandbox/FileInfo.h b/src/libcaptive/sandbox/FileInfo.h deleted file mode 100644 index d9efbc8..0000000 --- a/src/libcaptive/sandbox/FileInfo.h +++ /dev/null @@ -1,41 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit server side of GnomeVFSFileInfo handling - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _SERVER_FILEINFO_H -#define _SERVER_FILEINFO_H 1 - - -#include -#include "sandbox.h" -#include - - -G_BEGIN_DECLS - -GnomeVFSResult captive_sandbox_file_info_corba_to_captive - (GnomeVFSFileInfo *file_info_captive,const Captive_GnomeVFSFileInfo *file_info_corba); -GnomeVFSResult captive_sandbox_file_info_captive_to_corba - (Captive_GnomeVFSFileInfo *file_info_corba,const GnomeVFSFileInfo *file_info_captive); -GnomeVFSResult captive_sandbox_file_info_set_mask_captive_to_corba - (Captive_GnomeVFSFileInfo *file_info_corba,const GnomeVFSFileInfo *file_info_captive,GnomeVFSSetFileInfoMask mask); - -G_END_DECLS - - -#endif /* _SERVER_FILEINFO_H */ diff --git a/src/libcaptive/sandbox/Makefile.am b/src/libcaptive/sandbox/Makefile.am deleted file mode 100644 index 5ab7e6f..0000000 --- a/src/libcaptive/sandbox/Makefile.am +++ /dev/null @@ -1,69 +0,0 @@ -# $Id$ -# automake source for CORBA ORBit IDL definition of sandbox intra-captive interface Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -SANDBOX_IDL_SOURCES= \ - sandbox-common.c \ - sandbox-skels.c \ - sandbox-stubs.c \ - sandbox.h - -noinst_LTLIBRARIES=libsandbox.la -libsandbox_la_SOURCES= \ - $(SANDBOX_IDL_SOURCES) \ - FileInfo.c \ - FileInfo.h \ - client-CaptiveIOChannel.c \ - client-CaptiveIOChannel.h \ - parent-Directory.c \ - parent-Directory.h \ - parent-File.c \ - parent-File.h \ - parent-Vfs.c \ - parent-Vfs.h \ - server-CaptiveIOChannel.c \ - server-CaptiveIOChannel.h \ - server-Directory.c \ - server-Directory.h \ - server-File.c \ - server-File.h \ - server-GLogFunc.c \ - server-GLogFunc.h \ - server-Vfs.c \ - server-Vfs.h \ - split.c \ - split.h - -libsandbox_la_CFLAGS=$(ORBIT_CFLAGS) $(LINC_CFLAGS) $(GNOME_VFS_MODULE_CFLAGS) $(LIBXML_CFLAGS) - -libsandbox_la_LIBADD=$(ORBIT_LIBS) $(LINC_LIBS) $(GNOME_VFS_MODULE_LIBS) - -CLEANFILES+= \ - $(SANDBOX_IDL_SOURCES) -BUILT_SOURCES+= \ - $(SANDBOX_IDL_SOURCES) - -# Produced 'sandbox-skelimpl.c' is never compiled, -# it is just a source of templates for server-*.[ch] files -EXTRA_DIST+=sandbox.idl -$(SANDBOX_IDL_SOURCES): sandbox.idl - $(ORBIT_IDL) --skeleton-impl $< - -split.lo: sandbox.h diff --git a/src/libcaptive/sandbox/client-CaptiveIOChannel.c b/src/libcaptive/sandbox/client-CaptiveIOChannel.c deleted file mode 100644 index 17faf8d..0000000 --- a/src/libcaptive/sandbox/client-CaptiveIOChannel.c +++ /dev/null @@ -1,230 +0,0 @@ -/* $Id$ - * CORBA/ORBit client side of image GIOChannel object of sandbox_child() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "client-CaptiveIOChannel.h" /* self */ -#include -#include "split.h" -#include -#include "captive/macros.h" -#include "../client/lib.h" /* for captive_giochannel_setup() */ - - -struct captive_io_channel { - GIOChannel iochannel; - Captive_CaptiveIOChannel corba_captive_io_channel; - }; - - -G_LOCK_DEFINE_STATIC(captive_io_channel_funcs); -static GIOFuncs captive_io_channel_funcs; - - -static gboolean validate_captive_io_channel(struct captive_io_channel *captive_io_channel) -{ - g_return_val_if_fail(captive_io_channel!=NULL,FALSE); - g_return_val_if_fail(captive_io_channel->corba_captive_io_channel!=NULL,FALSE); - - return TRUE; -} - - -static GIOStatus captive_io_channel_io_read - (GIOChannel *channel,gchar *buffer_captive,gsize count,gsize *bytes_read_return,GError **err) -{ -struct captive_io_channel *captive_io_channel=(struct captive_io_channel *)channel; -Captive_Bytes *buffer_corba; - - g_return_val_if_fail(validate_captive_io_channel(captive_io_channel),G_IO_STATUS_ERROR); - g_return_val_if_fail(buffer_captive!=NULL,G_IO_STATUS_ERROR); - g_return_val_if_fail(bytes_read_return!=NULL,G_IO_STATUS_ERROR); - - *bytes_read_return=0; - - Captive_CaptiveIOChannel_read(captive_io_channel->corba_captive_io_channel,&buffer_corba,count,&captive_corba_ev); - if (GNOME_VFS_OK!=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,NULL)) - return G_IO_STATUS_ERROR; - - g_return_val_if_fail(buffer_corba->_length<=count,G_IO_STATUS_ERROR); - memcpy(buffer_captive,buffer_corba->_buffer,buffer_corba->_length); - *bytes_read_return=buffer_corba->_length; - - Captive_Bytes__freekids(buffer_corba,NULL/* 'd'; meaning? */); - CORBA_free(buffer_corba); - - return (*bytes_read_return == 0 ? G_IO_STATUS_EOF : G_IO_STATUS_NORMAL); -} - - -static GIOStatus captive_io_channel_io_write - (GIOChannel *channel,const gchar *buffer_captive,gsize count,gsize *bytes_written_return,GError **err) -{ -struct captive_io_channel *captive_io_channel=(struct captive_io_channel *)channel; -Captive_Bytes buffer_corba_local; -Captive_GSize bytes_written_corba; - - g_return_val_if_fail(validate_captive_io_channel(captive_io_channel),G_IO_STATUS_ERROR); - g_return_val_if_fail(buffer_captive!=NULL,G_IO_STATUS_ERROR); - g_return_val_if_fail(bytes_written_return!=NULL,G_IO_STATUS_ERROR); - - *bytes_written_return=0; - - buffer_corba_local._maximum=count; - buffer_corba_local._length=count; - buffer_corba_local._buffer=(/* de-const */gpointer)buffer_captive; - buffer_corba_local._release=FALSE; - - Captive_CaptiveIOChannel_write(captive_io_channel->corba_captive_io_channel, - &buffer_corba_local,&bytes_written_corba,&captive_corba_ev); - if (GNOME_VFS_OK!=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,NULL)) - return G_IO_STATUS_ERROR; - - *bytes_written_return=bytes_written_corba; - - return G_IO_STATUS_NORMAL; -} - - -static GIOStatus captive_io_channel_io_seek(GIOChannel *channel,gint64 offset,GSeekType type,GError **err) -{ -struct captive_io_channel *captive_io_channel=(struct captive_io_channel *)channel; - - g_return_val_if_fail(validate_captive_io_channel(captive_io_channel),G_IO_STATUS_ERROR); - - Captive_CaptiveIOChannel_seek(captive_io_channel->corba_captive_io_channel,offset,type,&captive_corba_ev); - if (GNOME_VFS_OK!=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,NULL)) - return G_IO_STATUS_ERROR; - - return G_IO_STATUS_NORMAL; -} - - -static GIOStatus captive_io_channel_io_close(GIOChannel *channel,GError **err) -{ -struct captive_io_channel *captive_io_channel=(struct captive_io_channel *)channel; - - g_return_val_if_fail(validate_captive_io_channel(captive_io_channel),G_IO_STATUS_ERROR); - - /* We are not authorized to destroy 'captive_io_channel->corba_captive_io_channel'. */ - /* flush()? */ - captive_io_channel->corba_captive_io_channel=NULL; - - return G_IO_STATUS_NORMAL; -} - - -static GSource* captive_io_channel_io_create_watch(GIOChannel *channel,GIOCondition condition) -{ -struct captive_io_channel *captive_io_channel=(struct captive_io_channel *)channel; - - g_return_val_if_fail(validate_captive_io_channel(captive_io_channel),NULL); - - g_return_val_if_reached(NULL); /* FIXME: NOT IMPLEMENTED YET */ -} - - -static void captive_io_channel_io_free(GIOChannel *channel) -{ -struct captive_io_channel *captive_io_channel=(struct captive_io_channel *)channel; - - /* After captive_io_channel_io_close() 'captive_io_channel' - * may be no longer valid for validate_captive_io_channel(captive_io_channel). - */ - g_return_if_fail(captive_io_channel!=NULL); - - g_assert(captive_io_channel->corba_captive_io_channel==NULL); - - g_free(captive_io_channel); -} - - -static GIOStatus captive_io_channel_io_set_flags(GIOChannel *channel,GIOFlags flags,GError **err) -{ -struct captive_io_channel *captive_io_channel=(struct captive_io_channel *)channel; - - g_return_val_if_fail(validate_captive_io_channel(captive_io_channel),G_IO_STATUS_ERROR); - - /* no G_IO_FLAG_APPEND and no G_IO_FLAG_NONBLOCK */ - g_return_val_if_fail((flags&G_IO_FLAG_SET_MASK)==0,G_IO_STATUS_ERROR); - - return G_IO_STATUS_NORMAL; -} - - -static GIOFlags captive_io_channel_io_get_flags(GIOChannel *channel) -{ -struct captive_io_channel *captive_io_channel=(struct captive_io_channel *)channel; - - g_return_val_if_fail(validate_captive_io_channel(captive_io_channel),0); - - return 0; /* | !G_IO_FLAG_APPEND | !G_IO_FLAG_NONBLOCK */ -} - - -struct captive_io_channel *captive_io_channel_new(Captive_CaptiveIOChannel corba_captive_io_channel,gboolean writeable) -{ -struct captive_io_channel *captive_io_channel; - - g_return_val_if_fail(corba_captive_io_channel!=NULL,NULL); - - G_LOCK(captive_io_channel_funcs); - captive_io_channel_funcs.io_read =captive_io_channel_io_read; - captive_io_channel_funcs.io_write =captive_io_channel_io_write; - captive_io_channel_funcs.io_seek =captive_io_channel_io_seek; - captive_io_channel_funcs.io_close =captive_io_channel_io_close; - captive_io_channel_funcs.io_create_watch=captive_io_channel_io_create_watch; - captive_io_channel_funcs.io_free =captive_io_channel_io_free; - captive_io_channel_funcs.io_set_flags =captive_io_channel_io_set_flags; - captive_io_channel_funcs.io_get_flags =captive_io_channel_io_get_flags; - G_UNLOCK(captive_io_channel_funcs); - - captive_new(captive_io_channel); - g_assert(G_STRUCT_OFFSET(struct captive_io_channel,iochannel)==0); /* safely re-type-able */ - g_io_channel_init(&captive_io_channel->iochannel); - captive_io_channel->iochannel.funcs=&captive_io_channel_funcs; - captive_io_channel->iochannel.is_seekable=TRUE; - captive_io_channel->iochannel.is_readable=TRUE; - captive_io_channel->iochannel.is_writeable=writeable; - captive_io_channel->iochannel.close_on_unref=TRUE; /* run g_io_channel_shutdown() flush on last unref */ - captive_io_channel->corba_captive_io_channel=corba_captive_io_channel; - - captive_giochannel_setup(&captive_io_channel->iochannel); - - return captive_io_channel; -} - - -gboolean captive_io_channel_get_size(GIOChannel *giochannel,guint64 *size_return) -{ -struct captive_io_channel *captive_io_channel; - - g_return_val_if_fail(giochannel!=NULL,FALSE); - g_return_val_if_fail(size_return!=NULL,FALSE); - - if (giochannel->funcs!=&captive_io_channel_funcs) - return FALSE; - captive_io_channel=(struct captive_io_channel *)giochannel; - - *size_return=Captive_CaptiveIOChannel_size(captive_io_channel->corba_captive_io_channel,&captive_corba_ev); - if (GNOME_VFS_OK!=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,NULL)) - return FALSE; - - return TRUE; -} diff --git a/src/libcaptive/sandbox/client-CaptiveIOChannel.h b/src/libcaptive/sandbox/client-CaptiveIOChannel.h deleted file mode 100644 index 63bb026..0000000 --- a/src/libcaptive/sandbox/client-CaptiveIOChannel.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit client side of image GIOChannel object of sandbox_child() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CLIENT_CAPTIVEIOCHANNEL_H -#define _CLIENT_CAPTIVEIOCHANNEL_H 1 - - -#include -#ifdef ORBIT2 /* Prevent missing $(ORBIT_CFLAGS) outside of libcaptive/sandbox/ */ -#include "sandbox.h" -#endif - - -G_BEGIN_DECLS - -#ifdef ORBIT2 /* Prevent missing $(ORBIT_CFLAGS) outside of libcaptive/sandbox/ */ -struct captive_io_channel *captive_io_channel_new(Captive_CaptiveIOChannel corba_captive_io_channel,gboolean writeable); -#endif -gboolean captive_io_channel_get_size(GIOChannel *giochannel,guint64 *size_return); - -G_END_DECLS - - -#endif /* _CLIENT_CAPTIVEIOCHANNEL_H */ diff --git a/src/libcaptive/sandbox/parent-Directory.c b/src/libcaptive/sandbox/parent-Directory.c deleted file mode 100644 index 993d32e..0000000 --- a/src/libcaptive/sandbox/parent-Directory.c +++ /dev/null @@ -1,274 +0,0 @@ -/* $Id$ - * CORBA/ORBit client side of Directory object of sandbox_parent() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "parent-Directory.h" /* self */ -#include -#include "split.h" -#include "sandbox.h" -#include "../client/directory.h" -#include "../client/vfs.h" -#include "FileInfo.h" -#include "captive/macros.h" -#include "../client/vfs-parent.h" - - -GnomeVFSResult captive_sandbox_parent_directory_new_open - (CaptiveDirectoryParentObject *captive_directory_parent_object) -{ -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; -GnomeVFSResult r; -Captive_Directory corba_Directory_object; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(captive_directory_parent_object->pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "directory_new_open",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_directory_parent_object)); - xmlNewProp(xml_action,BAD_CAST "pathname",BAD_CAST captive_directory_parent_object->pathname); - } - - corba_Directory_object=Captive_Vfs_directory_new_open( - captive_vfs_parent_object->corba_Vfs_object,captive_directory_parent_object->pathname,&captive_corba_ev); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST (captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0")); - /* If 'r' means failure 'corba_Directory_object' may not be 'CORBA_OBJECT_NIL' - * although it is not valid 'CORBA_Object' to be passed to CORBA_Object_release(). - */ - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object))) - return r; - - captive_directory_parent_object->corba_Directory_object=corba_Directory_object; - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_directory_new_make - (CaptiveDirectoryParentObject *captive_directory_parent_object,guint perm) -{ -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; -GnomeVFSResult r; -Captive_Directory corba_Directory_object; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(captive_directory_parent_object->pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "directory_new_make",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_directory_parent_object)); - xmlNewProp(xml_action,BAD_CAST "pathname",BAD_CAST captive_directory_parent_object->pathname); - xmlNewProp(xml_action,BAD_CAST "perm",BAD_CAST captive_printf_alloca("%u",(unsigned)perm)); - } - - corba_Directory_object=Captive_Vfs_directory_new_make( - captive_vfs_parent_object->corba_Vfs_object,captive_directory_parent_object->pathname,perm,&captive_corba_ev); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST (captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0")); - /* If 'r' means failure 'corba_Directory_object' may not be 'CORBA_OBJECT_NIL' - * although it is not valid 'CORBA_Object' to be passed to CORBA_Object_release(). - */ - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object))) - return r; - - captive_directory_parent_object->corba_Directory_object=corba_Directory_object; - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_directory_close(CaptiveDirectoryParentObject *captive_directory_parent_object) -{ -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "directory_close",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_directory_parent_object)); - } - - Captive_Directory_shutdown(captive_directory_parent_object->corba_Directory_object,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - - /* Always clear 'corba_Directory_object' even if 'r' means failure. */ - CORBA_Object_release((CORBA_Object)captive_directory_parent_object->corba_Directory_object,&captive_corba_ev); - captive_directory_parent_object->corba_Directory_object=CORBA_OBJECT_NIL; - - if (captive_directory_parent_object->corba_Directory_file_info_list) { -GList *file_info_last_l=g_list_last(captive_directory_parent_object->corba_Directory_file_info_list); - - /* Prevent gnome_vfs_file_info_list_free() and its gnome_vfs_file_info_unref() - * on the last 'file_info_list' items as it is EOF with NULL '->data'. - */ - /* Do not: g_assert(file_info_last_l->data==NULL); * directory EOF * - * as the crashed client may not produced the trailing NULL. - */ - if (!file_info_last_l->data) - captive_directory_parent_object->corba_Directory_file_info_list=g_list_delete_link( - captive_directory_parent_object->corba_Directory_file_info_list,file_info_last_l); - gnome_vfs_file_info_list_free(captive_directory_parent_object->corba_Directory_file_info_list); - captive_directory_parent_object->corba_Directory_file_info_list=NULL; - } - - return r; -} - -static GnomeVFSResult captive_sandbox_parent_directory_read_fill1 - (CaptiveDirectoryParentObject *captive_directory_parent_object,GnomeVFSFileInfo *file_info_captive) -{ -xmlNode *xml_action=NULL; -Captive_GnomeVFSFileInfo *file_info_corba; -GnomeVFSResult r; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "directory_read",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_directory_parent_object)); - } - - Captive_Directory_read(captive_directory_parent_object->corba_Directory_object,&file_info_corba,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - r=captive_sandbox_file_info_corba_to_captive(file_info_captive,file_info_corba); - if (xml_action) - xmlSetProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; /* 'file_info_corba' leak */ - - Captive_GnomeVFSFileInfo__freekids(file_info_corba,NULL/* 'd'; meaning? */); - CORBA_free(file_info_corba); - - return GNOME_VFS_OK; -} - -static GnomeVFSResult captive_sandbox_parent_directory_read_filldir(CaptiveDirectoryParentObject *captive_directory_parent_object) -{ -GnomeVFSFileInfo *file_info_captive; -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(captive_directory_parent_object->corba_Directory_file_info_list==NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - for (;;) { - file_info_captive=gnome_vfs_file_info_new(); - r=captive_sandbox_parent_directory_read_fill1(captive_directory_parent_object,file_info_captive); - if (r==GNOME_VFS_ERROR_EOF) { - gnome_vfs_file_info_unref(file_info_captive); - break; - } - if (r!=GNOME_VFS_OK) { - gnome_vfs_file_info_unref(file_info_captive); - gnome_vfs_file_info_list_free(captive_directory_parent_object->corba_Directory_file_info_list); - captive_directory_parent_object->corba_Directory_file_info_list=NULL; - return r; - } - captive_directory_parent_object->corba_Directory_file_info_list=g_list_prepend( - captive_directory_parent_object->corba_Directory_file_info_list,file_info_captive); - } - - captive_directory_parent_object->corba_Directory_file_info_list=g_list_prepend( - captive_directory_parent_object->corba_Directory_file_info_list,NULL); /* EOF */ - captive_directory_parent_object->corba_Directory_file_info_list=g_list_reverse( - captive_directory_parent_object->corba_Directory_file_info_list); - - return GNOME_VFS_OK; -} - -/* We have to read the whole directory atomically - * as during valid child restart we would loose our reading position. - */ -GnomeVFSResult captive_sandbox_parent_directory_read - (CaptiveDirectoryParentObject *captive_directory_parent_object,GnomeVFSFileInfo *file_info_captive) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (!captive_directory_parent_object->corba_Directory_file_info_list) - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_directory_read_filldir(captive_directory_parent_object))) - return r; - - if (!captive_directory_parent_object->corba_Directory_file_info_list->data) { - g_assert(captive_directory_parent_object->corba_Directory_file_info_list->next==NULL); - /* Do not clear the list to leave us stuck at EOF - GnomeVFS behaves that way. */ - r=GNOME_VFS_ERROR_EOF; - } - else { - /* Cut first list item. */ - gnome_vfs_file_info_copy( - file_info_captive, /* dest */ - captive_directory_parent_object->corba_Directory_file_info_list->data); /* src */ - gnome_vfs_file_info_unref(captive_directory_parent_object->corba_Directory_file_info_list->data); - captive_directory_parent_object->corba_Directory_file_info_list=g_list_delete_link( - captive_directory_parent_object->corba_Directory_file_info_list, - captive_directory_parent_object->corba_Directory_file_info_list); - r=GNOME_VFS_OK; - } - - return r; -} - - -GnomeVFSResult captive_sandbox_parent_directory_remove(CaptiveDirectoryParentObject *captive_directory_parent_object) -{ -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_DIRECTORY_PARENT_IS_OBJECT(captive_directory_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_DIRECTORY_OBJECT(captive_directory_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "directory_remove",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_directory_parent_object)); - } - - Captive_Directory_remove(captive_directory_parent_object->corba_Directory_object,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - return GNOME_VFS_OK; -} diff --git a/src/libcaptive/sandbox/parent-Directory.h b/src/libcaptive/sandbox/parent-Directory.h deleted file mode 100644 index 483c844..0000000 --- a/src/libcaptive/sandbox/parent-Directory.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit server side of Directory object of sandbox_parent() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _PARENT_DIRECTORY_H -#define _PARENT_DIRECTORY_H 1 - - -#include -#include -#include /* for GnomeVFSResult */ -#include "../client/directory-parent.h" - - -G_BEGIN_DECLS - -GnomeVFSResult captive_sandbox_parent_directory_new_open - (CaptiveDirectoryParentObject *captive_directory_parent_object); -GnomeVFSResult captive_sandbox_parent_directory_new_make - (CaptiveDirectoryParentObject *captive_directory_parent_object,guint perm); -GnomeVFSResult captive_sandbox_parent_directory_close(CaptiveDirectoryParentObject *captive_directory_parent_object); -GnomeVFSResult captive_sandbox_parent_directory_read - (CaptiveDirectoryParentObject *captive_directory_parent_object,GnomeVFSFileInfo *file_info_captive); -GnomeVFSResult captive_sandbox_parent_directory_remove(CaptiveDirectoryParentObject *captive_directory_parent_object); - -G_END_DECLS - - -#endif /* _PARENT_DIRECTORY_H */ diff --git a/src/libcaptive/sandbox/parent-File.c b/src/libcaptive/sandbox/parent-File.c deleted file mode 100644 index 46e4889..0000000 --- a/src/libcaptive/sandbox/parent-File.c +++ /dev/null @@ -1,524 +0,0 @@ -/* $Id$ - * CORBA/ORBit client side of File object of sandbox_parent() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "parent-File.h" /* self */ -#include -#include "split.h" -#include "sandbox.h" -#include "../client/file.h" -#include "../client/vfs.h" -#include "FileInfo.h" -#include "captive/macros.h" -#include "reactos/ntos/types.h" /* for ULONG */ - - -GnomeVFSResult captive_sandbox_parent_file_new_open(CaptiveFileParentObject *captive_file_parent_object) -{ -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; -GnomeVFSResult r; -Captive_File corba_File_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(captive_file_parent_object->pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_new_open",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - xmlNewProp(xml_action,BAD_CAST "pathname",BAD_CAST captive_file_parent_object->pathname); - xmlNewProp(xml_action,BAD_CAST "mode",BAD_CAST captive_printf_alloca("%u",(unsigned)captive_file_parent_object->mode)); - } - - corba_File_object=Captive_Vfs_file_new_open(captive_vfs_parent_object->corba_Vfs_object, - captive_file_parent_object->pathname,captive_file_parent_object->mode,&captive_corba_ev); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST (captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0")); - /* If 'r' means failure 'corba_File_object' may not be 'CORBA_OBJECT_NIL' - * although it is not valid 'CORBA_Object' to be passed to CORBA_Object_release(). - */ - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object))) - return r; - - captive_file_parent_object->corba_File_object=corba_File_object; - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_new_create(CaptiveFileParentObject *captive_file_parent_object, - gboolean exclusive,guint perm) -{ -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; -GnomeVFSResult r; -Captive_File corba_File_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(captive_file_parent_object->pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_new_create",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - xmlNewProp(xml_action,BAD_CAST "pathname",BAD_CAST captive_file_parent_object->pathname); - xmlNewProp(xml_action,BAD_CAST "mode",BAD_CAST captive_printf_alloca("%u",(unsigned)captive_file_parent_object->mode)); - xmlNewProp(xml_action,BAD_CAST "exclusive",BAD_CAST captive_printf_alloca("%u",(unsigned)exclusive)); - xmlNewProp(xml_action,BAD_CAST "perm",BAD_CAST captive_printf_alloca("%u",(unsigned)perm)); - } - - corba_File_object=Captive_Vfs_file_new_create(captive_vfs_parent_object->corba_Vfs_object, - captive_file_parent_object->pathname,captive_file_parent_object->mode,exclusive,perm,&captive_corba_ev); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST (captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0")); - /* If 'r' means failure 'corba_File_object' may not be 'CORBA_OBJECT_NIL' - * although it is not valid 'CORBA_Object' to be passed to CORBA_Object_release(). - */ - if (GNOME_VFS_OK!=(r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object))) - return r; - - captive_file_parent_object->corba_File_object=corba_File_object; - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_close(CaptiveFileParentObject *captive_file_parent_object) -{ -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_close",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - } - - Captive_File_shutdown(captive_file_parent_object->corba_File_object,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - - /* Always clear 'corba_File_object' even if 'r' means failure. */ - CORBA_Object_release((CORBA_Object)captive_file_parent_object->corba_File_object,&captive_corba_ev); - captive_file_parent_object->corba_File_object=CORBA_OBJECT_NIL; - - return r; -} - - -static GnomeVFSResult captive_sandbox_parent_file_seek_slave - (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset); - -GnomeVFSResult captive_sandbox_parent_file_read(CaptiveFileParentObject *captive_file_parent_object, - gpointer buffer_captive,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return) -{ -GnomeVFSResult r; -Captive_Bytes *buffer_corba; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_read_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - *bytes_read_return=0; - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_read",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - xmlNewProp(xml_action,BAD_CAST "num_bytes",BAD_CAST captive_printf_alloca("%lu",(unsigned long)num_bytes)); - } - - r=captive_sandbox_parent_file_seek_slave(captive_file_parent_object, - GNOME_VFS_SEEK_START,captive_file_parent_object->offset); - if (r==GNOME_VFS_OK) { - Captive_File_read(captive_file_parent_object->corba_File_object,&buffer_corba,num_bytes,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - } - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - g_return_val_if_fail(buffer_corba->_length<=num_bytes,GNOME_VFS_ERROR_GENERIC); - memcpy(buffer_captive,buffer_corba->_buffer,buffer_corba->_length); - *bytes_read_return=buffer_corba->_length; - captive_file_parent_object->offset+=buffer_corba->_length; - - Captive_Bytes__freekids(buffer_corba,NULL/* 'd'; meaning? */); - CORBA_free(buffer_corba); - - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "bytes_read_return",BAD_CAST captive_printf_alloca("%lu",(unsigned long)*bytes_read_return)); - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_write(CaptiveFileParentObject *captive_file_parent_object, - gconstpointer buffer_captive,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return) -{ -GnomeVFSResult r; -Captive_Bytes buffer_corba_local; -Captive_GnomeVFSFileSize bytes_written_corba; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(buffer_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(bytes_written_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - *bytes_written_return=0; - - r=captive_sandbox_parent_file_seek_slave(captive_file_parent_object, - GNOME_VFS_SEEK_START,captive_file_parent_object->offset); - if (r==GNOME_VFS_OK) { - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_write",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - xmlNewProp(xml_action,BAD_CAST "num_bytes",BAD_CAST captive_printf_alloca("%lu",(unsigned long)num_bytes)); - } - - buffer_corba_local._maximum=num_bytes; - buffer_corba_local._length=num_bytes; - buffer_corba_local._buffer=(/* de-const */gpointer)buffer_captive; - buffer_corba_local._release=FALSE; - - Captive_File_write(captive_file_parent_object->corba_File_object, - &buffer_corba_local,&bytes_written_corba,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - } - if (r!=GNOME_VFS_OK) - return r; - - *bytes_written_return=bytes_written_corba; - captive_file_parent_object->offset+=bytes_written_corba; - - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "bytes_written_return",BAD_CAST captive_printf_alloca("%lu",(unsigned long)*bytes_written_return)); - - return GNOME_VFS_OK; -} - - -static GnomeVFSResult captive_sandbox_parent_file_seek_slave - (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset) -{ -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_seek",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - xmlNewProp(xml_action,BAD_CAST "whence",BAD_CAST - (whence==GNOME_VFS_SEEK_START ? "start" : - (whence==GNOME_VFS_SEEK_CURRENT ? "current" : - (whence==GNOME_VFS_SEEK_END ? "end" : captive_printf_alloca("%lu",(unsigned long)whence))))); - xmlNewProp(xml_action,BAD_CAST "offset",BAD_CAST captive_printf_alloca("%" G_GINT64_FORMAT,(gint64)offset)); - } - - Captive_File_seek(captive_file_parent_object->corba_File_object,whence,offset,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_seek - (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset) -{ -GnomeVFSResult r; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - /* Do not produce 'xml_action' here as we use only 'slave' point of view - * for captive-bug-replay(1). - */ - - switch (whence) { - case GNOME_VFS_SEEK_START: - captive_file_parent_object->offset=offset; - r=GNOME_VFS_OK; - break; - case GNOME_VFS_SEEK_CURRENT: - if (0 - || (offset>0 && (captive_file_parent_object->offset+offset)offset) - || (offset<0 && (captive_file_parent_object->offset+offset)>captive_file_parent_object->offset)) - r=GNOME_VFS_ERROR_BAD_PARAMETERS; - else { - captive_file_parent_object->offset+=offset; - r=GNOME_VFS_OK; - } - break; - case GNOME_VFS_SEEK_END: - g_assert_not_reached(); /* NOT IMPLEMENTED YET */ - r=GNOME_VFS_ERROR_GENERIC; - break; - default: - r=GNOME_VFS_ERROR_BAD_PARAMETERS; - } - - if (r!=GNOME_VFS_OK) - return r; - - return GNOME_VFS_OK; -} - - -#if 0 /* unused */ -static GnomeVFSResult captive_sandbox_parent_file_tell_slave - (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileOffset *offset_return) -{ -Captive_GnomeVFSFileOffset offset_corba; -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(offset_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_tell",NULL); - xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object)); - } - - Captive_File_tell(captive_file_parent_object->corba_File_object,&offset_corba,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - *offset_return=offset_corba; - - if (xml_action) - xmlNewProp(xml_action,"offset_return",captive_printf_alloca("%" G_GINT64_FORMAT,(gint64)*offset_return)); - - return GNOME_VFS_OK; -} -#endif - - -GnomeVFSResult captive_sandbox_parent_file_tell(CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileOffset *offset_return) -{ -GnomeVFSResult r; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(offset_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - /* Do not produce 'xml_action' here as we use only 'slave' point of view - * for captive-bug-replay(1). - */ - - *offset_return=captive_file_parent_object->offset; - r=GNOME_VFS_OK; - - if (r!=GNOME_VFS_OK) - return r; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_remove(CaptiveFileParentObject *captive_file_parent_object) -{ -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_remove",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - } - - Captive_File_remove(captive_file_parent_object->corba_File_object,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_file_info_get(CaptiveFileParentObject *captive_file_parent_object, - GnomeVFSFileInfo *file_info_captive) -{ -Captive_GnomeVFSFileInfo *file_info_corba; -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_file_info_get",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - } - - Captive_File_file_info_get(captive_file_parent_object->corba_File_object,&file_info_corba,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - r=captive_sandbox_file_info_corba_to_captive(file_info_captive,file_info_corba); - Captive_GnomeVFSFileInfo__freekids(file_info_corba,NULL/* 'd'; meaning? */); - CORBA_free(file_info_corba); - if (xml_action) - xmlSetProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_file_info_set(CaptiveFileParentObject *captive_file_parent_object, - const GnomeVFSFileInfo *file_info_captive,GnomeVFSSetFileInfoMask mask) -{ -Captive_GnomeVFSFileInfo file_info_corba; -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_file_info_set",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - xmlNewProp(xml_action,BAD_CAST "mask",BAD_CAST captive_printf_alloca("%u",(unsigned)mask)); - } - - if (GNOME_VFS_OK!=(r=captive_sandbox_file_info_set_mask_captive_to_corba(&file_info_corba,file_info_captive,mask))) - return r; - - Captive_File_file_info_set(captive_file_parent_object->corba_File_object,&file_info_corba,mask,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - Captive_GnomeVFSFileInfo__freekids(&file_info_corba,NULL/* 'd'; meaning? */); - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_truncate(CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileSize file_size) -{ -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_truncate",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object)); - xmlNewProp(xml_action,BAD_CAST "file_size",BAD_CAST captive_printf_alloca("%" G_GUINT64_FORMAT,(guint64)file_size)); - } - - Captive_File_truncate(captive_file_parent_object->corba_File_object,file_size,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_file_move - (CaptiveFileParentObject *captive_file_parent_object_old,const gchar *pathname_new,gboolean force_replace) -{ -GnomeVFSResult r; -xmlNode *xml_action=NULL; -CaptiveVfsParentObject *captive_vfs_parent_object; - - g_return_val_if_fail(captive_file_parent_object_old!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(pathname_new!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object_old)->vfs); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "file_move",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_file_parent_object_old)); - xmlNewProp(xml_action,BAD_CAST "pathname_new",BAD_CAST pathname_new); - xmlNewProp(xml_action,BAD_CAST "force_replace",BAD_CAST captive_printf_alloca("%u",(unsigned)force_replace)); - } - - Captive_File_move(captive_file_parent_object_old->corba_File_object,pathname_new,force_replace,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - return GNOME_VFS_OK; -} diff --git a/src/libcaptive/sandbox/parent-File.h b/src/libcaptive/sandbox/parent-File.h deleted file mode 100644 index d8cd094..0000000 --- a/src/libcaptive/sandbox/parent-File.h +++ /dev/null @@ -1,57 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit server side of File object of sandbox_parent() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _PARENT_FILE_H -#define _PARENT_FILE_H 1 - - -#include -#include -#include /* for GnomeVFSResult */ -#include "../client/file-parent.h" - - -G_BEGIN_DECLS - -GnomeVFSResult captive_sandbox_parent_file_new_open(CaptiveFileParentObject *captive_file_parent_object); -GnomeVFSResult captive_sandbox_parent_file_new_create(CaptiveFileParentObject *captive_file_parent_object, - gboolean exclusive,guint perm); -GnomeVFSResult captive_sandbox_parent_file_close(CaptiveFileParentObject *captive_file_parent_object); -GnomeVFSResult captive_sandbox_parent_file_read(CaptiveFileParentObject *captive_file_parent_object, - gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return); -GnomeVFSResult captive_sandbox_parent_file_write(CaptiveFileParentObject *captive_file_parent_object, - gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return); -GnomeVFSResult captive_sandbox_parent_file_seek - (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset); -GnomeVFSResult captive_sandbox_parent_file_tell - (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileOffset *offset_return); -GnomeVFSResult captive_sandbox_parent_file_remove(CaptiveFileParentObject *captive_file_parent_object); -GnomeVFSResult captive_sandbox_parent_file_file_info_get(CaptiveFileParentObject *captive_file_parent_object, - GnomeVFSFileInfo *file_info); -GnomeVFSResult captive_sandbox_parent_file_file_info_set(CaptiveFileParentObject *captive_file_parent_object, - const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask); -GnomeVFSResult captive_sandbox_parent_file_truncate - (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileSize file_size); -GnomeVFSResult captive_sandbox_parent_file_move - (CaptiveFileParentObject *captive_file_parent_object_old,const gchar *pathname_new,gboolean force_replace); - -G_END_DECLS - - -#endif /* _PARENT_FILE_H */ diff --git a/src/libcaptive/sandbox/parent-Vfs.c b/src/libcaptive/sandbox/parent-Vfs.c deleted file mode 100644 index d260dbd..0000000 --- a/src/libcaptive/sandbox/parent-Vfs.c +++ /dev/null @@ -1,298 +0,0 @@ -/* $Id$ - * CORBA/ORBit client side of Vfs object of sandbox_parent() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "parent-Vfs.h" /* self */ -#include -#include "split.h" -#include "../client/vfs.h" -#include "sandbox.h" -#include -#include "server-GLogFunc.h" -#include "server-CaptiveIOChannel.h" -#include /* for kill(2) */ -#include -#include "../client/giochannel-blind.h" /* for captive_giochannel_blind_commit() */ -#include -#include -#include -#include "captive/macros.h" - - -GnomeVFSResult captive_sandbox_parent_vfs_new_silent(CaptiveVfsParentObject *captive_vfs_parent_object) -{ -gboolean errbool; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - errbool=captive_sandbox_spawn(captive_vfs_parent_object); - g_return_val_if_fail(errbool==TRUE,GNOME_VFS_ERROR_GENERIC); - - return GNOME_VFS_OK; -} - - -GnomeVFSResult captive_sandbox_parent_vfs_new(CaptiveVfsParentObject *captive_vfs_parent_object) -{ -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - r=captive_sandbox_parent_vfs_new_silent(captive_vfs_parent_object); - - if (captive_vfs_parent_object->corba_bug_action) { -xmlNode *xml_action; - - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "vfs_new",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_vfs_parent_object)); - } - - return r; -} - - -static void bug_doc_generate(CaptiveVfsParentObject *captive_vfs_parent_object) -{ -size_t out_fname_size; -time_t time_t_local; -gchar out_fname[PATH_MAX]; -int errint; -xmlNode *xml_media; -const gchar *xml_media_type="???"; /* Prevent: ... might be used uninitialized in this function */ - - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); - - xml_media=captive_giochannel_blind_readreport_to_xml(captive_vfs_parent_object->corba_bug,captive_vfs_parent_object->corba_parent_giochanel_blind); - switch (CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.media) { - case CAPTIVE_OPTION_MEDIA_CDROM: xml_media_type="cdrom"; break; - case CAPTIVE_OPTION_MEDIA_DISK: xml_media_type="disk"; break; - default: g_assert_not_reached(); - } - xmlNewProp(xml_media,BAD_CAST "type",BAD_CAST xml_media_type); - - xmlSetDocCompressMode(captive_vfs_parent_object->corba_bug_doc,9); - - time(&time_t_local); - if (!(out_fname_size=strftime(out_fname,sizeof(out_fname), - CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.bug_pathname,localtime(&time_t_local)))) { - g_assert_not_reached(); - return; - } - - /* xmlSaveFormatFileEnc() would be better to prevent rewriting - * of target 'out_fname' but it does not support compression. - */ - errint=xmlSaveFormatFileEnc(out_fname,captive_vfs_parent_object->corba_bug_doc,"UTF-8", - 1); /* format; ==output indenting; FIXME: Is it really indented? */ - g_assert(errint!=-1); -} - - -static GnomeVFSResult captive_sandbox_parent_vfs_close_silent(CaptiveVfsParentObject *captive_vfs_parent_object) -{ -GnomeVFSResult r; -int errint; -impl_POA_Captive_GLogFunc *GLogFunc_servant; -impl_POA_Captive_CaptiveIOChannel *CaptiveIOChannel_servant; -GIOStatus erriostatus; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object!=CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - Captive_Vfs_shutdown(captive_vfs_parent_object->corba_Vfs_object,&captive_corba_ev); - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - - /* We may get called by recursion from captive_sandbox_parent_return_from_CORBA_Environment(): */ - if (captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL) - return r; - - /* Always clear 'corba_Vfs_object' even if 'r' means failure. */ - CORBA_Object_release(captive_vfs_parent_object->corba_Vfs_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - captive_vfs_parent_object->corba_Vfs_object=CORBA_OBJECT_NIL; - - /* Shutdown 'GLogFunc' servant. */ - GLogFunc_servant=PortableServer_POA_reference_to_servant(captive_corba_poa, - captive_vfs_parent_object->corba_GLogFunc_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - CORBA_Object_release(captive_vfs_parent_object->corba_GLogFunc_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - impl_Captive_GLogFunc__destroy(GLogFunc_servant,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Shutdown 'CaptiveIOChannel' servant. */ - CaptiveIOChannel_servant=PortableServer_POA_reference_to_servant(captive_corba_poa, - captive_vfs_parent_object->corba_CaptiveIOChannel_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - CORBA_Object_release(captive_vfs_parent_object->corba_CaptiveIOChannel_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - impl_Captive_CaptiveIOChannel__destroy(CaptiveIOChannel_servant,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Close parentheart_fd_write. */ - if (captive_vfs_parent_object->corba_parentheart_fds_1!=-1) { - errint=close(captive_vfs_parent_object->corba_parentheart_fds_1); - g_return_val_if_fail(errint==0,FALSE); - } - - /* Cleanup linked child socket to our parent '/tmp'. */ - if (captive_vfs_parent_object->corba_chrooted_orbit_dir) { - if (captive_vfs_parent_object->corba_socketname) { -const gchar *socketpathname; - - socketpathname=captive_printf_alloca("%s/%s", - captive_vfs_parent_object->corba_chrooted_orbit_dir,captive_vfs_parent_object->corba_socketname); - unlink(socketpathname); /* errors ignored */ - g_free(captive_vfs_parent_object->corba_socketname); - captive_vfs_parent_object->corba_socketname=NULL; - } - rmdir(captive_vfs_parent_object->corba_chrooted_orbit_dir); /* errors ignored */ - g_free(captive_vfs_parent_object->corba_chrooted_orbit_dir); - captive_vfs_parent_object->corba_chrooted_orbit_dir=NULL; - } - - /* Cleanup the child process. */ - if (captive_vfs_parent_object->corba_child_pid!=(pid_t)-1) { - kill(captive_vfs_parent_object->corba_child_pid,SIGKILL); /* errors ignored */ - /* waitpid(2) errors are ignored as we should be immune against failures as the parent. */ - waitpid(captive_vfs_parent_object->corba_child_pid, - NULL, /* status */ - /* options: !WNOHANG as the child will not be ready yet for waitpid() - * right after its SIGKILL. As we did SIGKILL I hope it has no chance - * to block us. - */ - 0); /* options */ - } - - if (r==GNOME_VFS_OK) { - erriostatus=captive_giochannel_blind_commit(captive_vfs_parent_object->corba_parent_giochanel_blind); - g_assert(erriostatus==G_IO_STATUS_NORMAL); - } - else { /* sandbox child failure */ - /* Flush the channel to catch all the disk accesses to the bugreport. */ - erriostatus=g_io_channel_flush( - captive_vfs_parent_object->corba_parent_giochanel_blind, /* channel */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - - /* Summarize the bugreport. */ - if (captive_vfs_parent_object->corba_bug_doc) - bug_doc_generate(captive_vfs_parent_object); - } - g_io_channel_unref(captive_vfs_parent_object->corba_parent_giochanel_blind); - captive_vfs_parent_object->corba_parent_giochanel_blind=NULL; - - if (captive_vfs_parent_object->corba_bug_doc) { - xmlFreeDoc(captive_vfs_parent_object->corba_bug_doc); - captive_vfs_parent_object->corba_bug_doc=NULL; - captive_vfs_parent_object->corba_bug=NULL; - captive_vfs_parent_object->corba_bug_action=NULL; - captive_vfs_parent_object->corba_bug_log=NULL; - } - - return r; -} - - -GnomeVFSResult captive_sandbox_parent_vfs_close(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object!=CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (captive_vfs_parent_object->corba_bug_action) { -xmlNode *xml_action; - - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "vfs_close",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_vfs_parent_object)); - } - - return captive_sandbox_parent_vfs_close_silent(captive_vfs_parent_object); -} - - -GnomeVFSResult captive_sandbox_parent_vfs_commit(CaptiveVfsParentObject *captive_vfs_parent_object) -{ -GnomeVFSResult r_close,r_new; -xmlNode *xml_action=NULL; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - - g_return_val_if_fail(captive_vfs_parent_object->corba_Vfs_object!=CORBA_OBJECT_NIL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (captive_vfs_parent_object->corba_bug_action) { - xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "vfs_commit",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_vfs_parent_object)); - } - - r_close=captive_vfs_parent_object_disconnect(captive_vfs_parent_object); - if (captive_vfs_parent_object->corba_Vfs_object==CORBA_OBJECT_NIL) - r_new=captive_vfs_parent_object_connect(captive_vfs_parent_object); - else - r_new=GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE; - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "vfs_commit",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_vfs_parent_object)); - xmlNewProp(xml_action,BAD_CAST "result_prev_close",BAD_CAST gnome_vfs_result_to_string(r_close)); - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r_new)); - } - - return (r_new!=GNOME_VFS_OK ? r_new : r_close); -} - - -GnomeVFSResult captive_sandbox_parent_vfs_volume_info_get - (CaptiveVfsParentObject *captive_vfs_parent_object,CaptiveVfsVolumeInfo *volume_info_captive) -{ -xmlNode *xml_action=NULL; -Captive_CaptiveVfsVolumeInfo volume_info_corba; -GnomeVFSResult r; - - g_return_val_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS); - g_return_val_if_fail(volume_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS); - - if (captive_vfs_parent_object->corba_bug_action) { - xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,BAD_CAST "vfs_volume_info_get",NULL); - xmlNewProp(xml_action,BAD_CAST "object",BAD_CAST captive_printf_alloca("%p",captive_vfs_parent_object)); - } - - Captive_Vfs_volume_info_get(captive_vfs_parent_object->corba_Vfs_object,&volume_info_corba,&captive_corba_ev); - if (xml_action) - xmlNewProp(xml_action,BAD_CAST "result",BAD_CAST (captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0")); - - r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object); - if (xml_action) - xmlSetProp(xml_action,BAD_CAST "result",BAD_CAST gnome_vfs_result_to_string(r)); - if (r!=GNOME_VFS_OK) - return r; - - volume_info_captive->block_size=volume_info_corba.block_size; - volume_info_captive->bytes=volume_info_corba.bytes; - volume_info_captive->bytes_free=volume_info_corba.bytes_free; - volume_info_captive->bytes_available=volume_info_corba.bytes_available; - - return GNOME_VFS_OK; -} diff --git a/src/libcaptive/sandbox/parent-Vfs.h b/src/libcaptive/sandbox/parent-Vfs.h deleted file mode 100644 index c9a39b8..0000000 --- a/src/libcaptive/sandbox/parent-Vfs.h +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit server side of Vfs object of sandbox_parent() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _PARENT_VFS_H -#define _PARENT_VFS_H 1 - - -#include -#include -#include /* for GnomeVFSResult */ -#include "../client/vfs-parent.h" - - -G_BEGIN_DECLS - -GnomeVFSResult captive_sandbox_parent_vfs_new_silent(CaptiveVfsParentObject *captive_vfs_parent_object); -GnomeVFSResult captive_sandbox_parent_vfs_new(CaptiveVfsParentObject *captive_vfs_parent_object); -GnomeVFSResult captive_sandbox_parent_vfs_close(CaptiveVfsParentObject *captive_vfs_parent_object); -GnomeVFSResult captive_sandbox_parent_vfs_commit(CaptiveVfsParentObject *captive_vfs_parent_object); -GnomeVFSResult captive_sandbox_parent_vfs_volume_info_get - (CaptiveVfsParentObject *captive_vfs_parent_object,CaptiveVfsVolumeInfo *volume_info_captive); - -G_END_DECLS - - -#endif /* _PARENT_VFS_H */ diff --git a/src/libcaptive/sandbox/sandbox.idl b/src/libcaptive/sandbox/sandbox.idl deleted file mode 100644 index 7e3cb44..0000000 --- a/src/libcaptive/sandbox/sandbox.idl +++ /dev/null @@ -1,171 +0,0 @@ -/* $Id$ - * CORBA ORBit IDL definition of sandbox intra-captive interface - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -module Captive -{ - typedef sequence Bytes; - - - typedef unsigned long GnomeVFSResult; /* enum */ - exception GnomeVFSResultException { - GnomeVFSResult gnome_vfs_result; - }; - - - typedef unsigned long GIOStatus; /* enum */ - exception GIOStatusException { - GIOStatus g_io_status; - }; - - - typedef unsigned long GLogLevelFlags; /* enum mask */ - struct GLogMessage { /* accepted by 'GLogFunc' */ - /* string log_domain; always "Captive" */ - GLogLevelFlags log_level; - string message; - }; - exception GLogMessageFatal { - GLogMessage g_log_message; - }; - - interface GLogFunc { - /* Do not use 'oneway' as we would loose logging order coherency. */ - void g_log_func(in GLogMessage g_log_message); - }; - - - typedef unsigned long GnomeVFSFileType; /* enum */ - typedef unsigned short GnomeVFSFilePermissions; - typedef unsigned long long time_t; - typedef unsigned long long GnomeVFSFileSize; - typedef unsigned long long GnomeVFSFileFlags; - typedef long long GnomeVFSFileOffset; - typedef unsigned long GnomeVFSSeekPosition; /* enum */ - typedef unsigned long GnomeVFSSetFileInfoMask; /* enum mask */ - typedef unsigned long long GnomeVFSOpenMode; /* enum mask */ - struct GnomeVFSFileInfo { - string name; /* Base name of the file (no path). */ - /* File type (i.e. regular, directory, block device...). */ - GnomeVFSFileType type; - boolean type_valid; - GnomeVFSFilePermissions permissions; /* File permissions. */ - boolean permissions_valid; - GnomeVFSFileSize size; /* Size in bytes. */ - boolean size_valid; - GnomeVFSFileSize block_count; /* Size measured in units of 512-byte blocks. */ - boolean block_count_valid; - /* Access, modification and change times. */ - time_t atime; /* not valid if ==(time_t)0 */ - time_t mtime; /* not valid if ==(time_t)0 */ - time_t ctime; /* not valid if ==(time_t)0 */ - GnomeVFSFileFlags flags; - boolean flags_valid; - }; - - - typedef long long GInt64; - typedef unsigned long long GUInt64; - typedef unsigned long GSeekType; /* enum */ - typedef unsigned long GSize; - interface CaptiveIOChannel { - void read(out Bytes buffer,in GSize count) - raises (GIOStatusException,GLogMessageFatal); - void write(in Bytes buffer,out GSize bytes_written_return) - raises (GIOStatusException,GLogMessageFatal); - void seek(in GInt64 offset,in GSeekType type) - raises (GIOStatusException,GLogMessageFatal); - GUInt64 size() - raises (GLogMessageFatal); - }; - - - typedef unsigned long CaptiveOptionRwmode; /* enum */ - typedef unsigned long CaptiveOptionMedia; /* enum */ - struct CaptiveOptionsModule { - string pathname_utf8; - Bytes data; - }; - typedef sequence CaptiveOptionsModuleList; - struct CaptiveOptions { - GLogFunc g_log_func; - CaptiveOptionsModule filesystem; - CaptiveOptionRwmode rwmode; - CaptiveOptionMedia media; - boolean debug_messages; - CaptiveIOChannel image_iochannel; - CaptiveOptionsModuleList load_module; - }; - - - typedef unsigned long GUInt32; - struct CaptiveVfsVolumeInfo { - GUInt32 block_size; - GUInt64 bytes; - GUInt64 bytes_free; - GUInt64 bytes_available; - }; - - - interface Directory { - void read(out GnomeVFSFileInfo file_info) - raises (GnomeVFSResultException,GLogMessageFatal); - void remove() - raises (GnomeVFSResultException,GLogMessageFatal); - void shutdown(); - }; - - - interface File { - void read(out Bytes buffer,in GnomeVFSFileSize num_bytes) - raises (GnomeVFSResultException,GLogMessageFatal); - void write(in Bytes buffer,out GnomeVFSFileSize bytes_written_return) - raises (GnomeVFSResultException,GLogMessageFatal); - void seek(in GnomeVFSSeekPosition whence,in GnomeVFSFileOffset offset) - raises (GnomeVFSResultException,GLogMessageFatal); - void tell(out GnomeVFSFileOffset offset_return) - raises (GnomeVFSResultException,GLogMessageFatal); - void remove() - raises (GnomeVFSResultException,GLogMessageFatal); - void file_info_get(out GnomeVFSFileInfo file_info) - raises (GnomeVFSResultException,GLogMessageFatal); - void file_info_set(in GnomeVFSFileInfo file_info,in GnomeVFSSetFileInfoMask mask) - raises (GnomeVFSResultException,GLogMessageFatal); - void truncate(in GnomeVFSFileSize file_size) - raises (GnomeVFSResultException,GLogMessageFatal); - void move(in string pathname_new,in boolean force_replace) - raises (GnomeVFSResultException,GLogMessageFatal); - void shutdown(); - }; - - - interface Vfs { - void init(in CaptiveOptions options); - void shutdown(); - Directory directory_new_open(in string pathname) - raises (GnomeVFSResultException,GLogMessageFatal); - Directory directory_new_make(in string pathname,in GnomeVFSFilePermissions perm) - raises (GnomeVFSResultException,GLogMessageFatal); - File file_new_open(in string pathname,in GnomeVFSOpenMode mode) - raises (GnomeVFSResultException,GLogMessageFatal); - File file_new_create(in string pathname,in GnomeVFSOpenMode mode,in boolean exclusive,in unsigned long perm) - raises (GnomeVFSResultException,GLogMessageFatal); - void volume_info_get(out CaptiveVfsVolumeInfo volume_info) - raises (GnomeVFSResultException,GLogMessageFatal); - }; -}; diff --git a/src/libcaptive/sandbox/server-CaptiveIOChannel.c b/src/libcaptive/sandbox/server-CaptiveIOChannel.c deleted file mode 100644 index c09481d..0000000 --- a/src/libcaptive/sandbox/server-CaptiveIOChannel.c +++ /dev/null @@ -1,173 +0,0 @@ -/* $Id$ - * CORBA/ORBit client side of image GIOChannel object of sandbox_child() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "server-CaptiveIOChannel.h" /* self */ -#include "sandbox.h" -#include -#include "captive/macros.h" -#include "split.h" -#include -#include "captive/storage.h" - - -static void impl_Captive_CaptiveIOChannel_fini(impl_POA_Captive_CaptiveIOChannel *servant,CORBA_Environment *ev); -static void impl_Captive_CaptiveIOChannel_read(impl_POA_Captive_CaptiveIOChannel *servant, - Captive_Bytes **buffer_corba_return,const Captive_GSize count,CORBA_Environment *ev); -static void impl_Captive_CaptiveIOChannel_write(impl_POA_Captive_CaptiveIOChannel *servant, - const Captive_Bytes *buffer,Captive_GSize *bytes_written_return,CORBA_Environment *ev); -static void impl_Captive_CaptiveIOChannel_seek - (impl_POA_Captive_CaptiveIOChannel *servant,const Captive_GInt64 offset,const Captive_GSeekType type,CORBA_Environment *ev); -static Captive_GUInt64 impl_Captive_CaptiveIOChannel_size(impl_POA_Captive_CaptiveIOChannel *servant,CORBA_Environment *ev); - - -static PortableServer_ServantBase__epv impl_Captive_CaptiveIOChannel_base_epv={ - NULL, /* _private data */ - (gpointer)&impl_Captive_CaptiveIOChannel_fini, /* finalize routine */ - NULL, /* default_POA routine */ - }; -static POA_Captive_CaptiveIOChannel__epv impl_Captive_CaptiveIOChannel_epv={ - NULL, /* _private */ - (gpointer)&impl_Captive_CaptiveIOChannel_read, - (gpointer)&impl_Captive_CaptiveIOChannel_write, - (gpointer)&impl_Captive_CaptiveIOChannel_seek, - (gpointer)&impl_Captive_CaptiveIOChannel_size, - }; -static POA_Captive_CaptiveIOChannel__vepv impl_Captive_CaptiveIOChannel_vepv={ - &impl_Captive_CaptiveIOChannel_base_epv, - &impl_Captive_CaptiveIOChannel_epv, - }; - - -Captive_CaptiveIOChannel impl_Captive_CaptiveIOChannel__create - (PortableServer_POA poa,GIOChannel *image_iochannel,CORBA_Environment *ev) -{ -Captive_CaptiveIOChannel retval; -impl_POA_Captive_CaptiveIOChannel *newservant; -PortableServer_ObjectId *objid; - - captive_new0(newservant); /* FIXME: leak */ - newservant->servant.vepv=&impl_Captive_CaptiveIOChannel_vepv; - newservant->poa=poa; - - newservant->image_iochannel=image_iochannel; - - /* captive_giochannel_size() only _after_ g_io_channel_set_encoding() ! */ - newservant->image_size=captive_giochannel_size(newservant->image_iochannel); - g_return_val_if_fail(newservant->image_size>0,NULL); - - POA_Captive_CaptiveIOChannel__init((PortableServer_Servant)newservant,ev); - objid=PortableServer_POA_activate_object(poa,newservant,ev); - CORBA_free(objid); - retval=PortableServer_POA_servant_to_reference(poa,newservant,ev); - - return retval; -} - - -static void impl_Captive_CaptiveIOChannel_fini(impl_POA_Captive_CaptiveIOChannel *servant,CORBA_Environment *ev) -{ - /* FIXME: Any flushes? */ -} - - -void impl_Captive_CaptiveIOChannel__destroy(impl_POA_Captive_CaptiveIOChannel *servant,CORBA_Environment *ev) -{ -PortableServer_ObjectId *objid; - - objid=PortableServer_POA_servant_to_id(servant->poa,servant,ev); - PortableServer_POA_deactivate_object(servant->poa,objid,ev); - CORBA_free(objid); - impl_Captive_CaptiveIOChannel_fini(servant,ev); - g_free(servant); -} - - -static void impl_Captive_CaptiveIOChannel_read(impl_POA_Captive_CaptiveIOChannel *servant, - Captive_Bytes **buffer_corba_return,const Captive_GSize count,CORBA_Environment *ev) -{ -Captive_Bytes *buffer_corba; -gsize bytes_read; -GIOStatus erriostatus; - - buffer_corba=Captive_Bytes__alloc(); - buffer_corba->_maximum=count; - buffer_corba->_length=0; - buffer_corba->_buffer=Captive_Bytes_allocbuf(buffer_corba->_maximum); - buffer_corba->_release=TRUE; - - erriostatus=g_io_channel_read_chars(servant->image_iochannel, - (gchar *)buffer_corba->_buffer, /* buf */ - count, /* count */ - &bytes_read, /* bytes_read */ - NULL); /* error */ - if (erriostatus==G_IO_STATUS_EOF) { - g_assert(bytes_read==0); - bytes_read=0; - erriostatus=G_IO_STATUS_NORMAL; - } - if (erriostatus!=G_IO_STATUS_NORMAL) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,GNOME_VFS_ERROR_IO); - Captive_Bytes__freekids(buffer_corba,NULL/* 'd'; meaning? */); - CORBA_free(buffer_corba); - return; - } - - buffer_corba->_length=bytes_read; - *buffer_corba_return=buffer_corba; -} - - -static void impl_Captive_CaptiveIOChannel_write(impl_POA_Captive_CaptiveIOChannel *servant, - const Captive_Bytes *buffer_corba,Captive_GSize *bytes_written_return,CORBA_Environment *ev) -{ -gsize bytes_written; - - if (G_IO_STATUS_NORMAL!=g_io_channel_write_chars(servant->image_iochannel, - (const gchar *)buffer_corba->_buffer, /* buf */ - buffer_corba->_length, /* count */ - &bytes_written, /* bytes_written */ - NULL) /* error */ - || bytes_written!=buffer_corba->_length) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,GNOME_VFS_ERROR_IO); - return; - } - - *bytes_written_return=bytes_written; -} - - -static void impl_Captive_CaptiveIOChannel_seek - (impl_POA_Captive_CaptiveIOChannel *servant,const Captive_GInt64 offset,const Captive_GSeekType type,CORBA_Environment *ev) -{ - if (G_IO_STATUS_NORMAL!=g_io_channel_seek_position(servant->image_iochannel, - offset, /* offset */ - type, /* type */ - NULL)) { /* error */ - captive_sandbox_child_GnomeVFSResultException_throw(ev,GNOME_VFS_ERROR_IO); - return; - } -} - - -static Captive_GUInt64 impl_Captive_CaptiveIOChannel_size(impl_POA_Captive_CaptiveIOChannel *servant,CORBA_Environment *ev) -{ - return servant->image_size; -} diff --git a/src/libcaptive/sandbox/server-CaptiveIOChannel.h b/src/libcaptive/sandbox/server-CaptiveIOChannel.h deleted file mode 100644 index 8efbc0a..0000000 --- a/src/libcaptive/sandbox/server-CaptiveIOChannel.h +++ /dev/null @@ -1,45 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit client side of image GIOChannel object of sandbox_child() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _SERVER_CAPTIVEIOCHANNEL_H -#define _SERVER_CAPTIVEIOCHANNEL_H 1 - - -#include -#include "sandbox.h" - - -G_BEGIN_DECLS - -typedef struct { - POA_Captive_CaptiveIOChannel servant; - PortableServer_POA poa; - GIOChannel *image_iochannel; - guint64 image_size; - } impl_POA_Captive_CaptiveIOChannel; - - -Captive_CaptiveIOChannel impl_Captive_CaptiveIOChannel__create - (PortableServer_POA poa,GIOChannel *image_iochannel,CORBA_Environment *ev); -void impl_Captive_CaptiveIOChannel__destroy(impl_POA_Captive_CaptiveIOChannel *servant,CORBA_Environment *ev); - -G_END_DECLS - - -#endif /* _SERVER_CAPTIVEIOCHANNEL_H */ diff --git a/src/libcaptive/sandbox/server-Directory.c b/src/libcaptive/sandbox/server-Directory.c deleted file mode 100644 index 069db40..0000000 --- a/src/libcaptive/sandbox/server-Directory.c +++ /dev/null @@ -1,223 +0,0 @@ -/* $Id$ - * CORBA/ORBit server side of Directory object, ran by sandbox_child() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "server-Directory.h" /* self */ -#include "sandbox.h" -#include -#include "captive/macros.h" -#include "../client/directory.h" -#include "FileInfo.h" -#include "split.h" -#include "../client/vfs-slave.h" - - -static void impl_Captive_Directory_fini(impl_POA_Captive_Directory *servant,CORBA_Environment *ev); -static void impl_Captive_Directory_read - (impl_POA_Captive_Directory *servant,Captive_GnomeVFSFileInfo **file_info,CORBA_Environment *ev); -static void impl_Captive_Directory_remove(impl_POA_Captive_Directory *servant,CORBA_Environment *ev); -static void impl_Captive_Directory_shutdown(impl_POA_Captive_Directory *servant,CORBA_Environment *ev); - - -static PortableServer_ServantBase__epv impl_Captive_Directory_base_epv={ - NULL, /* _private data */ - (gpointer)&impl_Captive_Directory_fini, /* finalize routine */ - NULL, /* default_POA routine */ - }; -static POA_Captive_Directory__epv impl_Captive_Directory_epv={ - NULL, /* _private */ - (gpointer)&impl_Captive_Directory_read, - (gpointer)&impl_Captive_Directory_remove, - (gpointer)&impl_Captive_Directory_shutdown, - }; -static POA_Captive_Directory__vepv impl_Captive_Directory_vepv={ - &impl_Captive_Directory_base_epv, - &impl_Captive_Directory_epv, - }; - - -Captive_Directory impl_Captive_Directory__create(PortableServer_POA poa,CORBA_Environment *ev) -{ -Captive_Directory retval; -impl_POA_Captive_Directory *newservant; -PortableServer_ObjectId *objid; - - captive_new0(newservant); /* FIXME: leak */ - newservant->servant.vepv=&impl_Captive_Directory_vepv; - newservant->poa=poa; - newservant->captive_directory_object=NULL; - POA_Captive_Directory__init((PortableServer_Servant)newservant,ev); - objid=PortableServer_POA_activate_object(poa,newservant,ev); - CORBA_free(objid); - retval=PortableServer_POA_servant_to_reference(poa,newservant,ev); - - return retval; -} - - -static void impl_Captive_Directory_fini(impl_POA_Captive_Directory *servant,CORBA_Environment *ev) -{ - if (servant->captive_directory_object) { - g_object_unref(servant->captive_directory_object); - servant->captive_directory_object=NULL; - } -} - - -static void impl_Captive_Directory__destroy(impl_POA_Captive_Directory *servant,CORBA_Environment *ev) -{ -PortableServer_ObjectId *objid; - - objid=PortableServer_POA_servant_to_id(servant->poa,servant,ev); - PortableServer_POA_deactivate_object(servant->poa,objid,ev); - CORBA_free(objid); - impl_Captive_Directory_fini(servant,ev); - g_free(servant); -} - - -Captive_Directory impl_Captive_Vfs_directory_new_open - (impl_POA_Captive_Vfs *servant,const CORBA_char *pathname,CORBA_Environment *ev) -{ -Captive_Directory retval; -impl_POA_Captive_Directory *retval_servant; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(servant->captive_vfs_object),NULL); /* not yet initialized? */ - - retval=impl_Captive_Directory__create(servant->poa,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return NULL; - - retval_servant=PortableServer_POA_reference_to_servant(servant->poa,retval,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return NULL; /* 'retval' leak */ - - if (GNOME_VFS_OK!=(errvfsresult=captive_directory_new_open(&retval_servant->captive_directory_object, - servant->captive_vfs_object,pathname))) { - impl_Captive_Directory__destroy(retval_servant,ev); - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return NULL; - } - - return retval; -} - - -Captive_Directory impl_Captive_Vfs_directory_new_make(impl_POA_Captive_Vfs *servant, - const CORBA_char *pathname,const Captive_GnomeVFSFilePermissions perm,CORBA_Environment *ev) -{ -Captive_Directory retval; -impl_POA_Captive_Directory *retval_servant; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(servant->captive_vfs_object),NULL); /* not yet initialized? */ - - retval=impl_Captive_Directory__create(servant->poa,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return NULL; - - retval_servant=PortableServer_POA_reference_to_servant(servant->poa,retval,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return NULL; /* 'retval' leak */ - - if (GNOME_VFS_OK!=(errvfsresult=captive_directory_new_make(&retval_servant->captive_directory_object, - servant->captive_vfs_object,pathname,perm))) { - impl_Captive_Directory__destroy(retval_servant,ev); - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return NULL; - } - - return retval; -} - - -static void impl_Captive_Directory_read - (impl_POA_Captive_Directory *servant,Captive_GnomeVFSFileInfo **file_info_corba_return,CORBA_Environment *ev) -{ -GnomeVFSFileInfo file_info_captive; -Captive_GnomeVFSFileInfo *file_info_corba; -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_directory_read(servant->captive_directory_object,&file_info_captive))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } - - file_info_corba=Captive_GnomeVFSFileInfo__alloc(); - - if (GNOME_VFS_OK!=(errvfsresult=captive_sandbox_file_info_captive_to_corba( - file_info_corba,&file_info_captive))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - Captive_GnomeVFSFileInfo__freekids(file_info_corba,NULL/* 'd'; meaning? */); - CORBA_free(file_info_corba); - return; - } - - *file_info_corba_return=file_info_corba; -} - - -static void impl_Captive_Directory_remove(impl_POA_Captive_Directory *servant,CORBA_Environment *ev) -{ -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_directory_remove(servant->captive_directory_object))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } -} - - -static gboolean impl_Captive_Directory_shutdown_idle(impl_POA_Captive_Directory *servant /* data */) -{ - impl_Captive_Directory__destroy(servant,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - return FALSE; /* remove me */ -} - -static void impl_Captive_Directory_shutdown(impl_POA_Captive_Directory *servant,CORBA_Environment *ev) -{ -GSource *source; - - /* Shutdown 'servant->captive_directory_object' synchronously as it may - * flush its buffers needed to be transferred to our parent. - */ - impl_Captive_Directory_fini(servant,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Do not call impl_Captive_Directory__destroy() directly as we would fail - * to finish this CORBA method call properly. - * Do not call g_idle_add_full() as it would miss linc main loop. - * FIXME: STATUS_SHARING_VIOLATION error during batch processing. - * - probably exclusive access to be changed to shareable one - */ - source=g_idle_source_new (); - g_source_set_priority(source,G_PRIORITY_LOW); - g_source_set_callback( - source, /* source */ - (GSourceFunc)impl_Captive_Directory_shutdown_idle, /* func */ - servant, /* data */ - NULL); /* notify */ - g_source_attach(source, - captive_corba_get_context()); /* context; NULL means 'default context' */ - g_source_unref(source); -} diff --git a/src/libcaptive/sandbox/server-Directory.h b/src/libcaptive/sandbox/server-Directory.h deleted file mode 100644 index 462e312..0000000 --- a/src/libcaptive/sandbox/server-Directory.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit server side of Directory object - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _SERVER_DIRECTORY_H -#define _SERVER_DIRECTORY_H 1 - - -#include -#include "sandbox.h" -#include "captive/client-directory.h" -#include "server-Vfs.h" - - -G_BEGIN_DECLS - -typedef struct { - POA_Captive_Directory servant; - PortableServer_POA poa; - CaptiveDirectoryObject *captive_directory_object; - } impl_POA_Captive_Directory; - - -Captive_Directory impl_Captive_Directory__create(PortableServer_POA poa,CORBA_Environment *ev); -Captive_Directory impl_Captive_Vfs_directory_new_open - (impl_POA_Captive_Vfs *servant,const CORBA_char *pathname,CORBA_Environment *ev); -Captive_Directory impl_Captive_Vfs_directory_new_make(impl_POA_Captive_Vfs *servant, - const CORBA_char *pathname,const Captive_GnomeVFSFilePermissions perm,CORBA_Environment *ev); - -G_END_DECLS - - -#endif /* _SERVER_DIRECTORY_H */ diff --git a/src/libcaptive/sandbox/server-File.c b/src/libcaptive/sandbox/server-File.c deleted file mode 100644 index 48e94d8..0000000 --- a/src/libcaptive/sandbox/server-File.c +++ /dev/null @@ -1,355 +0,0 @@ -/* $Id$ - * CORBA/ORBit server side of File object, ran by sandbox_child() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "server-File.h" /* self */ -#include "sandbox.h" -#include -#include "captive/macros.h" -#include "split.h" -#include "FileInfo.h" -#include "../client/vfs-slave.h" - - -static void impl_Captive_File_fini(impl_POA_Captive_File *servant,CORBA_Environment *ev); -static void impl_Captive_File_read(impl_POA_Captive_File *servant,Captive_Bytes **buffer, - const Captive_GnomeVFSFileSize num_bytes,CORBA_Environment *ev); -static void impl_Captive_File_write(impl_POA_Captive_File *servant, - const Captive_Bytes *buffer,Captive_GnomeVFSFileSize *bytes_written_return,CORBA_Environment *ev); -static void impl_Captive_File_seek(impl_POA_Captive_File *servant, - const Captive_GnomeVFSSeekPosition whence,const Captive_GnomeVFSFileOffset offset,CORBA_Environment *ev); -static void impl_Captive_File_tell - (impl_POA_Captive_File *servant,Captive_GnomeVFSFileOffset *offset_return,CORBA_Environment *ev); -static void impl_Captive_File_remove(impl_POA_Captive_File *servant,CORBA_Environment *ev); -static void impl_Captive_File_file_info_get - (impl_POA_Captive_File *servant,Captive_GnomeVFSFileInfo **file_info,CORBA_Environment *ev); -static void impl_Captive_File_file_info_set(impl_POA_Captive_File *servant, - const Captive_GnomeVFSFileInfo *file_info,const Captive_GnomeVFSSetFileInfoMask mask,CORBA_Environment *ev); -static void impl_Captive_File_truncate - (impl_POA_Captive_File *servant,const Captive_GnomeVFSFileSize file_size,CORBA_Environment *ev); -static void impl_Captive_File_move - (impl_POA_Captive_File *servant,const CORBA_char *pathname_new,const CORBA_boolean force_replace,CORBA_Environment *ev); -static void impl_Captive_File_shutdown(impl_POA_Captive_File *servant,CORBA_Environment *ev); - - -static PortableServer_ServantBase__epv impl_Captive_File_base_epv={ - NULL, /* _private data */ - (gpointer)&impl_Captive_File_fini, /* finalize routine */ - NULL, /* default_POA routine */ - }; -static POA_Captive_File__epv impl_Captive_File_epv={ - NULL, /* _private */ - (gpointer)&impl_Captive_File_read, - (gpointer)&impl_Captive_File_write, - (gpointer)&impl_Captive_File_seek, - (gpointer)&impl_Captive_File_tell, - (gpointer)&impl_Captive_File_remove, - (gpointer)&impl_Captive_File_file_info_get, - (gpointer)&impl_Captive_File_file_info_set, - (gpointer)&impl_Captive_File_truncate, - (gpointer)&impl_Captive_File_move, - (gpointer)&impl_Captive_File_shutdown, - }; -static POA_Captive_File__vepv impl_Captive_File_vepv={ - &impl_Captive_File_base_epv, - &impl_Captive_File_epv, - }; - - -Captive_File impl_Captive_File__create(PortableServer_POA poa,CORBA_Environment *ev) -{ -Captive_File retval; -impl_POA_Captive_File *newservant; -PortableServer_ObjectId *objid; - - captive_new0(newservant); /* FIXME: leak */ - newservant->servant.vepv=&impl_Captive_File_vepv; - newservant->poa=poa; - newservant->captive_file_object=NULL; - POA_Captive_File__init((PortableServer_Servant)newservant,ev); - objid=PortableServer_POA_activate_object(poa,newservant,ev); - CORBA_free(objid); - retval=PortableServer_POA_servant_to_reference(poa,newservant,ev); - - return retval; -} - - -static void impl_Captive_File_fini(impl_POA_Captive_File *servant,CORBA_Environment *ev) -{ - if (servant->captive_file_object) { - g_object_unref(servant->captive_file_object); - servant->captive_file_object=NULL; - } -} - - -static void impl_Captive_File__destroy(impl_POA_Captive_File *servant,CORBA_Environment *ev) -{ -PortableServer_ObjectId *objid; - - objid=PortableServer_POA_servant_to_id(servant->poa,servant,ev); - PortableServer_POA_deactivate_object(servant->poa,objid,ev); - CORBA_free(objid); - impl_Captive_File_fini(servant,ev); - g_free(servant); -} - - -Captive_File impl_Captive_Vfs_file_new_open - (impl_POA_Captive_Vfs *servant,const CORBA_char *pathname,const Captive_GnomeVFSOpenMode mode,CORBA_Environment *ev) -{ -Captive_File retval; -impl_POA_Captive_File *retval_servant; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(servant->captive_vfs_object),NULL); /* not yet initialized? */ - - retval=impl_Captive_File__create(servant->poa,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return NULL; - - retval_servant=PortableServer_POA_reference_to_servant(servant->poa,retval,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return NULL; /* 'retval' leak */ - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&retval_servant->captive_file_object, - servant->captive_vfs_object,pathname,mode))) { - impl_Captive_File__destroy(retval_servant,ev); - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return NULL; - } - - return retval; -} - - -Captive_File impl_Captive_Vfs_file_new_create(impl_POA_Captive_Vfs *servant,const CORBA_char *pathname, - const Captive_GnomeVFSOpenMode mode,const CORBA_boolean exclusive,const CORBA_unsigned_long perm,CORBA_Environment *ev) -{ -Captive_File retval; -impl_POA_Captive_File *retval_servant; -GnomeVFSResult errvfsresult; - - g_return_val_if_fail(CAPTIVE_VFS_SLAVE_IS_OBJECT(servant->captive_vfs_object),NULL); /* not yet initialized? */ - - retval=impl_Captive_File__create(servant->poa,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return NULL; - - retval_servant=PortableServer_POA_reference_to_servant(servant->poa,retval,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return NULL; /* 'retval' leak */ - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_create(&retval_servant->captive_file_object, - servant->captive_vfs_object,pathname,mode,exclusive,perm))) { - impl_Captive_File__destroy(retval_servant,ev); - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return NULL; - } - - return retval; -} - - -static void impl_Captive_File_read(impl_POA_Captive_File *servant,Captive_Bytes **buffer_corba_return, - const Captive_GnomeVFSFileSize num_bytes,CORBA_Environment *ev) -{ -Captive_Bytes *buffer_corba; -GnomeVFSFileSize bytes_read; -GnomeVFSResult errvfsresult; - - buffer_corba=Captive_Bytes__alloc(); - buffer_corba->_maximum=num_bytes; - buffer_corba->_length=0; - buffer_corba->_buffer=Captive_Bytes_allocbuf(buffer_corba->_maximum); - buffer_corba->_release=TRUE; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_read(servant->captive_file_object, - buffer_corba->_buffer,num_bytes,&bytes_read))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - Captive_Bytes__freekids(buffer_corba,NULL/* 'd'; meaning? */); - CORBA_free(buffer_corba); - return; - } - - buffer_corba->_length=bytes_read; - *buffer_corba_return=buffer_corba; -} - - -static void impl_Captive_File_write(impl_POA_Captive_File *servant, - const Captive_Bytes *buffer_corba,Captive_GnomeVFSFileSize *bytes_written_return,CORBA_Environment *ev) -{ -GnomeVFSFileSize bytes_written; -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_write(servant->captive_file_object, - buffer_corba->_buffer,buffer_corba->_length,&bytes_written))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } - - *bytes_written_return=bytes_written; -} - - -static void impl_Captive_File_seek(impl_POA_Captive_File *servant, - const Captive_GnomeVFSSeekPosition whence,const Captive_GnomeVFSFileOffset offset,CORBA_Environment *ev) -{ -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_seek(servant->captive_file_object,whence,offset))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } -} - - -static void impl_Captive_File_tell - (impl_POA_Captive_File *servant,Captive_GnomeVFSFileOffset *offset_return,CORBA_Environment *ev) -{ -GnomeVFSFileOffset offset_captive; -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_tell(servant->captive_file_object,&offset_captive))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } - - *offset_return=offset_captive; -} - - -static void impl_Captive_File_remove(impl_POA_Captive_File *servant,CORBA_Environment *ev) -{ -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_remove(servant->captive_file_object))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } -} - - -static void impl_Captive_File_file_info_get - (impl_POA_Captive_File *servant,Captive_GnomeVFSFileInfo **file_info_corba_return,CORBA_Environment *ev) -{ -GnomeVFSFileInfo file_info_captive; -GnomeVFSResult errvfsresult; -Captive_GnomeVFSFileInfo *file_info_corba; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_file_info_get(servant->captive_file_object,&file_info_captive))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } - - file_info_corba=Captive_GnomeVFSFileInfo__alloc(); - - if (GNOME_VFS_OK!=(errvfsresult=captive_sandbox_file_info_captive_to_corba( - file_info_corba,&file_info_captive))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - Captive_GnomeVFSFileInfo__freekids(file_info_corba,NULL/* 'd'; meaning? */); - CORBA_free(file_info_corba); - return; - } - - *file_info_corba_return=file_info_corba; -} - - -static void impl_Captive_File_file_info_set(impl_POA_Captive_File *servant, - const Captive_GnomeVFSFileInfo *file_info_corba,const Captive_GnomeVFSSetFileInfoMask mask,CORBA_Environment *ev) -{ -GnomeVFSFileInfo file_info_captive; -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_sandbox_file_info_corba_to_captive( - &file_info_captive,file_info_corba))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_file_info_set(servant->captive_file_object,&file_info_captive,mask))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } -} - - -static void impl_Captive_File_truncate - (impl_POA_Captive_File *servant,const Captive_GnomeVFSFileSize file_size,CORBA_Environment *ev) -{ -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_truncate(servant->captive_file_object,file_size))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } -} - - -static void impl_Captive_File_move - (impl_POA_Captive_File *servant,const CORBA_char *pathname_new,const CORBA_boolean force_replace,CORBA_Environment *ev) -{ -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_file_move(servant->captive_file_object,pathname_new,force_replace))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } -} - - -static gboolean impl_Captive_File_shutdown_idle(impl_POA_Captive_File *servant /* data */) -{ - impl_Captive_File__destroy(servant,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - return FALSE; /* remove me */ -} - -static void impl_Captive_File_shutdown(impl_POA_Captive_File *servant,CORBA_Environment *ev) -{ -GSource *source; - - /* Shutdown 'servant->captive_file_object' synchronously as it may - * flush its buffers needed to be transferred to our parent. - */ - impl_Captive_File_fini(servant,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Do not call impl_Captive_File__destroy() directly as we would fail - * to finish this CORBA method call properly. - * Do not call g_idle_add_full() as it would miss linc main loop. - * FIXME: STATUS_SHARING_VIOLATION error during batch processing. - * - probably exclusive access to be changed to shareable one - */ - source=g_idle_source_new (); - g_source_set_priority(source,G_PRIORITY_LOW); - g_source_set_callback( - source, /* source */ - (GSourceFunc)impl_Captive_File_shutdown_idle, /* func */ - servant, /* data */ - NULL); /* notify */ - g_source_attach(source, - captive_corba_get_context()); /* context; NULL means 'default context' */ - g_source_unref(source); -} diff --git a/src/libcaptive/sandbox/server-File.h b/src/libcaptive/sandbox/server-File.h deleted file mode 100644 index c96a7e5..0000000 --- a/src/libcaptive/sandbox/server-File.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit server side of File object - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _SERVER_FILE_H -#define _SERVER_FILE_H 1 - - -#include -#include "sandbox.h" -#include "captive/client-file.h" -#include "server-Vfs.h" - - -G_BEGIN_DECLS - -typedef struct { - POA_Captive_File servant; - PortableServer_POA poa; - CaptiveFileObject *captive_file_object; - } impl_POA_Captive_File; - - -Captive_File impl_Captive_File__create(PortableServer_POA poa,CORBA_Environment *ev); -Captive_File impl_Captive_Vfs_file_new_open - (impl_POA_Captive_Vfs *servant,const CORBA_char *pathname,const Captive_GnomeVFSOpenMode mode,CORBA_Environment *ev); -Captive_File impl_Captive_Vfs_file_new_create(impl_POA_Captive_Vfs *servant,const CORBA_char *pathname, - const Captive_GnomeVFSOpenMode mode,const CORBA_boolean exclusive,const CORBA_unsigned_long perm,CORBA_Environment *ev); - -G_END_DECLS - - -#endif /* _SERVER_FILE_H */ diff --git a/src/libcaptive/sandbox/server-GLogFunc.c b/src/libcaptive/sandbox/server-GLogFunc.c deleted file mode 100644 index 36b47e0..0000000 --- a/src/libcaptive/sandbox/server-GLogFunc.c +++ /dev/null @@ -1,204 +0,0 @@ -/* $Id$ - * CORBA/ORBit server side of GLogFunc object, ran by sandbox_parent() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "server-GLogFunc.h" /* self */ -#include "sandbox.h" -#include "split.h" -#include -#include "captive/macros.h" -#include -#include "../client/vfs-parent.h" - - -static void impl_Captive_GLogFunc_g_log_func - (impl_POA_Captive_GLogFunc *servant,const Captive_GLogMessage *g_log_message,CORBA_Environment *ev); - -static PortableServer_ServantBase__epv impl_Captive_GLogFunc_base_epv={ - NULL, /* _private data */ - NULL, /* finalize routine */ - NULL, /* default_POA routine */ - }; -static POA_Captive_GLogFunc__epv impl_Captive_GLogFunc_epv={ - NULL, /* _private */ - (gpointer)&impl_Captive_GLogFunc_g_log_func, - }; -static POA_Captive_GLogFunc__vepv impl_Captive_GLogFunc_vepv={ - &impl_Captive_GLogFunc_base_epv, - &impl_Captive_GLogFunc_epv, - }; - - -Captive_GLogFunc impl_Captive_GLogFunc__create - (PortableServer_POA poa,CaptiveVfsParentObject *captive_vfs_parent_object,CORBA_Environment *ev) -{ -Captive_GLogFunc retval; -impl_POA_Captive_GLogFunc *newservant; -PortableServer_ObjectId *objid; - - captive_new0(newservant); /* FIXME: leak */ - newservant->servant.vepv=&impl_Captive_GLogFunc_vepv; - newservant->poa=poa; - newservant->captive_vfs_parent_object=captive_vfs_parent_object; - POA_Captive_GLogFunc__init((PortableServer_Servant)newservant,ev); - objid=PortableServer_POA_activate_object(poa,newservant,ev); - CORBA_free(objid); - retval=PortableServer_POA_servant_to_reference(poa,newservant,ev); - - return retval; -} - - -void impl_Captive_GLogFunc__destroy(impl_POA_Captive_GLogFunc *servant,CORBA_Environment *ev) -{ -PortableServer_ObjectId *objid; - - objid=PortableServer_POA_servant_to_id(servant->poa,servant,ev); - PortableServer_POA_deactivate_object(servant->poa,objid,ev); - CORBA_free(objid); - POA_Captive_GLogFunc__fini((PortableServer_Servant)servant,ev); - g_free(servant); -} - - -static void impl_Captive_GLogFunc_g_log_func - (impl_POA_Captive_GLogFunc *servant,const Captive_GLogMessage *g_log_message,CORBA_Environment *ev) -{ -GLogLevelFlags log_level_use; -static const struct level_map { - GLogLevelFlags from,to; - const gchar *name; - } level_map[]={ - /* Downgrade always-fatal 'ERROR' to 'CRITICAL' level */ - { G_LOG_LEVEL_ERROR ,G_LOG_LEVEL_CRITICAL,"error" }, - { G_LOG_LEVEL_CRITICAL,G_LOG_LEVEL_CRITICAL,"critical" }, - { G_LOG_LEVEL_WARNING ,G_LOG_LEVEL_WARNING ,"warning" }, - { G_LOG_LEVEL_MESSAGE ,G_LOG_LEVEL_MESSAGE ,"message" }, - { G_LOG_LEVEL_INFO ,G_LOG_LEVEL_INFO ,"info" }, - { G_LOG_LEVEL_DEBUG ,G_LOG_LEVEL_DEBUG ,"debug" }, - }; -static const struct flag_map { - GLogLevelFlags from,to; - const gchar *name; - } flag_map[]={ - { G_LOG_FLAG_RECURSION,G_LOG_FLAG_RECURSION,"recursion" }, - { G_LOG_FLAG_FATAL ,0 ,"fatal" }, - }; -const struct level_map *levelp; -const struct flag_map *flagp; - - for (levelp=level_map;levelplog_level; - if (!(g_log_message->log_level & levelp->from)) - continue; - { - xmlNode *xml_message=NULL; - - if (servant->captive_vfs_parent_object->corba_bug_log) { - xml_message=xmlNewTextChild(servant->captive_vfs_parent_object->corba_bug_log,NULL,BAD_CAST "message",BAD_CAST g_log_message->message); - xmlNewProp(xml_message,BAD_CAST "level",BAD_CAST levelp->name); - } - - log_level_use&=~levelp->from; - log_level_use|= levelp->to; - for (flagp=flag_map;flagplog_level & flagp->from)) - continue; - log_level_use&=~flagp->from; - log_level_use|= flagp->to; - if (xml_message) - xmlNewProp(xml_message,BAD_CAST flagp->name,BAD_CAST flagp->name); - } - } - g_log(G_LOG_DOMAIN,log_level_use,"sandbox: %s%s", - (!(g_log_message->log_level & G_LOG_FLAG_FATAL) ? "" : "FATAL: "), - g_log_message->message); - } -} - - -static void impl_Captive_Vfs_init_g_log_func_log_func - (const gchar *log_domain,GLogLevelFlags log_level,const gchar *message,const Captive_GLogFunc obj /* user_data */) -{ -CORBA_Environment ev; -Captive_GLogMessage g_log_message; - - CORBA_exception_init(&ev); - g_log_message.log_level=log_level; - g_log_message.message=(CORBA_string)message; - Captive_GLogFunc_g_log_func(obj,&g_log_message,&ev); - g_assert(validate_CORBA_Environment(&ev)); - CORBA_exception_free(&ev); -} - - -static gboolean impl_Captive_Vfs_init_g_log_func_handled=FALSE; -static guint impl_Captive_Vfs_init_g_log_func_handler_id; -static Captive_GLogFunc g_log_func_copy; - - -/* We MUST NOT touch 'captive_options' as it may not be initialized yet - */ -void impl_Captive_Vfs_init_g_log_func(const Captive_GLogFunc g_log_func,gboolean debug_messages,CORBA_Environment *ev) -{ - g_assert(impl_Captive_Vfs_init_g_log_func_handled==FALSE); - - g_log_func_copy=CORBA_Object_duplicate(g_log_func,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return; - - impl_Captive_Vfs_init_g_log_func_handler_id=g_log_set_handler( - G_LOG_DOMAIN, /* log_domain; "Captive" */ - 0 /* log_levels */ - | 0 /* !G_LOG_FLAG_RECURSION */ - | G_LOG_FLAG_FATAL - | (G_LOG_LEVEL_MASK & ~(debug_messages ? 0 : 0 - /* The same mask is in: - * libcaptive/sandbox/server-GLogFunc.c - * libcaptive/client/init.c - */ - | G_LOG_LEVEL_MESSAGE - | G_LOG_LEVEL_INFO - | G_LOG_LEVEL_DEBUG)), - (GLogFunc)impl_Captive_Vfs_init_g_log_func_log_func, /* log_func */ - (gpointer)g_log_func_copy); /* user_data */ - - impl_Captive_Vfs_init_g_log_func_handled=TRUE; -} - - -/* Called during child shutdown where our CORBA peer is no longer responding. */ -void impl_Captive_Vfs_init_g_log_func_disable(void) -{ -CORBA_Environment ev; - - if (!impl_Captive_Vfs_init_g_log_func_handled) - return; - - g_log_remove_handler( - G_LOG_DOMAIN, /* log_domain; "Captive" */ - impl_Captive_Vfs_init_g_log_func_handler_id); /* handler_id */ - CORBA_exception_init(&ev); - CORBA_Object_release(g_log_func_copy,&ev); - g_assert(validate_CORBA_Environment(&ev)); - CORBA_exception_free(&ev); - - impl_Captive_Vfs_init_g_log_func_handled=FALSE; -} diff --git a/src/libcaptive/sandbox/server-GLogFunc.h b/src/libcaptive/sandbox/server-GLogFunc.h deleted file mode 100644 index be47472..0000000 --- a/src/libcaptive/sandbox/server-GLogFunc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit server side of GLogFunc object - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _SERVER_GLOGFUNC_H -#define _SERVER_GLOGFUNC_H 1 - - -#include -#include "sandbox.h" -#include "server-Vfs.h" /* for impl_POA_Captive_Vfs */ -#include "../client/vfs-parent.h" - - -G_BEGIN_DECLS - -typedef struct { - POA_Captive_GLogFunc servant; - PortableServer_POA poa; - CaptiveVfsParentObject *captive_vfs_parent_object; - } impl_POA_Captive_GLogFunc; - - -void impl_Captive_Vfs_init_g_log_func(const Captive_GLogFunc g_log_func,gboolean debug_messages,CORBA_Environment *ev); -Captive_GLogFunc impl_Captive_GLogFunc__create - (PortableServer_POA poa,CaptiveVfsParentObject *captive_vfs_parent_object,CORBA_Environment *ev); -void impl_Captive_GLogFunc__destroy(impl_POA_Captive_GLogFunc *servant,CORBA_Environment *ev); -void impl_Captive_Vfs_init_g_log_func_disable(void); - -G_END_DECLS - - -#endif /* _SERVER_GLOGFUNC_H */ diff --git a/src/libcaptive/sandbox/server-Vfs.c b/src/libcaptive/sandbox/server-Vfs.c deleted file mode 100644 index 28affd3..0000000 --- a/src/libcaptive/sandbox/server-Vfs.c +++ /dev/null @@ -1,236 +0,0 @@ -/* $Id$ - * CORBA/ORBit server side of Vfs object, ran by sandbox_child() - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "server-Vfs.h" /* self */ -#include "sandbox.h" -#include -#include "captive/macros.h" -#include "server-Directory.h" -#include "server-File.h" -#include "split.h" -#include "server-GLogFunc.h" -#include "client-CaptiveIOChannel.h" -#include "../client/vfs-slave.h" - - -static void impl_Captive_Vfs_fini(impl_POA_Captive_Vfs *servant,CORBA_Environment *ev); -static void impl_Captive_Vfs_init - (impl_POA_Captive_Vfs *servant,const Captive_CaptiveOptions *options_corba,CORBA_Environment *ev); -static void impl_Captive_Vfs_shutdown(impl_POA_Captive_Vfs *servant,CORBA_Environment *ev); -static void impl_Captive_Vfs_volume_info_get - (impl_POA_Captive_Vfs *servant,Captive_CaptiveVfsVolumeInfo *volume_info_corba,CORBA_Environment *ev); - -static PortableServer_ServantBase__epv impl_Captive_Vfs_base_epv={ - NULL, /* _private data */ - (gpointer)&impl_Captive_Vfs_fini, /* finalize routine */ - NULL, /* default_POA routine */ - }; -static POA_Captive_Vfs__epv impl_Captive_Vfs_epv={ - NULL, /* _private */ - (gpointer)&impl_Captive_Vfs_init, - (gpointer)&impl_Captive_Vfs_shutdown, - (gpointer)&impl_Captive_Vfs_directory_new_open, - (gpointer)&impl_Captive_Vfs_directory_new_make, - (gpointer)&impl_Captive_Vfs_file_new_open, - (gpointer)&impl_Captive_Vfs_file_new_create, - (gpointer)&impl_Captive_Vfs_volume_info_get, - }; -static POA_Captive_Vfs__vepv impl_Captive_Vfs_vepv={ - &impl_Captive_Vfs_base_epv, - &impl_Captive_Vfs_epv, - }; - - -Captive_Vfs impl_Captive_Vfs__create(PortableServer_POA poa,CORBA_Environment *ev) -{ -Captive_Vfs retval; -impl_POA_Captive_Vfs *newservant; -PortableServer_ObjectId *objid; - - captive_new0(newservant); /* FIXME: leak */ - newservant->servant.vepv=&impl_Captive_Vfs_vepv; - newservant->poa=poa; - newservant->captive_vfs_object=NULL; - POA_Captive_Vfs__init((PortableServer_Servant)newservant,ev); - objid=PortableServer_POA_activate_object(poa,newservant,ev); - CORBA_free(objid); - retval=PortableServer_POA_servant_to_reference(poa,newservant,ev); - - return retval; -} - - -static void impl_Captive_Vfs_fini(impl_POA_Captive_Vfs *servant,CORBA_Environment *ev) -{ - if (servant->captive_vfs_object) { - g_object_unref(servant->captive_vfs_object); - servant->captive_vfs_object=NULL; - } -} - - -static Captive_CaptiveIOChannel options_corba_image_iochannel_copy; - -void impl_Captive_Vfs__destroy(impl_POA_Captive_Vfs *servant,CORBA_Environment *ev) -{ -PortableServer_ObjectId *objid; - - objid=PortableServer_POA_servant_to_id(servant->poa,servant,ev); - PortableServer_POA_deactivate_object(servant->poa,objid,ev); - CORBA_free(objid); - impl_Captive_Vfs_fini(servant,ev); - CORBA_Object_release(options_corba_image_iochannel_copy,ev); - g_free(servant); -} - - -static void options_module_corba_to_options_module_captive - (struct captive_options_module *dest_options_module_captive,const Captive_CaptiveOptionsModule *src_options_module_corba) -{ - g_return_if_fail(dest_options_module_captive!=NULL); - g_return_if_fail(src_options_module_corba!=NULL); - - dest_options_module_captive->pathname_utf8=g_strdup(src_options_module_corba->pathname_utf8); - dest_options_module_captive->type=CAPTIVE_OPTIONS_MODULE_TYPE_PE32; - dest_options_module_captive->u.pe32.base=g_memdup(src_options_module_corba->data._buffer, - src_options_module_corba->data._length); - dest_options_module_captive->u.pe32.length=src_options_module_corba->data._length; - dest_options_module_captive->u.pe32.mapped=FALSE; - /* 'md5' is never used in sandbox client; XML is dumped by the master. */ - dest_options_module_captive->u.pe32.md5=g_strdup(""); -} - - -static void impl_Captive_Vfs_init - (impl_POA_Captive_Vfs *servant,const Captive_CaptiveOptions *options_corba,CORBA_Environment *ev) -{ -struct captive_options options_captive; -GnomeVFSResult errvfsresult; -guint moduleui; - - g_return_if_fail(servant->captive_vfs_object==NULL); - - options_corba_image_iochannel_copy=CORBA_Object_duplicate(options_corba->image_iochannel,ev); - if (ev->_major!=CORBA_NO_EXCEPTION) - return; - - /* impl_Captive_Vfs_init_g_log_func() does its own copy of 'options_corba->g_log_func'. */ - impl_Captive_Vfs_init_g_log_func(options_corba->g_log_func,options_corba->debug_messages,ev); - - captive_options_init(&options_captive); - - options_module_corba_to_options_module_captive(&options_captive.filesystem,&options_corba->filesystem); - - options_captive.debug_messages=options_corba->debug_messages; - options_captive.rwmode =options_corba->rwmode; - options_captive.media =options_corba->media; - - options_captive.image_iochannel=(GIOChannel *)captive_io_channel_new( - options_corba_image_iochannel_copy, /* corba_captive_io_channel */ - (options_captive.rwmode!=CAPTIVE_OPTION_RWMODE_RO)); /* writeable */ - - for (moduleui=0;moduleuiload_module._length;moduleui++) { -struct captive_options_module *options_module; - - captive_new(options_module); - options_module_corba_to_options_module_captive(options_module,options_corba->load_module._buffer+moduleui); - options_captive.load_module=g_list_append(options_captive.load_module,options_module); - } - - options_captive.sandbox=TRUE; - g_assert(options_captive.sandbox_server_argv==NULL); - g_assert(options_captive.sandbox_server_ior==NULL); - - if (GNOME_VFS_OK!=(errvfsresult=captive_vfs_new(&servant->captive_vfs_object,&options_captive))) { - CORBA_exception_set(ev,CORBA_USER_EXCEPTION,ex_Captive_GnomeVFSResultException,GINT_TO_POINTER((gint)errvfsresult)); - captive_options_free(&options_captive); - return; - } - - captive_options_free(&options_captive); - - g_assert(CAPTIVE_VFS_SLAVE_IS_OBJECT(servant->captive_vfs_object)); -} - - -#if 0 /* Currently unused - see impl_Captive_Vfs_shutdown() */ -static gboolean impl_Captive_Vfs_shutdown_idle(gpointer data /* unused */) -{ - sandbox_child_shutdown(); - - return FALSE; /* remove me */ -} -#endif - -static void impl_Captive_Vfs_shutdown(impl_POA_Captive_Vfs *servant,CORBA_Environment *ev) -{ -#if 0 /* Currently unused - see impl_Captive_Vfs_shutdown() */ -GSource *source; -#endif - - /* Shutdown 'servant->captive_vfs_object' synchronously as it may - * flush its buffers needed to be transferred to our parent. - */ - impl_Captive_Vfs_fini(servant,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Currently we do not do any sandbox child shutdown here as it sometimes - * crashes the parent with COMM_FAILURE without proper finish of this - * shutdown() CORBA method call. Parent will kill(2) us soon - * from its parent-Vfs.c:captive_sandbox_parent_vfs_close() anyway. - */ -#if 0 - sandbox_child_prepare_shutdown(); - - /* Do not call sandbox_child_shutdown() directly as we would fail - * to finish this CORBA method call properly. - * Do not call g_idle_add_full() as it would miss linc main loop. - */ - source=g_idle_source_new (); - g_source_set_priority(source,G_PRIORITY_LOW); - g_source_set_callback( - source, /* source */ - (GSourceFunc)impl_Captive_Vfs_shutdown_idle, /* func */ - servant, /* data */ - NULL); /* notify */ - g_source_attach(source, - captive_corba_get_context()); /* context; NULL means 'default context' */ - g_source_unref(source); -#endif -} - - -static void impl_Captive_Vfs_volume_info_get - (impl_POA_Captive_Vfs *servant,Captive_CaptiveVfsVolumeInfo *volume_info_corba,CORBA_Environment *ev) -{ -CaptiveVfsVolumeInfo volume_info_captive; -GnomeVFSResult errvfsresult; - - if (GNOME_VFS_OK!=(errvfsresult=captive_vfs_volume_info_get(servant->captive_vfs_object,&volume_info_captive))) { - captive_sandbox_child_GnomeVFSResultException_throw(ev,errvfsresult); - return; - } - - volume_info_corba->block_size =volume_info_captive.block_size; - volume_info_corba->bytes =volume_info_captive.bytes; - volume_info_corba->bytes_free =volume_info_captive.bytes_free; - volume_info_corba->bytes_available=volume_info_captive.bytes_available; -} diff --git a/src/libcaptive/sandbox/server-Vfs.h b/src/libcaptive/sandbox/server-Vfs.h deleted file mode 100644 index 19e76f8..0000000 --- a/src/libcaptive/sandbox/server-Vfs.h +++ /dev/null @@ -1,44 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit server side of Vfs object - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _SERVER_VFS_H -#define _SERVER_VFS_H 1 - - -#include -#include "sandbox.h" -#include "captive/client-vfs.h" - - -G_BEGIN_DECLS - -typedef struct { - POA_Captive_Vfs servant; - PortableServer_POA poa; - CaptiveVfsObject *captive_vfs_object; - } impl_POA_Captive_Vfs; - - -Captive_Vfs impl_Captive_Vfs__create(PortableServer_POA poa,CORBA_Environment *ev); -void impl_Captive_Vfs__destroy(impl_POA_Captive_Vfs *servant,CORBA_Environment *ev); - -G_END_DECLS - - -#endif /* _SERVER_VFS_H */ diff --git a/src/libcaptive/sandbox/split.c b/src/libcaptive/sandbox/split.c deleted file mode 100644 index 24b3089..0000000 --- a/src/libcaptive/sandbox/split.c +++ /dev/null @@ -1,1032 +0,0 @@ -/* $Id$ - * Connection of captive-vfs interface through CORBA/ORBit - * Copyright (C) 2002-2005 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "split.h" /* self */ -#include "sandbox.h" -#include "server-GLogFunc.h" -#include "captive/macros.h" -#include -#include -#include "captive/rtl-file.h" -#include -#include -#include "server-Directory.h" -#include "server-Vfs.h" -#include "../client/vfs.h" -#include "parent-Vfs.h" -#include -#include "server-CaptiveIOChannel.h" -#include -#include "../client/giochannel-blind.h" /* for captive_giochannel_blind_new() */ -#include -#include "../storage/relastblock.h" /* for captive_storage_relastblock() */ -#include /* flock() */ - -#ifdef HAVE_ORBIT_LINK -void link_set_tmpdir(const char *dir); -#else -#include /* for linc_main_get_loop() */ -#endif - - -/* CONFIG: */ - -#define HEARTBEAT_SOURCE_CHECK_EVENTS (G_IO_IN|G_IO_PRI) -#define HEARTBEAT_SOURCE_CHECK_REVENTS (HEARTBEAT_SOURCE_CHECK_EVENTS|G_IO_ERR|G_IO_HUP|G_IO_NVAL) - - -gboolean validate_CORBA_Environment(CORBA_Environment *evp) -{ - if (evp->_major==CORBA_NO_EXCEPTION) - return TRUE; - - g_error(_("CORBA Exception occured: id=\"%s\", value=%p"), - CORBA_exception_id(evp),CORBA_exception_value(evp)); - /* NOTREACHED */ - return FALSE; /* GCC happiness. */ -} - -CORBA_Environment captive_corba_ev; -CORBA_ORB captive_corba_orb; -PortableServer_POA captive_corba_poa; - -static void corba_shutdown_atexit(void); - -static gboolean corba_init(const char *pname,CORBA_Environment *evp,CORBA_ORB *orbp,PortableServer_POA *poap) -{ -static gboolean done=FALSE; -int orb_argc=1; -gchar *orb_argv[]={ - (gchar *)captive_strdup_alloca(pname), - NULL}; - - g_return_val_if_fail(evp!=NULL,FALSE); - g_return_val_if_fail(orbp!=NULL,FALSE); - g_return_val_if_fail(poap!=NULL,FALSE); - - if (done) - return TRUE; /* FIXME: '*poap' is left invalid! */ - - /* Init 'ev' */ - CORBA_exception_init(evp); - - /* Init 'orb' */ - /* libcaptive is single-threaded only, caller must lock it. - * If thread A spawned the sandbox while currently doing its own work - * and thread B calls the sandbox thread B waits on ORB_run() - * while the sandbox waits for the response of thread A ORB. Deadlock. - * "orbit-local-non-threaded-orb" requests thread unaware ORB. - */ - *orbp=CORBA_ORB_init(&orb_argc,orb_argv,"orbit-local-non-threaded-orb",evp); - g_return_val_if_fail(*orbp!=CORBA_OBJECT_NIL,FALSE); - g_return_val_if_fail(validate_CORBA_Environment(evp),FALSE); - - /* Init 'poa' */ - *poap=(PortableServer_POA)CORBA_ORB_resolve_initial_references(*orbp,"RootPOA",evp); - g_return_val_if_fail(validate_CORBA_Environment(evp),FALSE); - { -PortableServer_POAManager poa_mgr; - poa_mgr=PortableServer_POA__get_the_POAManager(*poap,evp); - g_return_val_if_fail(validate_CORBA_Environment(evp),FALSE); - PortableServer_POAManager_activate(poa_mgr,evp); - g_return_val_if_fail(validate_CORBA_Environment(evp),FALSE); - CORBA_Object_release((CORBA_Object)poa_mgr,evp); - g_return_val_if_fail(validate_CORBA_Environment(evp),FALSE); - } - - g_atexit(corba_shutdown_atexit); - - done=TRUE; - return TRUE; -} - - -static CORBA_ORB heartbeat_source_callback_orb=CORBA_OBJECT_NIL; - -gboolean corba_shutdown(CORBA_Environment *evp,CORBA_ORB *orbp,PortableServer_POA *poap) -{ -PortableServer_POA poa; -CORBA_ORB orb; - - g_return_val_if_fail(evp!=NULL,FALSE); - g_return_val_if_fail(orbp!=NULL,FALSE); - g_return_val_if_fail(poap!=NULL,FALSE); - - /* Shutdown 'poa' */ - poa=*poap; - *poap=CORBA_OBJECT_NIL; - CORBA_Object_release((CORBA_Object)poa,evp); - g_return_val_if_fail(validate_CORBA_Environment(evp),FALSE); - - /* Shutdown 'orb' */ - orb=*orbp; - *orbp=CORBA_OBJECT_NIL; - heartbeat_source_callback_orb=CORBA_OBJECT_NIL; - CORBA_ORB_destroy(orb,evp); - /* Do not: g_return_val_if_fail(validate_CORBA_Environment(evp),FALSE); - * here as CORBA_ORB_destroy() sometimes reports: - * WARNING **: ORB: a total of X refs to X ORB objects were leaked - */ - CORBA_exception_free(evp); - - /* Shutdown 'ev' */ - CORBA_exception_free(evp); - - return TRUE; -} - -static void sandbox_parent_own_orbit_dir_cleanup_atexit(void); - -static void corba_shutdown_atexit(void) -{ -gboolean errbool; - - errbool=corba_shutdown(&captive_corba_ev,&captive_corba_orb,&captive_corba_poa); - g_assert(errbool==TRUE); - - /* Delete the CORBA ORB socket directory only after full CORBA ORB shutdown. */ - sandbox_parent_own_orbit_dir_cleanup_atexit(); -} - - -static GSource *captive_corba_sandbox_child_heartbeat_gsource; - -#if 0 /* Currently unused - see server-Vfs.c:impl_Captive_Vfs_shutdown() */ -void sandbox_child_prepare_shutdown(void) -{ - /* Prevent during shutdown: Captive-WARNING **: CORBA Exception occured: id="IDL:omg.org/CORBA/COMM_FAILURE:1.0" */ - if (captive_corba_sandbox_child_heartbeat_gsource) { - g_source_destroy(captive_corba_sandbox_child_heartbeat_gsource); - g_source_unref(captive_corba_sandbox_child_heartbeat_gsource); - captive_corba_sandbox_child_heartbeat_gsource=NULL; - } -} -#endif - -GMainLoop *captive_corba_get_loop(void) -{ -#ifdef HAVE_ORBIT_LINK -static GMainLoop *link_loop; - - if (!link_loop) - link_loop=g_main_loop_new(g_main_context_default(),TRUE); - return link_loop; -#else - return linc_main_get_loop(); -#endif -} - -GMainContext *captive_corba_get_context(void) -{ - return g_main_loop_get_context(captive_corba_get_loop()); -} - -void sandbox_child_shutdown(void) -{ - /* Do not fail by passing logging messages to the master. */ - impl_Captive_Vfs_init_g_log_func_disable(); - - g_main_loop_quit(captive_corba_get_loop()); -} - - -static gboolean heartbeat_source_callback(gpointer data /* unused */) -{ - g_return_val_if_fail(heartbeat_source_callback_orb!=CORBA_OBJECT_NIL,FALSE); /* the source should be removed */ - - sandbox_child_shutdown(); - - return FALSE; /* the source should be removed */ -} - - -static gboolean heartbeat_source_prepare(GSource *source,gint *timeout) -{ - *timeout=-1; - - return FALSE; -} - -static GPollFD heartbeat_source_check_gpollfd; - -static gboolean heartbeat_source_check(GSource *source) -{ - return !!(heartbeat_source_check_gpollfd.revents & HEARTBEAT_SOURCE_CHECK_REVENTS); -} - -static gboolean heartbeat_source_dispatch(GSource *source,GSourceFunc callback,gpointer user_data) -{ - g_assert(callback!=NULL); - return (*callback)(user_data); -} - -static GSourceFuncs heartbeat_source_watch_funcs={ - heartbeat_source_prepare, - heartbeat_source_check, - heartbeat_source_dispatch, - NULL, /* finalize */ - }; - -void captive_corba_sandbox_child(const gchar *chrooted_orbit_dir) -{ -Captive_Vfs Vfs_object; -impl_POA_Captive_Vfs *Vfs_servant; -gboolean errbool; -guint errguint; -int errint; - - /* attach heartbeat_source_callback() to watch for any abnormalities - * on our open pipe 'parentheart_fds' and terminate the child if parent dies. - */ - captive_corba_sandbox_child_heartbeat_gsource=g_source_new(&heartbeat_source_watch_funcs,sizeof(GSource)); - g_return_if_fail(captive_corba_sandbox_child_heartbeat_gsource!=NULL); - g_source_set_callback( - captive_corba_sandbox_child_heartbeat_gsource, /* source */ - heartbeat_source_callback, /* func */ - NULL, /* data */ - NULL); /* notify */ - heartbeat_source_check_gpollfd.fd=0 /* STDIN */; /* parentheart_fd_read */ - heartbeat_source_check_gpollfd.events=HEARTBEAT_SOURCE_CHECK_EVENTS; - heartbeat_source_check_gpollfd.revents=0; - g_source_add_poll(captive_corba_sandbox_child_heartbeat_gsource,&heartbeat_source_check_gpollfd); - - errbool=corba_init("captive-sandbox-child",&captive_corba_ev,&captive_corba_orb,&captive_corba_poa); - g_return_if_fail(errbool==TRUE); - - heartbeat_source_callback_orb=captive_corba_orb; - - /* captive_corba_get_context() makes sense only after corba_init() -> CORBA_ORB_init() */ - errguint=g_source_attach( - captive_corba_sandbox_child_heartbeat_gsource, /* source */ - captive_corba_get_context()); /* context; NULL means 'default context' */ - g_assert(errguint!=0); - - /* Init 'Vfs_object' */ - Vfs_object=impl_Captive_Vfs__create(captive_corba_poa,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Pass IOR to our parent. - * It will also create the socket needed for 'chrooted_orbit_dir' below - * by CORBA_ORB_object_to_string()->ORBit_marshal_object()->IOP_generate_profiles()->ORBit_ORB_start_servers... - */ - { -char *Vfs_IOR; - Vfs_IOR=CORBA_ORB_object_to_string(captive_corba_orb,Vfs_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - g_assert(Vfs_IOR!=NULL); - errint=printf("ior=%s\n",Vfs_IOR); - g_assert(errint>=0); - CORBA_free(Vfs_IOR); - } - - /* Default mode is 0700, permit parent non-"captive" users to access our IOR socket. */ - if (chrooted_orbit_dir) { -DIR *dir; -struct dirent *dirent; -const gchar *socketname=NULL,*socketpathname; - - errint=chmod(chrooted_orbit_dir,0755); - g_assert(errint==0); - - dir=opendir(chrooted_orbit_dir); - g_assert(dir!=NULL); - while (errno=0,(dirent=readdir(dir))) { - if (!strcmp(dirent->d_name,".") || !strcmp(dirent->d_name,"..")) - continue; - g_assert(socketname==NULL); - socketname=captive_strdup_alloca(dirent->d_name); - } - g_assert(errno==0); - errint=closedir(dir); - g_assert(errint==0); - g_assert(socketname!=NULL); - - socketpathname=captive_printf_alloca("%s/%s",chrooted_orbit_dir,socketname); - errint=chmod(socketpathname,0666); - g_assert(errint==0); - - printf("socketname=%s\n",socketname); - } - - /* Close the output to flush it to our spawning parent. */ - errint=fflush(stdout); - g_assert(errint==0); - errint=fclose(stdout); - g_assert(errint==0); - - /* CORBA_ORB_run() -> linc_main_loop_run() -> g_main_loop_run() - * and therefore we should be safe with glib events handling. - */ -#ifdef HAVE_ORBIT_LINK - g_main_loop_run(captive_corba_get_loop()); -#else - CORBA_ORB_run(captive_corba_orb,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); -#endif - - /* Shutdown 'Vfs' servant */ - Vfs_servant=PortableServer_POA_reference_to_servant(captive_corba_poa,Vfs_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - CORBA_Object_release(Vfs_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - impl_Captive_Vfs__destroy(Vfs_servant,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - errbool=corba_shutdown(&captive_corba_ev,&captive_corba_orb,&captive_corba_poa); - g_assert(errbool==TRUE); - - _exit(EXIT_SUCCESS); -} - - -static void options_module_captive_to_options_module_corba - (Captive_CaptiveOptionsModule *dest_options_module_corba,const struct captive_options_module *src_options_module_captive) -{ - g_return_if_fail(dest_options_module_corba!=NULL); - g_return_if_fail(src_options_module_captive!=NULL); - - g_return_if_fail(src_options_module_captive->type==CAPTIVE_OPTIONS_MODULE_TYPE_PE32); - - dest_options_module_corba->pathname_utf8=CORBA_string_dup(src_options_module_captive->pathname_utf8); - dest_options_module_corba->data._maximum=src_options_module_captive->u.pe32.length; - dest_options_module_corba->data._length =src_options_module_captive->u.pe32.length; - dest_options_module_corba->data._buffer=Captive_Bytes_allocbuf(dest_options_module_corba->data._maximum); - memcpy(dest_options_module_corba->data._buffer,src_options_module_captive->u.pe32.base, - src_options_module_captive->u.pe32.length); - dest_options_module_corba->data._release=TRUE; -} - -static void unlink_nonrecursive(const gchar *dirname) -{ -DIR *dir; -struct dirent *dirent; -int errint; - - if (!(dir=opendir(dirname))) - g_error(_("Failed to check for non-recursive removal directory \"%s\": %m"),dirname); - - while (errno=0,(dirent=readdir(dir))) { -gchar *pathname; - - if (!strcmp(dirent->d_name,".") || !strcmp(dirent->d_name,"..")) - continue; - pathname=g_strdup_printf("%s/%s",dirname,dirent->d_name); - errint=unlink(pathname); - g_assert(errint==0); - g_free(pathname); - } - g_assert(errno==0); - errint=closedir(dir); - g_assert(errint==0); - if (rmdir(dirname)) - g_error(_("Failed to remove (non-recursive removal) directory \"%s\": %m"),dirname); -} - -static const gchar *sandbox_parent_own_orbit_dir; -static const gchar *sandbox_parent_own_orbit_socket; - -static void sandbox_parent_own_orbit_dir_cleanup_atexit(void) -{ -static gboolean done=FALSE; - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s; done=%d",G_STRLOC,(int)done); - - if (done) - return; - done=TRUE; - - if (sandbox_parent_own_orbit_dir) - unlink_nonrecursive(sandbox_parent_own_orbit_dir); -} - -static struct sandbox_parent_own_orbit_dir_cleanup_signal { - int signum; - /* FIXME: Why we cannot use 'sighandler_t'? */ void (*sighandler_orig)(int signum); - } sandbox_parent_own_orbit_dir_cleanup_signals[]={ - { SIGINT }, - { SIGQUIT }, - { SIGTERM }, - { SIGHUP }, - { SIGABRT }, - { SIGFPE }, - }; - -static void sandbox_parent_own_orbit_dir_cleanup_sighandler(int signum) -{ -struct sandbox_parent_own_orbit_dir_cleanup_signal *sigstructp; - - for ( - sigstructp=sandbox_parent_own_orbit_dir_cleanup_signals; - sigstructpsignum==signum) - break; - } - g_assert(sigstructpsighandler_orig); - - /* Prevent recursive fatal logging before signal restore: */ - /* Do not: g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: signum=%d,sighandler_orig=%p",G_STRLOC,signum,sigstructp->sighandler_orig); - * as it is dangerous to g_log() from sighandler. - */ - - sandbox_parent_own_orbit_dir_cleanup_atexit(); - - /* Do not: g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: re-raising...",G_STRLOC); - * as it is dangerous to g_log() from sighandler. - */ - raise(signum); -} - -static void sandbox_parent_own_orbit_dir_cleanup_init(void) -{ -struct sandbox_parent_own_orbit_dir_cleanup_signal *sigstructp; - - for ( - sigstructp=sandbox_parent_own_orbit_dir_cleanup_signals; - sigstructpsighandler_orig=signal(sigstructp->signum,sandbox_parent_own_orbit_dir_cleanup_sighandler); - if (sigstructp->sighandler_orig==SIG_IGN) - sigstructp->sighandler_orig=SIG_DFL; - } -} - -static void createlockdir(const gchar *dir) -{ -gint retries; - - for (retries=0;retries<10;retries++) { -struct stat statbuf; -int dirfd; - - if (mkdir(dir,0700)) { - if (errno!=EEXIST) - g_error(_("Failed to create chroot directory \"%s\": %m"),dir); - unlink_nonrecursive(dir); - if (mkdir(dir,0700)) - g_error(_("Failed to create chroot directory \"%s\" after attempted unlink: %m"),dir); - } - dirfd=open(dir,O_RDONLY); - if (dirfd==-1) { - if (errno!=ENOENT) - g_error(_("Failed to open created chroot directory \"%s\" to lock it: %m"),dir); - continue; - } - /* Do not use 'LOCK_NB' here as the garbage collector should release it soon. */ - if (flock(dirfd,LOCK_EX)) - g_error(_("Failed to lock created chroot directory \"%s\": %m"),dir); - if (lstat(dir,&statbuf)) { - if (errno!=ENOENT) - g_error(_("Failed to lstat(2) created chroot directory \"%s\": %m"),dir); - if (close(dirfd)) - g_error(_("Failed to close created and locked chroot directory \"%s\": %m"),dir); - continue; - } - /* Leave 'dirfd' open to leave it LOCK_EX-ed. */ - break; - } -} - -static gchar *sandbox_parent_read_ior - (int Vfs_IOR_fd_read,gchar **child_chroot_pid_hashkey_dirp,CaptiveVfsParentObject *captive_vfs_parent_object) -{ -gchar *data; -gsize data_size; -GHashTable *hash; -gchar *ior,*child_chroot_pid_hashkey_dir; -int errint; -gchar *s,*sd,*se; -gboolean errbool; -const gchar *ior_read_error; - - /* Initialize /tmp/orbit-$username directory for linking IOR socket. */ - errbool=corba_init("captive-sandbox-parent",&captive_corba_ev,&captive_corba_orb,&captive_corba_poa); - g_assert(errbool==TRUE); - - /* FIXME: Security: Duplicate giop_tmpdir_init() here. */ - if (!sandbox_parent_own_orbit_dir) { - /* FIXME: Make 'CAPTIVE_SANDBOX_CHROOT' configurable. */ - /* Use also geteuid() marker here as could not remove the directory - * of some other user otherwise. - */ - sandbox_parent_own_orbit_dir=g_strdup_printf("%s/tmp/captive-orbit-%d-%d",CAPTIVE_SANDBOX_CHROOT,getpid(),geteuid()); - sandbox_parent_own_orbit_dir_cleanup_init(); - createlockdir(sandbox_parent_own_orbit_dir); -#ifdef HAVE_ORBIT_LINK - link_set_tmpdir(sandbox_parent_own_orbit_dir); -#else - linc_set_tmpdir(sandbox_parent_own_orbit_dir); -#endif - } - - data=captive_rtl_file_read(Vfs_IOR_fd_read,&data_size); /* data_fd_read */ - errint=close(Vfs_IOR_fd_read); - ior_read_error=NULL; -#define IOR_READ_ERROR(cond) G_STMT_START { \ - if (!ior_read_error && !(cond)) \ - ior_read_error=G_STRINGIFY(cond); \ - } G_STMT_END - IOR_READ_ERROR(errint==0); - IOR_READ_ERROR(data!=NULL); - IOR_READ_ERROR(data_size>=1); - IOR_READ_ERROR(data[data_size-1]=='\n'); - if (ior_read_error) - g_error(_("Error connecting to the sandbox server (failed \"%s\"). Try running by hand: %s"), - ior_read_error,CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_argv[0]); -#undef IOR_READ_ERROR - - hash=g_hash_table_new(g_str_hash,g_str_equal); - - for (s=data;scorba_chrooted_orbit_dir=g_strdup(chrooted_orbit_dir); - /* 0700 as this directory will not be reused - * to commuicate with any other sandbox child. - */ - if (mkdir(chrooted_orbit_dir,0700)) { - g_assert(errno==EEXIST); - } - - socketname=g_hash_table_lookup(hash,"socketname"); - g_assert(socketname!=NULL); - captive_vfs_parent_object->corba_socketname=g_strdup(socketname); - - socketpathname_src=captive_printf_alloca("%s/%s/%s",child_chroot_pid_hashkey_dir,chrooted_orbit_dir,socketname); - socketpathname_dest=g_strdup_printf("%s/%s",chrooted_orbit_dir,socketname); - errint=link(socketpathname_src,socketpathname_dest); - if (errint) - g_error("link(\"%s\",\"%s\")=%d:%m",socketpathname_src,socketpathname_dest,errint); - } - if (child_chroot_pid_hashkey_dirp) - *child_chroot_pid_hashkey_dirp=g_strdup(child_chroot_pid_hashkey_dir); - - ior=g_hash_table_lookup(hash,"ior"); - g_assert(ior!=NULL); - ior=g_strdup(ior); - g_free(data); - - g_hash_table_destroy(hash); - - return ior; -} - - -static xmlNode *options_module_captive_to_xml - (xmlNode *dest_xml_parent,const struct captive_options_module *src_options_module_captive) -{ - g_return_val_if_fail(dest_xml_parent!=NULL,NULL); - g_return_val_if_fail(src_options_module_captive!=NULL,NULL); - - { xmlNode *module=xmlNewTextChild(dest_xml_parent,NULL,BAD_CAST "module",NULL); - const gchar *type_string="???"; /* Prevent: ... might be used uninitialized in this function */ - const gchar *basename,*cgs; - - basename=src_options_module_captive->pathname_utf8; - if ((cgs=strrchr(basename,'/'))) - basename=cgs+1; - xmlNewProp(module,BAD_CAST "basename",BAD_CAST basename); - switch (src_options_module_captive->type) { - case CAPTIVE_OPTIONS_MODULE_TYPE_PE32: - type_string="PE32"; - xmlNewProp(module,BAD_CAST "length",BAD_CAST captive_printf_alloca("%lu",(unsigned long)src_options_module_captive->u.pe32.length)); - xmlNewProp(module,BAD_CAST "md5" ,BAD_CAST src_options_module_captive->u.pe32.md5); - break; - case CAPTIVE_OPTIONS_MODULE_TYPE_GMODULE: - type_string="gmodule"; - break; - default: g_assert_not_reached(); - } - xmlNewProp(module,BAD_CAST "type",BAD_CAST type_string); /* AFTER the 'switch' to set 'type_string'! */ - return module; - } -} - - -static void sandbox_parent_bug_doc_make(CaptiveVfsParentObject *captive_vfs_parent_object) -{ - { xmlDoc *doc=xmlNewDoc(BAD_CAST "1.0"); - captive_vfs_parent_object->corba_bug_doc=doc; - { xmlNode *bug=xmlNewDocNode(captive_vfs_parent_object->corba_bug_doc,NULL,BAD_CAST "bug",NULL); - xmlDocSetRootElement(captive_vfs_parent_object->corba_bug_doc,bug); - captive_vfs_parent_object->corba_bug=bug; - { xmlNode *bug_captive=xmlNewTextChild(bug,NULL,BAD_CAST "captive",NULL); - xmlNewProp(bug_captive,BAD_CAST "version",BAD_CAST VERSION); - } - { xmlNode *bug_filesystem=xmlNewTextChild(bug,NULL,BAD_CAST "filesystem",NULL); - options_module_captive_to_xml(bug_filesystem,&CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.filesystem); - } - { xmlNode *bug_load_module=xmlNewTextChild(bug,NULL,BAD_CAST "load_module",NULL); - guint load_moduleui; - struct captive_options_module *options_module; - GList *load_module_node; - - for (load_moduleui=0,load_module_node=CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.load_module; - load_module_node; - load_moduleui++,load_module_node=load_module_node->next) { - options_module=load_module_node->data; - options_module_captive_to_xml(bug_load_module,options_module); - } - } - { xmlNode *bug_action=xmlNewTextChild(bug,NULL,BAD_CAST "action",NULL); - captive_vfs_parent_object->corba_bug_action=bug_action; - } - { xmlNode *bug_log=xmlNewTextChild(bug,NULL,BAD_CAST "log",NULL); - captive_vfs_parent_object->corba_bug_log=bug_log; - } - } - } -} - - -static void sandbox_parent(const gchar *Vfs_IOR,const gchar *child_chroot_pid_hashkey_dir,CaptiveVfsParentObject *captive_vfs_parent_object) -{ -Captive_Vfs Vfs_object; -Captive_GLogFunc GLogFunc_object; -Captive_CaptiveIOChannel CaptiveIOChannel_object; -Captive_CaptiveOptions options_corba; -guint load_module_length,load_moduleui; -struct captive_options_module *options_module; -GList *load_module_node; -const gchar *child_chroot_parent_own_orbit_socket,*child_chroot_parent_own_orbit_dir; -int errint; - - g_return_if_fail(Vfs_IOR!=NULL); - /* 'child_chroot_pid_hashkey_dir' may be NULL */ - g_return_if_fail(CAPTIVE_VFS_PARENT_IS_OBJECT(captive_vfs_parent_object)); - - Vfs_object=CORBA_ORB_string_to_object(captive_corba_orb,Vfs_IOR,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Init 'GLogFunc_object' */ - GLogFunc_object=impl_Captive_GLogFunc__create(captive_corba_poa,captive_vfs_parent_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Init 'CaptiveIOChannel_object' */ - if (!captive_vfs_parent_object->corba_parent_giochanel_blind_source) { -GIOChannel *giochannel; - - giochannel=CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.image_iochannel; - g_io_channel_ref(giochannel); - - giochannel=captive_storage_relastblock(giochannel); - - switch (CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.rwmode) { - case CAPTIVE_OPTION_RWMODE_RO: - case CAPTIVE_OPTION_RWMODE_RW: - break; - case CAPTIVE_OPTION_RWMODE_BLIND: { -GIOChannel *giochannel_orig; - - giochannel_orig=giochannel; - giochannel=(GIOChannel *)captive_giochannel_blind_new( - giochannel, /* giochannel_orig */ - TRUE); /* writeable */ - g_io_channel_unref(giochannel_orig); /* reffed by captive_giochannel_blind_new() */ - } break; - default: g_assert_not_reached(); - } - captive_vfs_parent_object->corba_parent_giochanel_blind_source=giochannel; - } - - if (!captive_vfs_parent_object->corba_parent_giochanel_blind) - captive_vfs_parent_object->corba_parent_giochanel_blind=(GIOChannel *)captive_giochannel_blind_new( - captive_vfs_parent_object->corba_parent_giochanel_blind_source, /* giochannel_orig */ - (CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.rwmode!=CAPTIVE_OPTION_RWMODE_RO)); /* writeable */ - CaptiveIOChannel_object=impl_Captive_CaptiveIOChannel__create(captive_corba_poa, - captive_vfs_parent_object->corba_parent_giochanel_blind,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - /* Create the socket needed for 'sandbox_parent_own_orbit_socket' below - * by CORBA_ORB_object_to_string()->ORBit_marshal_object()->IOP_generate_profiles()->ORBit_ORB_start_servers... - */ - { -char *GLogFunc_IOR; - GLogFunc_IOR=CORBA_ORB_object_to_string(captive_corba_orb,GLogFunc_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - g_assert(GLogFunc_IOR!=NULL); - CORBA_free(GLogFunc_IOR); - } - - if (sandbox_parent_own_orbit_dir && !sandbox_parent_own_orbit_socket) { -DIR *dir; -struct dirent *dirent; - - dir=opendir(sandbox_parent_own_orbit_dir); - g_assert(dir!=NULL); - - while (errno=0,(dirent=readdir(dir))) { - if (!strcmp(dirent->d_name,".") || !strcmp(dirent->d_name,"..")) - continue; - g_assert(sandbox_parent_own_orbit_socket==NULL); - sandbox_parent_own_orbit_socket=g_strdup_printf("%s/%s",sandbox_parent_own_orbit_dir,dirent->d_name); - } - g_assert(errno==0); - errint=closedir(dir); - g_assert(errint==0); - g_assert(sandbox_parent_own_orbit_socket!=NULL); - } - - if (child_chroot_pid_hashkey_dir) { -gchar *s; - - child_chroot_parent_own_orbit_dir=captive_printf_alloca("%s/%s",child_chroot_pid_hashkey_dir,sandbox_parent_own_orbit_dir); - s=(/* de-const */ gchar *)child_chroot_parent_own_orbit_dir; - do { - s=strchr(s,'/'); - if (s) - *s=0; - if (*child_chroot_parent_own_orbit_dir) { - errint=mkdir(child_chroot_parent_own_orbit_dir,0777); - if (errint) - g_assert(errno==EEXIST); - else { - /* chmod(2) it to prevent mode limitation by - * active ulimit(2) of being executed by mount(8). - */ - errint=chmod(child_chroot_parent_own_orbit_dir,0777); - g_assert(errint==0); - } - } - if (s) - *s++='/'; - } while (s); - child_chroot_parent_own_orbit_socket=captive_printf_alloca("%s/%s", - child_chroot_pid_hashkey_dir,sandbox_parent_own_orbit_socket); - errint=link(sandbox_parent_own_orbit_socket,child_chroot_parent_own_orbit_socket); - g_assert(errint==0); - /* chmod(2)s also our orig. one (!) but this one is protected by its 0777 directory. */ - errint=chmod(child_chroot_parent_own_orbit_socket,0666); - g_assert(errint==0); - } - - options_corba.g_log_func=CORBA_Object_duplicate(GLogFunc_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - options_module_captive_to_options_module_corba(&options_corba.filesystem,&CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.filesystem); - /* Prevent secondary captive_giochannel_blind inside of our sandbox child - * as we already have one captive_giochannel_blind in the parent. - */ - options_corba.rwmode =(CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.rwmode == CAPTIVE_OPTION_RWMODE_BLIND ? CAPTIVE_OPTION_RWMODE_RW - : CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.rwmode); - options_corba.media =CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.media; - options_corba.debug_messages=CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.debug_messages; - - options_corba.image_iochannel=CORBA_Object_duplicate(CaptiveIOChannel_object,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - load_module_length=g_list_length(CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.load_module); - options_corba.load_module._maximum=load_module_length; - options_corba.load_module._length=load_module_length; - options_corba.load_module._buffer=Captive_CaptiveOptionsModuleList_allocbuf(options_corba.load_module._maximum); - options_corba.load_module._release=TRUE; - for (load_moduleui=0,load_module_node=CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.load_module; - load_module_node; - load_moduleui++,load_module_node=load_module_node->next) { - options_module=load_module_node->data; - options_module_captive_to_options_module_corba(options_corba.load_module._buffer+load_moduleui,options_module); - } - - Captive_Vfs_init(Vfs_object,&options_corba,&captive_corba_ev); - g_assert(validate_CORBA_Environment(&captive_corba_ev)); - - Captive_CaptiveOptions__freekids(&options_corba, - NULL); /* d; unused */ - - captive_vfs_parent_object->corba_Vfs_object=Vfs_object; - captive_vfs_parent_object->corba_GLogFunc_object=GLogFunc_object; - captive_vfs_parent_object->corba_CaptiveIOChannel_object=CaptiveIOChannel_object; - - if (CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.bug_pathname) - sandbox_parent_bug_doc_make(captive_vfs_parent_object); -} - -static void fd_shiftup(int *fdp) -{ - g_return_if_fail(fdp!=NULL); - - while (*fdp<=2 /* STDERR */) { - *fdp=dup(*fdp); - g_assert(*fdp!=-1); - } -} - -void captive_sandbox_fd_closeup(int fd_first_to_delete) -{ -DIR *dir; -int errint; -int dir_fd; -struct dirent *dirent; - - dir=opendir("/proc/self/fd/"); - g_return_if_fail(dir!=NULL); - dir_fd=dirfd(dir); - g_return_if_fail(dir_fd!=-1); - - while (errno=0,(dirent=readdir(dir))) { -long dirent_fd; -char *endptr; - - if (0 - || !strcmp(dirent->d_name,".") - || !strcmp(dirent->d_name,"..")) - continue; - dirent_fd=strtol(dirent->d_name,&endptr,10 /* base */); - g_assert(dirent_fd>=0 && (!endptr || !*endptr)); - if (dirent_fdoptions.sandbox_server_ior) { - g_assert(CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_argv==NULL); - - errbool=corba_init("captive-sandbox-parent",&captive_corba_ev,&captive_corba_orb,&captive_corba_poa); - g_assert(errbool==TRUE); - - captive_vfs_parent_object->corba_parentheart_fds_1=-1; - captive_vfs_parent_object->corba_child_pid=-1; - sandbox_parent( - CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_ior, /* Vfs_IOR */ - NULL, /* child_chroot_pid_hashkey_dir */ - captive_vfs_parent_object); /* captive_vfs_parent_object */ - return TRUE; - } - - g_assert(CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_argv!=NULL); - switch ((captive_vfs_parent_object->corba_child_pid=fork())) { - case -1: /* error */ - g_return_val_if_reached(FALSE); - - case 0: { /* child */ -const char *sandbox_argv0; -int execv_rc; - - errint=close(Vfs_IOR_fds[0]); /* close Vfs_IOR_fd_read */ - g_return_val_if_fail(errint==0,FALSE); - errint=close(parentheart_fds[1]); /* close parentheart_fd_write */ - g_return_val_if_fail(errint==0,FALSE); - - fd_shiftup(Vfs_IOR_fds+1); /* Vfs_IOR_fd_write */ - fd_shiftup(parentheart_fds+0); /* parentheart_fd_read */ - errint=dup2(Vfs_IOR_fds[1],1 /* STDOUT */); /* Vfs_IOR_fd_write */ - g_return_val_if_fail(errint==1 /* STDOUT */,FALSE); - errint=dup2(parentheart_fds[0],0 /* STDIN */); /* parentheart_fd_read */ - g_return_val_if_fail(errint==0 /* STDIN */,FALSE); - - captive_sandbox_fd_closeup(2 /* STDERR */ +1); - - sandbox_argv0=CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_argv[0]; - execv_rc=execv(sandbox_argv0, - /* re-const */ (char * const *)CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_argv); - g_error(_("Failed to spawn sandbox server - execv(\"%s\",...)=%d: %m"),sandbox_argv0,execv_rc); - } /* NOTREACHED */ - - default: { /* parent */ -gchar *Vfs_IOR; -gchar *child_chroot_pid_hashkey_dir; - - errint=close(Vfs_IOR_fds[1]); /* close Vfs_IOR_fd_write */ - g_return_val_if_fail(errint==0,FALSE); - errint=close(parentheart_fds[0]); /* close parentheart_fd_read */ - g_return_val_if_fail(errint==0,FALSE); - errint=fcntl(parentheart_fds[1],F_SETFD,FD_CLOEXEC); - /* This fcntl(2) may not be enough - some fork(2) may duplicate this - * write descriptor and even if we do some process finish the child - * may remain alone connected with some unknown fork(2)er from us. - * Currently I am not aware such case would occur. - */ - g_return_val_if_fail(errint==0,FALSE); - captive_vfs_parent_object->corba_parentheart_fds_1=parentheart_fds[1]; - - Vfs_IOR=sandbox_parent_read_ior( - Vfs_IOR_fds[0], /* Vfs_IOR_fd_read */ - &child_chroot_pid_hashkey_dir, - captive_vfs_parent_object); - - sandbox_parent( - Vfs_IOR, /* Vfs_IOR */ - child_chroot_pid_hashkey_dir, /* child_chroot_pid_hashkey_dir */ - captive_vfs_parent_object); /* captive_vfs_parent_object */ - - g_free(Vfs_IOR); - g_free(child_chroot_pid_hashkey_dir); - - /* 'parentheart_fds[1]' - parentheart_fd_write - is left open here */ - return TRUE; - } - } - /* NOTREACHED */ - g_return_val_if_reached(FALSE); -} - - -GnomeVFSResult captive_sandbox_parent_return_from_CORBA_Environment - (CORBA_Environment *evp,CaptiveVfsParentObject *captive_vfs_parent_object) -{ -GnomeVFSResult r; - - if (evp->_major==CORBA_NO_EXCEPTION) - return GNOME_VFS_OK; - - /* If !CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_argv it is CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_ior - * where we cannot do any restart anyway. - */ - if (captive_vfs_parent_object && CAPTIVE_VFS_OBJECT(captive_vfs_parent_object)->options.sandbox_server_argv - && (evp->_major==CORBA_SYSTEM_EXCEPTION && !strcmp(ex_CORBA_COMM_FAILURE,CORBA_exception_id(evp)))) { - r=GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE; - if (captive_vfs_parent_object->corba_Vfs_object!=CORBA_OBJECT_NIL) - captive_vfs_parent_object_aborted(captive_vfs_parent_object); /* errors ignored */ - } - else if (evp->_major==CORBA_USER_EXCEPTION && !strcmp(ex_Captive_GnomeVFSResultException,CORBA_exception_id(evp))) { - r=((Captive_GnomeVFSResultException *)CORBA_exception_value(evp))->gnome_vfs_result; - g_assert(r!=GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE); /* code reserved for sandbox restarts */ - } - else { - r=GNOME_VFS_ERROR_GENERIC; - g_warning(_("CORBA Exception occured: id=\"%s\", value=%p"), - CORBA_exception_id(evp),CORBA_exception_value(evp)); - } - CORBA_exception_free(evp); - - return r; -} - - -void captive_sandbox_child_GnomeVFSResultException_throw(CORBA_Environment *evp,GnomeVFSResult errvfsresult) -{ -Captive_GnomeVFSResultException *gnome_vfs_result_exception; - - g_return_if_fail(evp!=NULL); - - gnome_vfs_result_exception=Captive_GnomeVFSResultException__alloc(); - gnome_vfs_result_exception->gnome_vfs_result=errvfsresult; - CORBA_exception_set(evp,CORBA_USER_EXCEPTION,ex_Captive_GnomeVFSResultException,gnome_vfs_result_exception); -} diff --git a/src/libcaptive/sandbox/split.h b/src/libcaptive/sandbox/split.h deleted file mode 100644 index b3d0ba0..0000000 --- a/src/libcaptive/sandbox/split.h +++ /dev/null @@ -1,58 +0,0 @@ -/* $Id$ - * Include file for CORBA/ORBit split-mode initializer - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _SERVER_SPLIT_H -#define _SERVER_SPLIT_H 1 - - -#include -#include -#ifdef ORBIT2 /* Prevent missing $(ORBIT_CFLAGS) outside of libcaptive/sandbox/ */ -#include "sandbox.h" -#include "captive/client-vfs.h" -#include "../client/vfs-parent.h" -#endif - - -G_BEGIN_DECLS - -#ifdef ORBIT2 /* Prevent missing $(ORBIT_CFLAGS) outside of libcaptive/sandbox/ */ -extern CORBA_Environment captive_corba_ev; -extern CORBA_ORB captive_corba_orb; -extern PortableServer_POA captive_corba_poa; -#endif - -void captive_corba_sandbox_child(const gchar *chrooted_orbit_dir); -void sandbox_child_prepare_shutdown(void); -void captive_sandbox_fd_closeup(int fd_first_to_delete); -void sandbox_child_shutdown(void); -GMainLoop *captive_corba_get_loop(void); -GMainContext *captive_corba_get_context(void); -#ifdef ORBIT2 /* Prevent missing $(ORBIT_CFLAGS) outside of libcaptive/sandbox/ */ -gboolean captive_sandbox_spawn(CaptiveVfsParentObject *captive_vfs_parent_object); -gboolean validate_CORBA_Environment(CORBA_Environment *evp); -GnomeVFSResult captive_sandbox_parent_return_from_CORBA_Environment - (CORBA_Environment *evp,CaptiveVfsParentObject *captive_vfs_parent_object); -void captive_sandbox_child_GnomeVFSResultException_throw(CORBA_Environment *evp,GnomeVFSResult errvfsresult); -#endif - -G_END_DECLS - - -#endif /* _SERVER_SPLIT_H */ diff --git a/src/libcaptive/se/Makefile.am b/src/libcaptive/se/Makefile.am deleted file mode 100644 index 77b22a0..0000000 --- a/src/libcaptive/se/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ -# automake source for the run-time-library of libcaptive Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libse.la -libse_la_SOURCES= \ - audit.c \ - priv.c \ - sd.c \ - semgr.c diff --git a/src/libcaptive/se/audit.c b/src/libcaptive/se/audit.c deleted file mode 100644 index 58e101e..0000000 --- a/src/libcaptive/se/audit.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id$ - * reactos security auditing emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/sefuncs.h" /* self */ -#include - - -/** - * SeAuditingFileEvents: - * @AccessGranted: Attempt was already done? Unclear. - * @SecurityDescriptor: Unknown. - * - * Returns: %TRUE if auditing of all the files is requested. - */ -BOOLEAN SeAuditingFileEvents(IN BOOLEAN AccessGranted,IN PSECURITY_DESCRIPTOR SecurityDescriptor) -{ - g_return_val_if_fail(SecurityDescriptor!=NULL,FALSE); - - return FALSE; /* no auditing is being performed */ -} - - -/** - * SeAuditingFileEventsWithContext: - * @AccessGranted: Attempt was already done? Unclear. - * @SecurityDescriptor: Unknown. - * @SubjectSecurityContext: Unknown. - * - * Returns: %TRUE if auditing of all the files is requested. FIXME: Not sure. - */ -BOOLEAN SeAuditingFileEventsWithContext(IN BOOLEAN AccessGranted,IN PSECURITY_DESCRIPTOR SecurityDescriptor, - IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext OPTIONAL) -{ - g_return_val_if_fail(SecurityDescriptor!=NULL,FALSE); - g_return_val_if_fail(SubjectSecurityContext!=NULL,FALSE); - - return FALSE; /* no auditing is being performed */ -} diff --git a/src/libcaptive/se/priv.c b/src/libcaptive/se/priv.c deleted file mode 100644 index 35bd55b..0000000 --- a/src/libcaptive/se/priv.c +++ /dev/null @@ -1,47 +0,0 @@ -/* $Id$ - * reactos security privileges emulation of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/sefuncs.h" /* self */ -#include - - -/** - * SePrivilegeCheck: - * @Privileges: List of the requested privileges; Policy 'all' or 'any' is specified inside. - * %NULL value is forbidden. - * @SubjectContext: #PSECURITY_SUBJECT_CONTEXT of the owner to check the security for. - * %NULL value is forbidden. - * @PreviousMode: %UserMode or %KernelMode to check the security for. - * - * Check the set of privileges @Privileges for @SubjectContext and return if they - * are sufficient. - * - * libcaptive does not support any security and therefore it always returns %TRUE. - * - * Returns: %TRUE if the privileges are sufficient. - */ -BOOLEAN SePrivilegeCheck(PPRIVILEGE_SET Privileges,PSECURITY_SUBJECT_CONTEXT SubjectContext,KPROCESSOR_MODE PreviousMode) -{ - g_return_val_if_fail(Privileges!=NULL,FALSE); /* means privileges not sufficient */ - g_return_val_if_fail(SubjectContext!=NULL,FALSE); /* means privileges not sufficient */ - - return TRUE; /* privileges OK */ -} diff --git a/src/libcaptive/se/sd.c b/src/libcaptive/se/sd.c deleted file mode 100644 index e784f9d..0000000 --- a/src/libcaptive/se/sd.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $Id$ - * reactos SECURITY_DESCRIPTOR functions emulation of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/sefuncs.h" /* self */ -#include -#include "reactos/ntos/rtl.h" /* for RtlLengthSecurityDescriptor() */ - - -/** - * SeValidSecurityDescriptor: - * @Length: Available size for @SecurityDescriptor. - * @SecurityDescriptor: #SECURITY_DESCRIPTOR to check the size of. - * - * Functions checks whether @SecurityDescriptor fits to the are size @Length. - * RtlLengthSecurityDescriptor(@SecurityDescriptor) must be less or equal - * @Length to succeed. - * - * Returns: %TRUE if @SecurityDescriptor fits there. - */ -BOOLEAN SeValidSecurityDescriptor(IN ULONG Length,IN PSECURITY_DESCRIPTOR SecurityDescriptor) -{ -ULONG reallen; - - g_return_val_if_fail(SecurityDescriptor!=NULL,FALSE); - - reallen=RtlLengthSecurityDescriptor(SecurityDescriptor); - - /* Sanity check only: - * It may happen but it should IMO mean something rotten - */ - g_assert(reallen<=Length); - - return (reallen<=Length); -} diff --git a/src/libcaptive/se/semgr.c b/src/libcaptive/se/semgr.c deleted file mode 100644 index d63eaae..0000000 --- a/src/libcaptive/se/semgr.c +++ /dev/null @@ -1,250 +0,0 @@ -/* $Id$ - * reactos security thin manager emulation of libcaptive - * Copyright (C) 2002-2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "reactos/ddk/setypes.h" /* self */ -#include -#include "reactos/ddk/status.h" -#include "reactos/ddk/exfuncs.h" /* for ExAllocatePool() */ - - -/** - * SeLockSubjectContext: - * @SubjectContext: Security context to read lock. - * %NULL value is forbidden. - * - * Obtain read locks on the security context @SubjectContext. - * @SubjectContext must be already acquired by SeCaptureSubjectContext(). - * - * This functions is a NOP in libcaptive as there is no threading implemented. - * FIXME: No sanity checks are currently done by libcaptive. - */ -VOID SeLockSubjectContext(IN PSECURITY_SUBJECT_CONTEXT SubjectContext) -{ - g_return_if_fail(SubjectContext!=NULL); - - /* NOP; TODO:thread */ -} - - -/** - * SeUnlockSubjectContext: - * @SubjectContext: Security context to unlock. - * %NULL value is forbidden. - * - * Release read locks on the security context @SubjectContext. - * @SubjectContext must be currently locked by SeLockSubjectContext(). - * - * This functions is a NOP in libcaptive as there is no threading implemented. - * FIXME: No sanity checks are currently done by libcaptive. - */ -VOID SeUnlockSubjectContext(IN PSECURITY_SUBJECT_CONTEXT SubjectContext) -{ - g_return_if_fail(SubjectContext!=NULL); - - /* NOP; TODO:thread */ -} - - -static SID *SID_dup(SID *sid,SECURITY_DESCRIPTOR *src,SECURITY_DESCRIPTOR *dest,gpointer *destdatap) -{ -SID *r; -gsize size; - - /* 'sid' may be NULL */ - g_return_val_if_fail(src!=NULL,NULL); - g_return_val_if_fail(dest!=NULL,NULL); - g_return_val_if_fail(destdatap!=NULL,NULL); - g_return_val_if_fail(*destdatap!=NULL,NULL); - - if (!sid) - return NULL; - if (src->Control & SE_SELF_RELATIVE) - sid=(SID *)(((ULONG)sid)+((ULONG)src)); - if (!sid) - return NULL; - - size=sizeof(*r)+sizeof(*r->SubAuthority)*(sid->SubAuthorityCount-1); - g_assert(size==(gsize)((*(guint8 *)(((char *)sid)+0x01))*4+8)); /* 0x14h is sizeof(SECURITY_DESCRIPTOR) */ - g_assert(!(size&3)); /* sizeof(ULONG)-alignment */ - r=*destdatap; - (*(char **)destdatap)+=size; - memcpy(r,sid,size); - if (dest->Control & SE_SELF_RELATIVE) - r=(SID *)(((ULONG)r)-((ULONG)dest)); - - return r; -} - -static ACL *ACL_dup(ACL *acl,SECURITY_DESCRIPTOR *src,SECURITY_DESCRIPTOR *dest,gpointer *destdatap) -{ -ACL *r; -gsize size; - - /* 'acl' may be NULL */ - g_return_val_if_fail(src!=NULL,NULL); - g_return_val_if_fail(dest!=NULL,NULL); - g_return_val_if_fail(destdatap!=NULL,NULL); - g_return_val_if_fail(*destdatap!=NULL,NULL); - - if (!acl) - return NULL; - if (src->Control & SE_SELF_RELATIVE) - acl=(ACL *)(((ULONG)acl)+((ULONG)src)); - if (!acl) - r=NULL; - else { - /* W32 undocumented: ReactOS uses '&0xFF' notation, I have seen value PAGE_SIZE. - * W32 doc says it is a regular size. - */ - size=acl->AclSize; - g_assert(!(size&3)); /* sizeof(ULONG)-alignment */ - r=*destdatap; - (*(char **)destdatap)+=size; - memcpy(r,acl,size); - } - if (dest->Control & SE_SELF_RELATIVE) - r=(ACL *)(((ULONG)r)-((ULONG)dest)); - - return r; -} - -/** - * SeAssignSecurity: - * @ParentDescriptor: Optional parent object security descriptor. - * %NULL value is permitted. - * @ExplicitDescriptor: Optional overriding descriptor for the new object. - * FIXME: %NULL value should be permitted but it is currently forbidden by libcaptive. - * @NewDescriptor: Returns the new generated descriptor. - * %NULL value is forbidden. - * @IsDirectoryObject: Will the new object contain its subobjects? - * @SubjectContext: Security context of the caller. - * %NULL value is forbidden. - * @GenericMapping: Rights mapping (?). - * %NULL value is forbidden. - * @PoolType: #POOL_TYPE to allocate new @NewDescriptor from. - * - * libcaptive requires either @ExplicitDescriptor or @ParentDescriptor - * to be presents and it recursively copies the structures to the - * target (allocated) @NewDescriptor. @ExplicitDescriptor is preferred - * over @ParentDescriptor if present. No structures merging is done. - * - * Returns: %STATUS_SUCCESS if @NewDescriptor was successfuly filled. - */ -NTSTATUS SeAssignSecurity(PSECURITY_DESCRIPTOR ParentDescriptor OPTIONAL, - PSECURITY_DESCRIPTOR ExplicitDescriptor OPTIONAL,PSECURITY_DESCRIPTOR *NewDescriptor, - BOOLEAN IsDirectoryObject,PSECURITY_SUBJECT_CONTEXT SubjectContext,PGENERIC_MAPPING GenericMapping,POOL_TYPE PoolType) -{ -SECURITY_DESCRIPTOR *src,*dest; -ULONG size; -gpointer destdata; - - g_return_val_if_fail(NewDescriptor!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(SubjectContext!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(GenericMapping!=NULL,STATUS_INVALID_PARAMETER); - - /* #2 0x40067021 in SeAssignSecurity (ParentDescriptor=0x0, - * ExplicitDescriptor=0xbfffe7f4, NewDescriptor=0x40b5873c, - * IsDirectoryObject=0 '\0', SubjectContext=0x409d2ff0, - * GenericMapping=0x40088014, PoolType=1) at semgr.c:79 - * #2 0x4006fe45 in SeAssignSecurity (ParentDescriptor=0x411b3fd0, - * ExplicitDescriptor=0x0, NewDescriptor=0xbfffe39c, - * IsDirectoryObject=1 '\001', SubjectContext=0xbfffe90c, - * GenericMapping=0x40094014, PoolType=1) at semgr.c:99 - */ - g_return_val_if_fail(ExplicitDescriptor!=NULL || ParentDescriptor!=NULL,STATUS_NOT_IMPLEMENTED); /* NOT YET IMPLEMENTED */ - - src=(ExplicitDescriptor ? ExplicitDescriptor : ParentDescriptor); - - size=RtlLengthSecurityDescriptor(src); - g_assert(!(size&3)); /* sizeof(ULONG)-alignment */ - - dest=ExAllocatePool(PagedPool,size); - g_return_val_if_fail(dest!=NULL,STATUS_NO_MEMORY); - - dest->Revision=src->Revision; - dest->Control=src->Control; - destdata=(dest+1); - dest->Owner=SID_dup(src->Owner,src,dest,&destdata); - dest->Group=SID_dup(src->Group,src,dest,&destdata); - if (src->Control & SE_SACL_PRESENT) { - /* 'SE_SACL_PRESENT' may be site while 'Sacl==NULL'. - * FIXME: How it differs from '!SE_SACL_PRESENT'? - */ - dest->Sacl=ACL_dup(src->Sacl,src,dest,&destdata); - } - else - dest->Sacl=NULL; - if (src->Control & SE_DACL_PRESENT) { - /* 'SE_DACL_PRESENT' may be site while 'Dacl==NULL'. - * FIXME: How it differs from '!SE_DACL_PRESENT'? - */ - dest->Dacl=ACL_dup(src->Dacl,src,dest,&destdata); - } - else - dest->Dacl=NULL; - - g_assert(((char *)dest)+size==destdata); - - *NewDescriptor=dest; - - return STATUS_SUCCESS; -} - - -/** - * SeAccessCheck: - * @SecurityDescriptor: IGNORED; ignored by libcaptive. - * %NULL value is forbidden. - * @SubjectSecurityContext: IGNORED; ignored by libcaptive. - * %NULL value is forbidden. - * @SubjectContextLocked: IGNORED; ignored by libcaptive. - * @DesiredAccess: IGNORED; ignored by libcaptive. - * @PreviouslyGrantedAccess: IGNORED; ignored by libcaptive. - * @Privileges: IGNORED; ignored by libcaptive. - * %NULL value is forbidden. - * @GenericMapping: IGNORED; ignored by libcaptive. - * %NULL value is forbidden. - * @AccessMode: IGNORED; ignored by libcaptive. - * @GrantedAccess: IGNORED; ignored by libcaptive. - * %NULL value is forbidden. - * @AccessStatus: IGNORED; ignored by libcaptive. - * %NULL value is forbidden. - * - * Query the rights of IGNORED to access IGNORED. - * - * libcaptive does not support any security and therefore it always returns %TRUE. - * - * Returns: %TRUE if the access is granted. - */ -BOOLEAN SeAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext, - IN BOOLEAN SubjectContextLocked,IN ACCESS_MASK DesiredAccess,IN ACCESS_MASK PreviouslyGrantedAccess, - OUT PPRIVILEGE_SET* Privileges,IN PGENERIC_MAPPING GenericMapping,IN KPROCESSOR_MODE AccessMode, - OUT PACCESS_MODE GrantedAccess,OUT PNTSTATUS AccessStatus) -{ - g_return_val_if_fail(SecurityDescriptor!=NULL,FALSE); /* means 'access denied' */ - g_return_val_if_fail(SubjectSecurityContext!=NULL,FALSE); /* means 'access denied' */ - g_return_val_if_fail(Privileges!=NULL,FALSE); /* means 'access denied' */ - g_return_val_if_fail(GenericMapping!=NULL,FALSE); /* means 'access denied' */ - g_return_val_if_fail(GrantedAccess!=NULL,FALSE); /* means 'access denied' */ - g_return_val_if_fail(AccessStatus!=NULL,FALSE); /* means 'access denied' */ - - return TRUE; /* access granted */ -} diff --git a/src/libcaptive/storage/Makefile.am b/src/libcaptive/storage/Makefile.am deleted file mode 100644 index 36ff3b8..0000000 --- a/src/libcaptive/storage/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# $Id$ -# automake source for the storage drivers for reactos of libcaptive Makefile -# Copyright (C) 2002-2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am -include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am - -noinst_LTLIBRARIES=libstorage.la -libstorage_la_SOURCES= \ - cdrom.c \ - disk.c \ - iounixchannel.c \ - iounixchannel.h \ - relastblock.c \ - relastblock.h \ - media.c \ - media.h \ - size.c \ - size.h -libstorage_la_CFLAGS=$(GNOME_VFS_MODULE_CFLAGS) $(LIBXML_CFLAGS) -libstorage_la_LIBADD=$(GNOME_VFS_MODULE_LIBS) diff --git a/src/libcaptive/storage/cdrom.c b/src/libcaptive/storage/cdrom.c deleted file mode 100644 index e7d8e09..0000000 --- a/src/libcaptive/storage/cdrom.c +++ /dev/null @@ -1,59 +0,0 @@ -/* $Id$ - * "\Device\CdRom%d" storage emulation driver for reactos of libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/storage.h" /* self */ -#include "media.h" -#include -#include "captive/unicode.h" -#include "reactos/ddk/status.h" /* for NT_SUCCESS() */ -#include "captive/options.h" - - -/** - * captive_cdrom_init: - * - * Creates system device "\Device\CdRom%d" providing readonly access - * to the given #captive_image_iochannel as emulation of CD-ROM driver. - * - * libcaptive currently supports just one drive and thus "\Device\CdRom0" - * is always created. It is forbidden to call this function twice. - * - * Returns: %TRUE if the initialization was successful. - */ -gboolean captive_cdrom_init(void) -{ -static struct captive_DriverObject cdrom_captive_DriverObject; -NTSTATUS err; - - g_return_val_if_fail(captive_image_iochannel!=NULL,FALSE); - - cdrom_captive_DriverObject.DiskGeometry.BytesPerSector=2048; - cdrom_captive_DriverObject.DiskGeometry.MediaType=RemovableMedia; - cdrom_captive_DriverObject.DeviceName_utf8="\\Device\\CdRom0"; - cdrom_captive_DriverObject.DeviceType=FILE_DEVICE_CD_ROM; - cdrom_captive_DriverObject.DeviceCharacteristics=FILE_REMOVABLE_MEDIA|FILE_READ_ONLY_DEVICE; - err=captive_media_DriverEntry( - &cdrom_captive_DriverObject, /* DriverEntry_DriverObject */ - captive_utf8_to_UnicodeString_alloca("\\captive\\storage\\cdrom")); /* DriverEntry_RegistryPath; ignored */ - g_return_val_if_fail(NT_SUCCESS(err),FALSE); - - return TRUE; -} diff --git a/src/libcaptive/storage/disk.c b/src/libcaptive/storage/disk.c deleted file mode 100644 index 2bc4d37..0000000 --- a/src/libcaptive/storage/disk.c +++ /dev/null @@ -1,68 +0,0 @@ -/* $Id$ - * "\Device\CaptiveHarddisk%d" storage emulation driver for reactos of libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/storage.h" /* self */ -#include "media.h" -#include -#include "captive/unicode.h" -#include "reactos/ddk/status.h" /* for NT_SUCCESS() */ -#include "captive/options.h" - - -/** - * captive_disk_init: - * - * Creates system device "\Device\CaptiveHarddisk%d" providing readwrite access - * to the given #captive_image_iochannel as emulation of harddisk driver. - * reactos initializes "\Device\Harddisk%d\Partition0" as the whole disk - * and each partition it founds by IoReadPartitionTable() it will create - * as "\Device\Harddisk%d\Partition1", "\Device\Harddisk%d\Partition2" etc. - * - * libcaptive does not (yet?) support any partitions and it will always create - * just the disk device for the whole given #captive_image_iochannel. - * As this behaviour is a bit specific we rather create some non-standard name - * of the device; anyway I have seen some "\Device\Harddisk%dVolume%d" on W32 - * system. - * - * captive currently supports just one drive and thus "\Device\CaptiveHarddisk0" - * is always created. It is forbidden to call this function twice. - * - * Returns: %TRUE if the initialization was successful. - */ -gboolean captive_disk_init(void) -{ -static struct captive_DriverObject disk_captive_DriverObject; -NTSTATUS err; - - g_return_val_if_fail(captive_image_iochannel!=NULL,FALSE); - - disk_captive_DriverObject.DiskGeometry.BytesPerSector=512; - disk_captive_DriverObject.DiskGeometry.MediaType=FixedMedia; - disk_captive_DriverObject.DeviceName_utf8="\\Device\\CaptiveHarddisk0"; - disk_captive_DriverObject.DeviceType=FILE_DEVICE_DISK; - disk_captive_DriverObject.DeviceCharacteristics=0; /* !FILE_REMOVABLE_MEDIA && !FILE_READ_ONLY_DEVICE */ - err=captive_media_DriverEntry( - &disk_captive_DriverObject, /* DriverEntry_DriverObject */ - captive_utf8_to_UnicodeString_alloca("\\captive\\storage\\disk")); /* DriverEntry_RegistryPath; ignored */ - g_return_val_if_fail(NT_SUCCESS(err),FALSE); - - return TRUE; -} diff --git a/src/libcaptive/storage/iounixchannel.c b/src/libcaptive/storage/iounixchannel.c deleted file mode 100644 index df104b8..0000000 --- a/src/libcaptive/storage/iounixchannel.c +++ /dev/null @@ -1,64 +0,0 @@ -/* $Id$ - * Detect file descriptor of a given GIOUnixChannel for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "iounixchannel.h" /* self */ -#include -#include -#include -#include -#include - - -static GIOChannel *iochannel_null; - -int captive_iounixchannel_get_fd(GIOChannel *iochannel) -{ -int r; - - g_return_val_if_fail(iochannel!=NULL,-1); - - if (!iochannel_null) { -int fd; - - fd=open("/dev/null",O_RDONLY); - /* We may be already chroot()ed. - * We would be called from captive_storage_relastblock() - * and it is safe to return -1 in such case. - */ - if (fd==-1) - return -1; - iochannel_null=g_io_channel_unix_new(fd); - g_return_val_if_fail(iochannel_null!=NULL,-1); - } - - if (iochannel->funcs!=iochannel_null->funcs) { - /* Not a UNIX file descriptor */ - return -1; - } - - /* It is forbidden to callg_io_channel_unix_get_fd() - * if you are not sure it is a 'GIOUnixChannel'. - */ - r=g_io_channel_unix_get_fd(iochannel); - g_return_val_if_fail(r!=-1,-1); - - return r; -} diff --git a/src/libcaptive/storage/iounixchannel.h b/src/libcaptive/storage/iounixchannel.h deleted file mode 100644 index c88eb9f..0000000 --- a/src/libcaptive/storage/iounixchannel.h +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id$ - * Include file to detect file descriptor of a given GIOUnixChannel for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_STORAGE_IOUNIXCHANNEL_H -#define _CAPTIVE_STORAGE_IOUNIXCHANNEL_H 1 - - -#include -#include "reactos/ddk/iotypes.h" /* for DRIVER_OBJECT */ -#include "reactos/ddk/ntddscsi.h" /* for IO_SCSI_CAPABILITIES */ - - -G_BEGIN_DECLS - -int captive_iounixchannel_get_fd(GIOChannel *iochannel); - -G_END_DECLS - - -#endif /* _CAPTIVE_STORAGE_IOUNIXCHANNEL_H */ diff --git a/src/libcaptive/storage/media.c b/src/libcaptive/storage/media.c deleted file mode 100644 index 2ce0cb5..0000000 --- a/src/libcaptive/storage/media.c +++ /dev/null @@ -1,567 +0,0 @@ -/* $Id$ - * captive media (cdrom/disk) emulation for reactos - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "media.h" /* self */ -#include "captive/storage.h" /* self */ -#include -#include "reactos/ddk/class2.h" /* for DEVICE_EXTENSION */ -#include "reactos/ddk/status.h" -#include "reactos/ddk/iofuncs.h" /* for IoIsErrorUserInduced() */ -#include "captive/macros.h" -#include "reactos/ddk/mmfuncs.h" /* for MmGetMdlByteCount() */ -#include "captive/unicode.h" -#include -#include "reactos/structs.h" /* for PREVENT_MEDIA_REMOVAL */ -#include "captive/options.h" - - -GIOChannel *captive_image_iochannel; -guint64 captive_image_size; - - -static gboolean validate_DeviceObject(DEVICE_OBJECT *DeviceObject) -{ -DEVICE_EXTENSION *DeviceExtension; -DISK_GEOMETRY *DiskGeometry; -IO_SCSI_CAPABILITIES *PortCapabilities; -struct captive_DriverObject *captive_DriverObject; - - g_return_val_if_fail(DeviceObject!=NULL,FALSE); - - captive_DriverObject=(struct captive_DriverObject *)DeviceObject->DriverObject; - DeviceExtension=DeviceObject->DeviceExtension; - - DiskGeometry=DeviceExtension->DiskGeometry; - g_return_val_if_fail(DiskGeometry==&captive_DriverObject->DiskGeometry,FALSE); - g_return_val_if_fail(DiskGeometry->MediaType==captive_DriverObject->DiskGeometry_check.MediaType,FALSE); - g_return_val_if_fail(DiskGeometry->TracksPerCylinder==captive_DriverObject->DiskGeometry_check.TracksPerCylinder,FALSE); - g_return_val_if_fail(DiskGeometry->SectorsPerTrack==captive_DriverObject->DiskGeometry_check.SectorsPerTrack,FALSE); - g_return_val_if_fail(DiskGeometry->BytesPerSector==captive_DriverObject->DiskGeometry_check.BytesPerSector,FALSE); - g_return_val_if_fail(DiskGeometry->Cylinders.QuadPart==captive_DriverObject->DiskGeometry_check.Cylinders.QuadPart,FALSE); - g_return_val_if_fail(DeviceExtension->PartitionLength.QuadPart==(gint64)captive_image_size,FALSE); - - PortCapabilities=DeviceExtension->PortCapabilities; - g_return_val_if_fail(PortCapabilities==&captive_DriverObject->PortCapabilities,FALSE); - g_return_val_if_fail(PortCapabilities->Length==captive_DriverObject->PortCapabilities_check.Length,FALSE); - g_return_val_if_fail(PortCapabilities->MaximumTransferLength==captive_DriverObject->PortCapabilities_check.MaximumTransferLength,FALSE); - g_return_val_if_fail(PortCapabilities->MaximumPhysicalPages==captive_DriverObject->PortCapabilities_check.MaximumPhysicalPages,FALSE); - g_return_val_if_fail(PortCapabilities->SupportedAsynchronousEvents==captive_DriverObject->PortCapabilities_check.SupportedAsynchronousEvents,FALSE); - g_return_val_if_fail(PortCapabilities->AlignmentMask==captive_DriverObject->PortCapabilities_check.AlignmentMask,FALSE); - g_return_val_if_fail(PortCapabilities->TaggedQueuing==captive_DriverObject->PortCapabilities_check.TaggedQueuing,FALSE); - g_return_val_if_fail(PortCapabilities->AdapterScansDown==captive_DriverObject->PortCapabilities_check.AdapterScansDown,FALSE); - g_return_val_if_fail(PortCapabilities->AdapterUsesPio==captive_DriverObject->PortCapabilities_check.AdapterUsesPio,FALSE); - - return TRUE; -} - - -static NTSTATUS MajorFunction_Irp_finish(DEVICE_OBJECT *DeviceObject,IRP *Irp) -{ -NTSTATUS r; - - g_return_val_if_fail(TRUE==validate_DeviceObject(DeviceObject),STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Irp!=NULL,STATUS_INVALID_PARAMETER); - - /* required for removable media only */ - if (!NT_SUCCESS(Irp->IoStatus.Status) && IoIsErrorUserInduced(Irp->IoStatus.Status)) { - g_assert(Irp->Tail.Overlay.Thread!=NULL); /* FIXME: Error should be postponed to first !=NULL Irp later */ - IoSetHardErrorOrVerifyDevice(Irp,DeviceObject); - Irp->IoStatus.Information=0; /* may got set during some processing before error occured */ - } - - /* IoCompleteRequest() will do 'IoFreeIrp(Irp);'! - * 'IoStatus.Status' must be saved before its invocation! - */ - r=Irp->IoStatus.Status; - IoCompleteRequest(Irp,IO_NO_INCREMENT); - return r; -} - - -/* FIXME: We should comply with PDRIVER_DISPATCH prototype but unfortunately - * CAPTIVE_STDCALL prevents us to do so at least in RedHat gcc-3.2-4 (gcc bug?). - */ -#define MajorFunction_DEVICE_CONTROL ((PDRIVER_DISPATCH)MajorFunction_DEVICE_CONTROL_func) -static NTSTATUS CAPTIVE_STDCALL MajorFunction_DEVICE_CONTROL_func(IN DEVICE_OBJECT *DeviceObject,IN IRP *Irp) -{ -struct captive_DriverObject *captive_DriverObject; -IO_STACK_LOCATION *IrpStack; - - g_return_val_if_fail(TRUE==validate_DeviceObject(DeviceObject),STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Irp!=NULL,STATUS_INVALID_PARAMETER); - - captive_DriverObject=(struct captive_DriverObject *)DeviceObject->DriverObject; - - Irp->IoStatus.Information=0; /* request-specific, may get overriden later */ - IrpStack=IoGetCurrentIrpStackLocation(Irp); - g_assert(IrpStack->MajorFunction==IRP_MJ_DEVICE_CONTROL); - g_assert(IrpStack->MinorFunction==0); - - switch (IrpStack->Parameters.DeviceIoControl.IoControlCode) { - - case IOCTL_CDROM_GET_LAST_SESSION: - /* Nothing interesting to see, move along. - * FIXME: This call is somehow multisession related - must we care? - */ - /* PASSTHRU */ - - case IOCTL_CDROM_READ_TOC: { -CDROM_TOC *CdromToc; - - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(CDROM_TOC); - g_assert_not_reached(); - goto done; - } - CdromToc=(CDROM_TOC *)Irp->AssociatedIrp.SystemBuffer; - CAPTIVE_MEMZERO(CdromToc); - CdromToc->Length[0]=((sizeof(*CdromToc)-2)>>0U)&0xFFU; /* little-endian */ - CdromToc->Length[1]=((sizeof(*CdromToc)-2)>>8U)&0xFFU; - CdromToc->FirstTrack=0; /* one track; TOC_LAST_TRACK does not count */ - CdromToc->LastTrack =0; /* one track; TOC_LAST_TRACK does not count */ - CdromToc->TrackData[0].Control=TOC_DATA_TRACK; - CdromToc->TrackData[0].Adr=0; /* Q-subchannel subinfo */ - CdromToc->TrackData[0].TrackNumber=0; - CdromToc->TrackData[0].Address[0]=0>>24U; /* LBA offset; big-endian */ - CdromToc->TrackData[0].Address[1]=0>>16U; - CdromToc->TrackData[0].Address[2]=0>> 8U; - CdromToc->TrackData[0].Address[3]=0>> 0U; - CdromToc->TrackData[1].Control=0; - CdromToc->TrackData[1].Adr=0; /* Q-subchannel subinfo */ - CdromToc->TrackData[1].TrackNumber=TOC_LAST_TRACK; - /* FIXME: should we put the captive_image_size to TOC_LAST_TRACK? */ - CdromToc->TrackData[1].Address[0]=(captive_image_size/512)>>24U; /* LBA offset; big-endian */ - CdromToc->TrackData[1].Address[1]=(captive_image_size/512)>>16U; - CdromToc->TrackData[1].Address[2]=(captive_image_size/512)>> 8U; - CdromToc->TrackData[1].Address[3]=(captive_image_size/512)>> 0U; - - Irp->IoStatus.Information=sizeof(DISK_GEOMETRY); - Irp->IoStatus.Status=STATUS_SUCCESS; - } break; - - case IOCTL_CDROM_GET_DRIVE_GEOMETRY: - case IOCTL_DISK_GET_DRIVE_GEOMETRY: - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(DISK_GEOMETRY); - g_assert_not_reached(); - goto done; - } - *(DISK_GEOMETRY *)Irp->AssociatedIrp.SystemBuffer=captive_DriverObject->DiskGeometry; - Irp->IoStatus.Information=sizeof(DISK_GEOMETRY); - Irp->IoStatus.Status=STATUS_SUCCESS; - break; - - case IOCTL_CDROM_CHECK_VERIFY: - case IOCTL_DISK_CHECK_VERIFY: - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLength) { - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(ULONG); - g_assert_not_reached(); - goto done; - } - *(ULONG *)Irp->AssociatedIrp.SystemBuffer=0; /* MediaChangeCount */ - Irp->IoStatus.Information=sizeof(ULONG); - } - else { - Irp->IoStatus.Information=0; - } - Irp->IoStatus.Status=STATUS_SUCCESS; - break; - - case IOCTL_SCSI_GET_CAPABILITIES: - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(IO_SCSI_CAPABILITIES); - g_assert_not_reached(); - goto done; - } - *(IO_SCSI_CAPABILITIES *)Irp->AssociatedIrp.SystemBuffer=captive_DriverObject->PortCapabilities; - Irp->IoStatus.Information=sizeof(IO_SCSI_CAPABILITIES); - Irp->IoStatus.Status=STATUS_SUCCESS; - break; - - case IOCTL_DISK_GET_PARTITION_INFO: { -PARTITION_INFORMATION *PartitionInformation; - - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(PARTITION_INFORMATION); - g_assert_not_reached(); - goto done; - } - PartitionInformation=(PARTITION_INFORMATION *)Irp->AssociatedIrp.SystemBuffer; - PartitionInformation->StartingOffset.QuadPart=0; - PartitionInformation->PartitionLength.QuadPart=captive_image_size; /* unit=bytes */ - PartitionInformation->HiddenSectors=0; /* FIXME: real image disk offset */ - PartitionInformation->PartitionNumber=1; - PartitionInformation->PartitionType=0; /* FIXME: meaning? */ - PartitionInformation->BootIndicator=TRUE; - PartitionInformation->RecognizedPartition=TRUE; - PartitionInformation->RewritePartition=FALSE; /* FIXME: meaning? */ - Irp->IoStatus.Information=sizeof(PARTITION_INFORMATION); - Irp->IoStatus.Status=STATUS_SUCCESS; - } break; - - case IOCTL_DISK_GET_PARTITION_INFO_EX: { -PARTITION_INFORMATION_EX *PartitionInformationEx; - - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(PARTITION_INFORMATION_EX); - g_assert_not_reached(); - goto done; - } - PartitionInformationEx=(PARTITION_INFORMATION_EX *)Irp->AssociatedIrp.SystemBuffer; - PartitionInformationEx->PartitionStyle=PARTITION_STYLE_RAW; /* not MBR or GPT */ - PartitionInformationEx->StartingOffset.QuadPart=0; - PartitionInformationEx->PartitionLength.QuadPart=captive_image_size; /* unit=bytes */ - PartitionInformationEx->PartitionNumber=0; /* FIXME: what number? */ - PartitionInformationEx->RewritePartition=FALSE; /* FIXME: meaning? */ - Irp->IoStatus.Information=sizeof(PARTITION_INFORMATION_EX); - Irp->IoStatus.Status=STATUS_SUCCESS; - } break; - - case IOCTL_STORAGE_GET_HOTPLUG_INFO: - Irp->IoStatus.Status=STATUS_NOT_SUPPORTED; - break; - - case IOCTL_DISK_IS_WRITABLE: - Irp->IoStatus.Information=0; - switch (captive_options->rwmode) { - case CAPTIVE_OPTION_RWMODE_RO: Irp->IoStatus.Status=STATUS_MEDIA_WRITE_PROTECTED; break; - case CAPTIVE_OPTION_RWMODE_BLIND: Irp->IoStatus.Status=STATUS_SUCCESS; break; - case CAPTIVE_OPTION_RWMODE_RW: Irp->IoStatus.Status=STATUS_SUCCESS; break; - default: g_assert_not_reached(); - } - break; - - case IOCTL_DISK_MEDIA_REMOVAL: { -PREVENT_MEDIA_REMOVAL *PreventMediaRemoval; - - /* FIXME: ntfs.sys calls this function with empty buffer; dunno what it means. - */ - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLength==0) { - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: IOCTL_DISK_MEDIA_REMOVAL with empty buffer",G_STRLOC); - Irp->IoStatus.Information=0; - Irp->IoStatus.Status=STATUS_SUCCESS; - break; - } - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(PREVENT_MEDIA_REMOVAL); - g_assert_not_reached(); - goto done; - } - PreventMediaRemoval=(PREVENT_MEDIA_REMOVAL *)Irp->AssociatedIrp.SystemBuffer; - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: IOCTL_DISK_MEDIA_REMOVAL now %s", - G_STRLOC,(PreventMediaRemoval->PreventMediaRemoval ? "TRUE" : "FALSE")); - - Irp->IoStatus.Information=sizeof(PREVENT_MEDIA_REMOVAL); - Irp->IoStatus.Status=STATUS_SUCCESS; - } break; - - case IOCTL_DISK_CONTROLLER_NUMBER: { -DISK_CONTROLLER_NUMBER *DiskControllerNumber; - - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(DISK_CONTROLLER_NUMBER); - g_assert_not_reached(); - goto done; - } - DiskControllerNumber=(DISK_CONTROLLER_NUMBER *)Irp->AssociatedIrp.SystemBuffer; - DiskControllerNumber->ControllerNumber=0; /* FIXME: based on 0 or 1? */ - DiskControllerNumber->DiskNumber=0; /* FIXME: based on 0 or 1? */ - - Irp->IoStatus.Information=sizeof(DISK_CONTROLLER_NUMBER); - Irp->IoStatus.Status=STATUS_SUCCESS; - } break; - - case IOCTL_DISK_GET_LENGTH_INFO: { -GET_LENGTH_INFORMATION *GetLengthInformation; - - if (IrpStack->Parameters.DeviceIoControl.OutputBufferLengthIoStatus.Status=STATUS_BUFFER_TOO_SMALL; - Irp->IoStatus.Information=sizeof(GET_LENGTH_INFORMATION); - g_assert_not_reached(); - goto done; - } - GetLengthInformation=(GET_LENGTH_INFORMATION *)Irp->AssociatedIrp.SystemBuffer; - GetLengthInformation->Length.QuadPart=captive_image_size; - - Irp->IoStatus.Information=sizeof(GET_LENGTH_INFORMATION); - Irp->IoStatus.Status=STATUS_SUCCESS; - } break; - - case 0x00664016: - g_error("%s: Invalid media IOCTL 0x%08lx - by NtfsFixDataError()",G_STRLOC, - (unsigned long)IrpStack->Parameters.DeviceIoControl.IoControlCode); - /* FALLTHRU */ - - default: - g_error("%s: Invalid media IOCTL 0x%08lX",G_STRLOC, - (unsigned long)IrpStack->Parameters.DeviceIoControl.IoControlCode); - Irp->IoStatus.Status=STATUS_INVALID_DEVICE_REQUEST; - g_assert_not_reached(); - goto done; - } - /* PASSTHRU */ - -done: /* 'err:' but we flow here even during success */ - return MajorFunction_Irp_finish(DeviceObject,Irp); -} - - -struct MajorFunction_READ_WRITE_func_Parameters { - ULONG Length; - ULONG Key; - LARGE_INTEGER ByteOffset; - }; - -/* FIXME: We should comply with PDRIVER_DISPATCH prototype but unfortunately - * CAPTIVE_STDCALL prevents us to do so at least in RedHat gcc-3.2-4 (gcc bug?). - */ -#define MajorFunction_READ_WRITE ((PDRIVER_DISPATCH)MajorFunction_READ_WRITE_func) -static NTSTATUS CAPTIVE_STDCALL MajorFunction_READ_WRITE_func(IN DEVICE_OBJECT *DeviceObject,IN IRP *Irp) -{ -IO_STACK_LOCATION *IrpStack; -gpointer buffer=NULL; -GIOStatus erriostatus; -struct captive_DriverObject *captive_DriverObject; -const struct MajorFunction_READ_WRITE_func_Parameters *Parameters=NULL; /* Prevent: `Parameters' might be used uninitialized */ - - g_return_val_if_fail(TRUE==validate_DeviceObject(DeviceObject),STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Irp!=NULL,STATUS_INVALID_PARAMETER); - - captive_DriverObject=(struct captive_DriverObject *)DeviceObject->DriverObject; - - Irp->IoStatus.Information=0; /* request-specific, may get overriden later */ - IrpStack=IoGetCurrentIrpStackLocation(Irp); - g_assert(IrpStack->MajorFunction==IRP_MJ_READ || IrpStack->MajorFunction==IRP_MJ_WRITE); - g_assert(IrpStack->MinorFunction==0); - -#define READ_WRITE_ASSERT_PARAMETERS_OFFSET(struct_a,struct_b,member) \ - g_assert(G_STRUCT_OFFSET(typeof(IrpStack->Parameters.struct_a),member) \ - ==G_STRUCT_OFFSET(typeof(IrpStack->Parameters.struct_b),member)) - READ_WRITE_ASSERT_PARAMETERS_OFFSET(Read,Write,Length); - READ_WRITE_ASSERT_PARAMETERS_OFFSET(Read,Write,Key); - READ_WRITE_ASSERT_PARAMETERS_OFFSET(Read,Write,ByteOffset); - READ_WRITE_ASSERT_PARAMETERS_OFFSET(Read,Write,ByteOffset.QuadPart); -#undef READ_WRITE_ASSERT_PARAMETERS_OFFSET - - switch (IrpStack->MajorFunction) { - case IRP_MJ_READ: Parameters=(const struct MajorFunction_READ_WRITE_func_Parameters *)&IrpStack->Parameters.Read; break; - case IRP_MJ_WRITE: Parameters=(const struct MajorFunction_READ_WRITE_func_Parameters *)&IrpStack->Parameters.Write; break; - default: g_assert_not_reached(); - } - - /* Autodetect 'buffer' as we are !DO_BUFFERED_IO && !DO_DIRECT_IO hybrid */ - if (Irp->UserBuffer) { - g_assert(buffer==NULL); - buffer=Irp->UserBuffer; - } - /* Forbid both IRP_BUFFERED_IO and IRP_ASSOCIATED_IRP as it should be IMO invalid state. */ - g_assert(!((Irp->Flags & IRP_BUFFERED_IO) && (Irp->Flags & IRP_ASSOCIATED_IRP))); - if (Irp->Flags & IRP_BUFFERED_IO && Irp->AssociatedIrp.SystemBuffer) { - g_assert(buffer==NULL); - buffer=Irp->AssociatedIrp.SystemBuffer; - } - if (Irp->MdlAddress) { - /* See comment at ntoskrnl/io/buildirp.c/IoBuildSynchronousFsdRequestWithMdl() - * initialization of 'Irp->UserBuffer'. - */ - g_assert(buffer==MmGetSystemAddressForMdl(Irp->MdlAddress) || buffer==NULL); - g_assert(Parameters->Length<=MmGetMdlByteCount(Irp->MdlAddress)); - buffer=MmGetSystemAddressForMdl(Irp->MdlAddress); - } - g_assert(buffer!=NULL); - - g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: %s: ByteOffset=0x%llX,Length=0x%lX", - G_STRLOC,(IrpStack->MajorFunction==IRP_MJ_READ ? "IRP_MJ_READ" : "IRP_MJ_WRITE"), - (guint64)Parameters->ByteOffset.QuadPart,(gulong)Parameters->Length); - - erriostatus=g_io_channel_seek_position(captive_image_iochannel, - Parameters->ByteOffset.QuadPart, /* offset */ - G_SEEK_SET, /* type */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - - switch (IrpStack->MajorFunction) { - case IRP_MJ_READ: { -gsize bytesread; - - erriostatus=g_io_channel_read_chars(captive_image_iochannel, - buffer, /* buf */ - Parameters->Length, /* count */ - &bytesread, /* bytesread */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - g_assert(bytesread==Parameters->Length); - } break; - - case IRP_MJ_WRITE: { -gsize byteswritten; - - erriostatus=g_io_channel_write_chars(captive_image_iochannel, - buffer, /* buf */ - Parameters->Length, /* count */ - &byteswritten, /* byteswritten */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - g_assert(byteswritten==Parameters->Length); - } break; - - default: g_assert_not_reached(); - } - - Irp->IoStatus.Information=Parameters->Length; - Irp->IoStatus.Status=STATUS_SUCCESS; - - /* PASSTHRU */ -/* done: */ /* 'err:' but we flow here even during success */ - return MajorFunction_Irp_finish(DeviceObject,Irp); -} - - -/* FIXME: We should comply with PDRIVER_DISPATCH prototype but unfortunately - * CAPTIVE_STDCALL prevents us to do so at least in RedHat gcc-3.2-4 (gcc bug?). - */ -#define MajorFunction_SHUTDOWN ((PDRIVER_DISPATCH)MajorFunction_SHUTDOWN_func) -static NTSTATUS CAPTIVE_STDCALL MajorFunction_SHUTDOWN_func(IN DEVICE_OBJECT *DeviceObject,IN IRP *Irp) -{ -IO_STACK_LOCATION *IrpStack; -GIOStatus erriostatus; -struct captive_DriverObject *captive_DriverObject; - - g_return_val_if_fail(TRUE==validate_DeviceObject(DeviceObject),STATUS_INVALID_PARAMETER); - g_return_val_if_fail(Irp!=NULL,STATUS_INVALID_PARAMETER); - - captive_DriverObject=(struct captive_DriverObject *)DeviceObject->DriverObject; - - IrpStack=IoGetCurrentIrpStackLocation(Irp); - g_assert(IrpStack->MajorFunction==IRP_MJ_SHUTDOWN || IrpStack->MajorFunction==IRP_MJ_FLUSH_BUFFERS); - g_assert(IrpStack->MinorFunction==0); - - /* libcaptive is not authorized to shutdown 'captive_image_channel'. */ - erriostatus=g_io_channel_flush( - captive_image_iochannel, /* channel */ - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - - Irp->IoStatus.Information=0; - Irp->IoStatus.Status=STATUS_SUCCESS; - - return MajorFunction_Irp_finish(DeviceObject,Irp); -} - - -/* FLUSH_BUFFERS has exactly the functionality for us. */ -#define MajorFunction_FLUSH_BUFFERS MajorFunction_SHUTDOWN - - -/* similiar to drivers/storage/cdrom/cdrom.c/DriverEntry()->... - * ...->CdromClassCreateDeviceObject()-> - * ->reactos/drivers/storage/class2/class2.c/ScsiClassCreateDeviceObject() - * We should be driving a lower layer PortDevice but currently we - * do not provide it, I hope W32 filesystems don't touch it. - */ -NTSTATUS captive_media_DriverEntry(struct captive_DriverObject *captive_DriverObject,PUNICODE_STRING RegistryPath) -{ -DRIVER_OBJECT *DriverObject; -DEVICE_OBJECT *DeviceObject; -DEVICE_EXTENSION *DeviceExtension; -NTSTATUS err; - - g_return_val_if_fail(captive_DriverObject!=NULL,STATUS_INVALID_PARAMETER); - g_return_val_if_fail(RegistryPath!=NULL,STATUS_INVALID_PARAMETER); - - DriverObject=(DRIVER_OBJECT *)captive_DriverObject; - - err=IoCreateDevice( - DriverObject, /* DriverObject */ - sizeof(DEVICE_EXTENSION), /* DeviceExtensionSize; additional storage not used */ - captive_utf8_to_UnicodeString_alloca(captive_DriverObject->DeviceName_utf8), /* DeviceName */ - captive_DriverObject->DeviceType, /* DeviceType */ - captive_DriverObject->DeviceCharacteristics, /* DeviceCharacteristics */ - FALSE, /* Exclusive */ - &DeviceObject); /* DeviceObject */ - g_return_val_if_fail(NT_SUCCESS(err),FALSE); - - /* Currently we are !DO_BUFFERED_IO && !DO_DIRECT_IO and we must solve - * being called with 'Irp->UserBuffer', 'Irp->AssociatedIrp.SystemBuffer' or 'Irp->MdlAddress'. - */ - /* should be left from IoCreateDevice(DeviceCharacteristics) above: */ - if (captive_DriverObject->DeviceCharacteristics & FILE_REMOVABLE_MEDIA) - g_assert(DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA); - /* ignored: DeviceObject->StackSize */ - /* ignored: DeviceObject->AlignmentRequirement */ - - /* from reactos/drivers/storage/scsiport/scsiport.c/ScsiPortCreatePortDevice() */ - captive_DriverObject->PortCapabilities.Length=sizeof(captive_DriverObject->PortCapabilities); - captive_DriverObject->PortCapabilities.MaximumTransferLength=0x10000; /* 64KB */ - g_assert((captive_DriverObject->PortCapabilities.MaximumTransferLength%PAGE_SIZE)==0); - captive_DriverObject->PortCapabilities.MaximumPhysicalPages=captive_DriverObject->PortCapabilities.MaximumTransferLength/PAGE_SIZE; - captive_DriverObject->PortCapabilities.SupportedAsynchronousEvents=0; - captive_DriverObject->PortCapabilities.AlignmentMask=1; /* no alignment required by us; speced as "integer multiple" */ - captive_DriverObject->PortCapabilities.TaggedQueuing=FALSE; - captive_DriverObject->PortCapabilities.AdapterScansDown=FALSE; - captive_DriverObject->PortCapabilities.AdapterUsesPio=TRUE; - captive_DriverObject->PortCapabilities_check=captive_DriverObject->PortCapabilities; /* for g_assert() checking against foreign modifications */ - - DeviceExtension=DeviceObject->DeviceExtension; - DeviceExtension->MediaChangeCount=0; - DeviceExtension->PhysicalDevice=DeviceObject; /* no real PhysicalDeviceObject */ - DeviceExtension->LockCount=0; - DeviceExtension->DeviceNumber=0; /* corresponds to the # in "\\Device\\CdRom0" */ - /* ignored DeviceExtension->PortDeviceObject - * as we are the final driver and we don't have any PortDeviceObject - */ - DeviceExtension->PortCapabilities=&captive_DriverObject->PortCapabilities; - DeviceExtension->StartingOffset.QuadPart=0; - DeviceExtension->PartitionLength.QuadPart=captive_image_size; - DeviceExtension->PortNumber=0; - DeviceExtension->PathId=0; - DeviceExtension->TargetId=0; - DeviceExtension->Lun=0; - - /* expect 'captive_DriverObject->DiskGeometry.MediaType' */ - captive_DriverObject->DiskGeometry.TracksPerCylinder=64; - captive_DriverObject->DiskGeometry.SectorsPerTrack=32; - /* expect 'captive_DriverObject->DiskGeometry.BytesPerSector' */ - captive_DriverObject->DiskGeometry.Cylinders.QuadPart=captive_image_size - /captive_DriverObject->DiskGeometry.BytesPerSector - /captive_DriverObject->DiskGeometry.SectorsPerTrack - /captive_DriverObject->DiskGeometry.TracksPerCylinder; - /* 'DeviceExtension->DiskGeometry' is NULL! */ - captive_DriverObject->DiskGeometry_check=captive_DriverObject->DiskGeometry; /* for g_assert() checking against foreign modifications */ - DeviceExtension->DiskGeometry=&captive_DriverObject->DiskGeometry; - - DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]=MajorFunction_DEVICE_CONTROL; - DriverObject->MajorFunction[IRP_MJ_READ ]=MajorFunction_READ_WRITE; - DriverObject->MajorFunction[IRP_MJ_WRITE ]=MajorFunction_READ_WRITE; - DriverObject->MajorFunction[IRP_MJ_SHUTDOWN ]=MajorFunction_SHUTDOWN; - DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS ]=MajorFunction_FLUSH_BUFFERS; - - return STATUS_SUCCESS; -} diff --git a/src/libcaptive/storage/media.h b/src/libcaptive/storage/media.h deleted file mode 100644 index 67d8d75..0000000 --- a/src/libcaptive/storage/media.h +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ - * Include file for captive media (cdrom/disk) emulation for reactos - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_STORAGE_MEDIA_H -#define _CAPTIVE_STORAGE_MEDIA_H 1 - - -#include -#include "reactos/ddk/iotypes.h" /* for DRIVER_OBJECT */ -#include "reactos/ddk/ntddscsi.h" /* for IO_SCSI_CAPABILITIES */ - - -G_BEGIN_DECLS - -struct captive_DriverObject { - DRIVER_OBJECT DriverObject; /* keep first! */ - - DISK_GEOMETRY DiskGeometry; - DISK_GEOMETRY DiskGeometry_check; /* for g_assert() checking against foreign modifications */ - IO_SCSI_CAPABILITIES PortCapabilities; - IO_SCSI_CAPABILITIES PortCapabilities_check; /* for g_assert() checking against foreign modifications */ - - /* expect: */ - const gchar *DeviceName_utf8; - DEVICE_TYPE DeviceType; - ULONG DeviceCharacteristics; - }; - - -NTSTATUS captive_media_DriverEntry(struct captive_DriverObject *captive_DriverObject,PUNICODE_STRING RegistryPath); - -G_END_DECLS - - -#endif /* _CAPTIVE_STORAGE_MEDIA_H */ diff --git a/src/libcaptive/storage/relastblock.c b/src/libcaptive/storage/relastblock.c deleted file mode 100644 index f7aa7fa..0000000 --- a/src/libcaptive/storage/relastblock.c +++ /dev/null @@ -1,204 +0,0 @@ -/* $Id$ - * Workaround Linux kernel bug wrt accessing last device block for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "iounixchannel.h" /* self */ -#include -#include -#include -#include -#include -#include "size.h" -#include -#include -#include "captive/macros.h" -#include -#include "../client/lib.h" /* for captive_giochannel_setup(); FIXME: pathname */ -#include "../client/giochannel-subrange.h" -#include "captive/storage.h" /* for captive_giochannel_size() */ - - -/* Config */ -#define ENSURE_BLOCK_SIZE 0x200 /* size of the NTFS 'superblock backup' */ - - - -gboolean start_bytes_ioctl_detect(int fd,guint64 *start_bytes_ioctlp) -{ -struct hd_geometry hd_geometry; -#ifdef HDIO_GETGEO_BIG -struct hd_big_geometry hd_big_geometry; -#endif -unsigned long start_sectors_ioctl; - - /* 'start' field is always 'unsigned long'. - * 'HDIO_GETGEO_BIG' is supported if 'HDIO_GETGEO' gets deprecated. - */ - if (0) - /* nop */; -#ifdef HDIO_GETGEO_BIG - else if (!ioctl(fd,HDIO_GETGEO_BIG,&hd_big_geometry)) - start_sectors_ioctl=hd_big_geometry.start; -#endif - else if (!ioctl(fd,HDIO_GETGEO,&hd_geometry)) - start_sectors_ioctl=hd_geometry.start; - else - return FALSE; - - *start_bytes_ioctlp=((guint64)start_sectors_ioctl)*0x200; - return TRUE; -} - -static gboolean check_last_block(GIOChannel *iochannel,guint64 iochannel_size) -{ -GIOStatus erriostatus; -gchar buf[ENSURE_BLOCK_SIZE]; -gsize bufgot; - - g_return_val_if_fail(iochannel!=NULL,FALSE); - g_return_val_if_fail(iochannel_size>0,FALSE); - - erriostatus=g_io_channel_seek_position(iochannel,iochannel_size-ENSURE_BLOCK_SIZE,G_SEEK_SET, - NULL); /* error */ - g_assert(erriostatus==G_IO_STATUS_NORMAL); - - erriostatus=g_io_channel_read_chars(iochannel, - buf, /* buf */ - ENSURE_BLOCK_SIZE, /* count */ - &bufgot, /* bytes_read */ - NULL); /* error */ - /* During read on the end boundary of Linux kernel block device we will - * get GNOME_VFS_ERROR_IO at least from linux-kernel-2.4.19-ac4 - * which will get mapped to G_IO_STATUS_ERROR by captive_gnomevfs_giognomevfs_io_read(). - */ - g_assert(0 - || (bufgot==ENSURE_BLOCK_SIZE && erriostatus==G_IO_STATUS_NORMAL) - || (bufgot==0 && erriostatus==G_IO_STATUS_EOF) - || (bufgot==0 && erriostatus==G_IO_STATUS_ERROR)); - - return (erriostatus==G_IO_STATUS_NORMAL); -} - -/* No new reference is created; unref the result the same way as the input. */ -GIOChannel *captive_storage_relastblock(GIOChannel *iochannel) -{ -int fd; -guint64 size_bytes_ioctl; -guint64 start_bytes_ioctl; -char linkbuf[0x1000],*linknum; -int linkgot; -const gchar *iochannel_unix_new_mode; -const gchar *linkread_pathname; -const gchar *slashpart_prefix; -gboolean errbool; -GIOFlags iochannel_flags; -GIOChannel *iochannel_unix_new; -int iochannel_unix_new_fd; -guint64 unix_new_start_bytes_ioctl,unix_new_size_bytes_ioctl; -GIOChannel *iochannel_subrange_new; - - g_return_val_if_fail(iochannel!=NULL,NULL); - - if (-1==(fd=captive_iounixchannel_get_fd(iochannel))) - return iochannel; - - if (ENSURE_BLOCK_SIZE>(size_bytes_ioctl=captive_giochannel_size_ioctl(iochannel))) - return iochannel; - - g_return_val_if_fail(g_io_channel_get_encoding(iochannel)==NULL,0); - - if (!start_bytes_ioctl_detect(fd,&start_bytes_ioctl)) - return iochannel; - - if (check_last_block(iochannel,size_bytes_ioctl)) - return iochannel; - - linkread_pathname=captive_printf_alloca("/proc/self/fd/%d",fd); - linkgot=readlink( - linkread_pathname, /* path */ - linkbuf, /* buf */ - sizeof(linkbuf)); /* bufsiz */ - if (!(linkgot>=1 && linkgot<=(int)sizeof(linkbuf)-1)) - g_error(_("Unable to read: %s"),linkread_pathname); - linkbuf[linkgot]=0; /* readlink(2) does not '\0'-terminate it */ - - for (linknum=linkbuf+linkgot;linknum>linkbuf && isdigit(linknum[-1]);linknum--); - if (linknum>=linkbuf+linkgot) - g_error(_("Last block not readable although the link read has no trailing number: %s"),linkbuf); - *linknum='\0'; - - /* /dev/ide/host0/bus0/target0/lun0/part1 -> /dev/ide/host0/bus0/target0/lun0/disc */ - slashpart_prefix="/part"; - if (linknum>linkbuf+strlen(slashpart_prefix) && !strcmp(linknum-strlen(slashpart_prefix),slashpart_prefix)) - strcpy(linknum-strlen(slashpart_prefix),"/disc"); - - /* /dev/ataraid/d0p1 -> /dev/ataraid/d0 */ - if (linknum>=linkbuf+2 && linknum[-1]=='p' && isdigit(linknum[-2])) - *--linknum='\0'; - - iochannel_flags=g_io_channel_get_flags(iochannel); - switch (iochannel_flags & (G_IO_FLAG_IS_READABLE|G_IO_FLAG_IS_WRITEABLE)) { - case G_IO_FLAG_IS_READABLE: - iochannel_unix_new_mode="r"; - break; - case G_IO_FLAG_IS_READABLE|G_IO_FLAG_IS_WRITEABLE: - iochannel_unix_new_mode="r+"; - break; - default: g_assert_not_reached(); - } - - if (!(iochannel_unix_new=g_io_channel_new_file( - linkbuf, /* filename */ - iochannel_unix_new_mode, /* mode */ - NULL))) /* error */ - g_error(_("Parent partition \"%s\" not readable by mode \"%s\""),linkbuf,iochannel_unix_new_mode); - - /* 'iochannel_unix_new' sanity checks: */ - iochannel_unix_new_fd=captive_iounixchannel_get_fd(iochannel_unix_new); - g_assert(iochannel_unix_new_fd>=0); - errbool=start_bytes_ioctl_detect(iochannel_unix_new_fd,&unix_new_start_bytes_ioctl); - g_assert(errbool==TRUE); - g_assert(unix_new_start_bytes_ioctl==0); - unix_new_size_bytes_ioctl=captive_giochannel_size_ioctl(iochannel_unix_new); - g_assert(unix_new_size_bytes_ioctl>0); - if (!(unix_new_size_bytes_ioctl>=start_bytes_ioctl+size_bytes_ioctl)) - g_error(_("Partition last block inaccessible and partition table incorrect: disc size %llu < part start %llu + part size %llu"), - (unsigned long long)unix_new_size_bytes_ioctl, - (unsigned long long)start_bytes_ioctl, - (unsigned long long)size_bytes_ioctl); - - iochannel_subrange_new=(GIOChannel *)captive_giochannel_subrange_new(iochannel_unix_new, - start_bytes_ioctl, /* start */ - start_bytes_ioctl+size_bytes_ioctl); /* end */ - g_assert(iochannel_subrange_new!=NULL); - - g_io_channel_unref(iochannel_unix_new); /* now reffed by 'iochannel_subrange_new' */ - - captive_giochannel_setup(iochannel_subrange_new); - g_io_channel_unref(iochannel); - - if (!check_last_block(iochannel_subrange_new,size_bytes_ioctl)) - g_error(_("Last block still not readable for the subrange of: %s"),linkbuf); - - if (size_bytes_ioctl!=captive_giochannel_size(iochannel_subrange_new)) - g_error(_("Invalid size of the subranged GIOChannel of: %s"),linkbuf); - - return iochannel_subrange_new; -} diff --git a/src/libcaptive/storage/relastblock.h b/src/libcaptive/storage/relastblock.h deleted file mode 100644 index 9867d0a..0000000 --- a/src/libcaptive/storage/relastblock.h +++ /dev/null @@ -1,36 +0,0 @@ -/* $Id$ - * Include file for workarounding Linux kernel bug wrt accessing last device block for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_STORAGE_RELASTBLOCK_H -#define _CAPTIVE_STORAGE_RELASTBLOCK_H 1 - - -#include -#include "reactos/ddk/iotypes.h" /* for DRIVER_OBJECT */ -#include "reactos/ddk/ntddscsi.h" /* for IO_SCSI_CAPABILITIES */ - - -G_BEGIN_DECLS - -GIOChannel *captive_storage_relastblock(GIOChannel *iochannel); - -G_END_DECLS - - -#endif /* _CAPTIVE_STORAGE_RELASTBLOCK_H */ diff --git a/src/libcaptive/storage/size.c b/src/libcaptive/storage/size.c deleted file mode 100644 index 73e6102..0000000 --- a/src/libcaptive/storage/size.c +++ /dev/null @@ -1,217 +0,0 @@ -/* $Id$ - * Detect media size of given GIOChannel for libcaptive - * Copyright (C) 2002 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include "config.h" - -#include "captive/storage.h" /* self */ -#include "../client/giochannel-blind.h" /* for captive_giochannel_blind_get_size() */ -#include "../client/giochannel-subrange.h" /* for captive_giochannel_subrange_get_size() */ -#include "../sandbox/client-CaptiveIOChannel.h" /* for captive_io_channel_get_size() */ -#include -#include -#include -#include -#include -/* Do not: #include * for 'BLKGETSIZE64' * - * as including any Linux kernel include files is too much incompatible. - */ -#include /* for 'BLKGETSIZE' */ -#include "iounixchannel.h" - - -static guint64 size_subrange(GIOChannel *iochannel) -{ -guint64 r; - - g_return_val_if_fail(iochannel!=NULL,0); - - if (!captive_giochannel_subrange_get_size(iochannel,&r)) - return 0; - - return r; -} - - -static guint64 size_blind(GIOChannel *iochannel) -{ -guint64 r; - - g_return_val_if_fail(iochannel!=NULL,0); - - if (!captive_giochannel_blind_get_size(iochannel,&r)) - return 0; - - return r; -} - - -static guint64 size_sandbox(GIOChannel *iochannel) -{ -guint64 r; - - g_return_val_if_fail(iochannel!=NULL,0); - - if (!captive_io_channel_get_size(iochannel,&r)) - return 0; - - return r; -} - - -guint64 captive_giochannel_size_ioctl(GIOChannel *iochannel) -{ -int fd; -guint64 r; -long r_long; - - g_return_val_if_fail(iochannel!=NULL,0); - - if (-1==(fd=captive_iounixchannel_get_fd(iochannel))) - return 0; - -#ifdef BLKGETSIZE64 - if (!ioctl(fd,BLKGETSIZE64,&r)) - return r; -#endif - if (ioctl(fd,BLKGETSIZE,&r_long)) - return 0; - if (r_long<0) - return 0; - r=((guint64)512)*r_long; - - return r; -} - - -static guint64 size_seek(GIOChannel *iochannel) -{ -int fd; -off_t offset_orig,offset; - - g_return_val_if_fail(iochannel!=NULL,0); - - /* We may need '_FILE_OFFSET_BITS=64'. - * Setting '__USE_FILE_OFFSET64' did not help. - * Done by 'AC_SYS_LARGEFILE' of configure.ac. - */ - g_return_val_if_fail(sizeof(offset)==sizeof(guint64),0); - - if (-1==(fd=captive_iounixchannel_get_fd(iochannel))) - return 0; - - if (-1==(offset_orig=lseek(fd,0,SEEK_CUR))) - return 0; - g_return_val_if_fail(offset_orig>=0,0); - offset=lseek(fd,0,SEEK_END); - if (offset_orig!=lseek(fd,offset_orig,SEEK_SET)) - g_assert_not_reached(); - - if (-1==offset) - return 0; - g_return_val_if_fail(offset>=0,0); - - return offset; -} - - - -static guint64 size_read(GIOChannel *iochannel) -{ -gint64 low,high,mid; -GIOStatus erriostatus; -gchar bufchar; -gsize bufchargot; - - g_return_val_if_fail(iochannel!=NULL,0); - /* Default "UTF-8" encoding is not much usable for us */ - g_return_val_if_fail(g_io_channel_get_encoding(iochannel)==NULL,0); - - /* low ==high: low (high) - * low+1==high: mid==low; NORMAL: no change: high - * low+1==high: mid==low; EOF : high=mid => 'low==high' case - */ - for (low=0, - high= - G_MAXINT64; - low+1=0); - return high; -} - - -guint64 captive_giochannel_size(GIOChannel *iochannel) -{ -guint64 r; - - if ((r=size_subrange(iochannel))) - return r; - if ((r=size_blind(iochannel))) - return r; - if ((r=size_sandbox(iochannel))) - return r; - if ((r=captive_giochannel_size_ioctl(iochannel))) - return r; - if ((r=size_seek(iochannel))) - return r; - if ((r=size_read(iochannel))) - return r; - - return r; -} diff --git a/src/libcaptive/storage/size.h b/src/libcaptive/storage/size.h deleted file mode 100644 index 55f4c58..0000000 --- a/src/libcaptive/storage/size.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $Id$ - * Include file to detect media size of given GIOChannel for libcaptive - * Copyright (C) 2003 Jan Kratochvil - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; exactly version 2 of June 1991 is required - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef _CAPTIVE_STORAGE_SIZE_H -#define _CAPTIVE_STORAGE_SIZE_H 1 - - -#include - - -G_BEGIN_DECLS - -guint64 captive_giochannel_size_ioctl(GIOChannel *iochannel); - -G_END_DECLS - - -#endif /* _CAPTIVE_STORAGE_SIZE_H */ diff --git a/src/w32-mod/Makefile.am b/src/w32-mod/Makefile.am deleted file mode 100644 index d85dfa2..0000000 --- a/src/w32-mod/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# $Id$ -# automake source for the makefile of captive-distributed W32 modules -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include $(top_srcdir)/Makefile-head.am - -varlibcaptivedir=$(localstatedir)/lib/$(PACKAGE) - -varlibcaptive_DATA= \ - ext2fsd.sys -EXTRA_DIST+= \ - ext2fsd.so-build.sh \ - $(varlibcaptive_DATA) diff --git a/src/w32-mod/ext2fsd.so-build.sh b/src/w32-mod/ext2fsd.so-build.sh deleted file mode 100755 index f7cbf4a..0000000 --- a/src/w32-mod/ext2fsd.so-build.sh +++ /dev/null @@ -1,49 +0,0 @@ -#! /bin/sh -# $Id$ -# Compile Ext2fsd by GCC in UNIX system as symbol-featured debuggable .so -# Copyright (C) 2003 Jan Kratochvil -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; exactly version 2 of June 1991 is required -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -( - # Microsoft Windows XP DDK include files directory: - INC=$HOME/.w32-inc/ - TARGET=./ext2fsd.so - - set -ex - rm -f _all.c - c=`echo *.c` - # Force to by considered system header file: - echo '#include ' >>_all.c - echo '#define InterlockedDecrement(Addend) (InterlockedExchangeAdd((Addend),-1)-1)' >>_all.c - echo '#define InterlockedExchangeAdd(Addend,Incr) ({ LONG _IEA_r=*(Addend); *(Addend)+=(Incr); _IEA_r; })' >>_all.c - for i in $c;do - echo '#include "'"$i"'"' >>_all.c - done - touch pshpack1.h poppack.h pshpack4.h - gcc -shared -o"$TARGET" -ggdb3 -Wall -fshort-wchar \ - -DDBG -D_MSC_VER=1300 -D_MSC_FULL_VER=13009038 -D_WIN32 -D_NTSYSTEM_ \ - -D__cdecl="" -D__stdcall="" -D__fastcall="" -D_fastcall="" \ - -D__int64="long long" -D_W64="" -D_M_IX86 -D_X86_ \ - -D'__declspec(x)'="" -D__forceinline="" -D__noop="" \ - -D__try="" -D"__finally"="label_finally:" \ - -D'__except(x)'="if (0)" -D"__leave"="goto label_finally" \ - -D_INTEGRAL_MAX_BITS=64 -D_WIN32_WINNT=0x0501 \ - -D__int8="char" -D__int16="short" -D__int32="int" \ - `for i in . $INC/{crt,ddk/wxp,wxp};do echo -isystem $i;done` \ - _all.c - #rm -f _all.c - echo ok - ) 2>&1 |grep -v ' warning: \| In function \|At top level:' #|less diff --git a/src/w32-mod/ext2fsd.sys b/src/w32-mod/ext2fsd.sys deleted file mode 100644 index a3710a2cc7ea91558b23dfdbd658de3d1b101597..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171325 zcmeEv4SZBrnfK&_cA(Q{fKX!_b*gDi+qBYxl@_W=U@%|?WbBRlpy6B=C6*X#hmvvbUF4_Sj34NoRVsxV$eN#5>PMW+fyJc;x(Y*ivbMBqF zlS~4-UEThEOM52wo_oH}bDr~@=j-_1ci55Ua5&NtrluT@F8t-ceEFUGrx%}Zc+)p; zaGad~y<56ciobVDsa93**@Q}%Pa1_ z{`v(uX3^jL;q#CD_T;lS*u#{(fBS~V@b^o9)_KFP@wemjsT&wS@n?T`!zliiRPE51 z$7-S9>u?mOT_$K68=x~%y z`!?4r+nI~@&i3!_P{p1QKE8Mz`owfD^RF#~$KlZKt}EXb+U9T!@jJ>KHvig^an6hG zR>>So(do#|7zgw3v~<1xf_G!Y9ggMqqtZ7Zo%z?E&f{>Dt=q6px?8sdX&y>-G?{;= zrMq}{U47jSL~`snh92{;Jzc)TQFwP*`_+da2D=-Ch~E_PfgZ7veu_0DzW6*Zx%%BqUGyG!@( zuJAngpvSwp^xn0r3vc(_cAIBLqD@s#NTPcDt*y*u+O14{yJKy^rqXpAw+1&9Z(RMJ ztp&x!TMOU2^*!GAvRz)ZbuHStt~OYM4nJB@U0t~MJr#Q&@Z5UWJ@?&x&wcfHSauJ7 z>le(OUS(=Ps#m4HJMOr{vnjMK)KLF`XKg|8Ca(uE3ts)QZ>{&_-ujk3x2xiV#`w-D z&Alkap?&d&6i4}I*=K*bek=cmyT>;@^srtLJ?9;E^mr#3hd+Q^$7iG2DGtMzwX$UZ zZw-r#U}jG$mTv?}Q$}4#VtAcKkxTcDgd0a34X@kj&`tp#YQw3h%8{1hm|8M{3XR}M z^EZ#9h=*1eK7eApnLUo{tzy25c*8f+e2NJ$wGT98Ncs-E?nV_Mmiir*>Oz59Uc6NA zh|yBcMg*3JFS-w22xTOcJXV8Zji;-TqD0$=Y=+mBHg6nV@@q%&8vU7*y>}ZvcR=f9 z#P=k^Ikn_68od+Ec9$TJ-|#sDY|>dLi<(;E$>6AD>M0zLLM%0hg9BoY-Pmo0cieCq z3-#bo7cw}$V^l;9?~vrMr9<*5{EGquIL5A>S`tN_-!X#2%@?teI1XNDc%wF+*l1@u z+IYLP(KU7-$_wA`2;GfF7^!Gurm?Uj`bsT(SA>MN&XzOZzhBGFX102V4d1159mDT% zZ2iFdjh{bqHq+5({sW){)RczLpm$Dvy$iqLvqcz!sU=I%Z{0f?Zk%*9+$G7}Rx-D| zdN52*qcDdfW(2Y^c+M$*F0vT-9~Gs?DvH-988fYNGV!|Xe5Fy8j*^x|Dvd(t%HDl9 zOL5hiiBeCI~KnwKZ z!)T-n@Q{x>$Ci(EAwImq(eQ?yIXhFPmaIZ7%F$C!%|~U+B1Uk+c;Kb4GP6_nO^oiw zqgq!WYwD{>jZ3Uj9i8R^E(+Scu^l zoG<_Q=JPNAxcLPEqVo;&d%Rq`fG|9;_pQN!mf!@JYsP^$Afm?`mGAQnZ!{c9(ec|D zb!LRsvWx=m!~0s(k@zo>ELO|G^Px;52(TV8FbsjIC7T5{#@m8JC9U2G0046uYg*I& zQ%g$mE!;TdXnZ8xc*)U#i5k*M^vA!Qnqqq!AIFqi108x>xN+POx}8fLFdE1X zKbNYW^+2|?C|v=+6L3+?3OFxLBX~&z`(-S4zkD2&(wddAVR3OI# z9ya9GO`gZAs;f!DRwBOq?gb9QccW8n6z72WwA~BP`@{G#Hwv$_c?F7lpkY2{BD^7q>j+&hXec)}$3RBT@WmAD5H8Gz89nwo zBo7!%xW_f0y?~{F;opsM-RZ2cjrXB-tG!!SZ`@E?vauMzCG<&s`3!QzP9DtI!hzAb25!OH zTS9bKSk_vU)^r|tn$ImoX+TOwAd6d;QIr*k{-TO|fd||4)RIfsT;@%pkA7_hBBK9{ zN9+d6B9EMP*^sir|88PzpDVmK%h8Bcj?%M?^?>e4W078%rQ?w`aMkC!F**td^2s+D zK9dE^hv$QlhWm&&v7EBGoR~W`yeG@C?*=3@7V=wBHp)^<83;HX!@mMKyRbSUgncyZ zYTJ`oanV&(EG;sM%31?yP0wLtL0gT2vKBvvaS~l4b^y{=?XdR8Wb1Fot{vOC`qtIH zyCPItySupJv5M+-b-QzKCvhvJF}g9eBnJf^j0ik`1p}g8x*qWC!n`QZ-M6|Pc&nM6y7dxjow{|B)!gcm=R@*)RK?4$AJr!R_X(UO z_;1VBRL5r!zKPI}5Jk9*;4H&=4dD)iVubAoO$bL2IuXty3?W=XaBWL<0|@&Njv#ym;WWaJ5Ppf^u1IyWne6v0`U>c~Y{flz|56X6Mjk0E>oA%gHDgo_9h2+j{8J;Hqm8xY=yuoK}) zgd+%@2z?0S2o4S7i*N@*A;M;a8iYd#UqLvF@Dqf~2<|GBi;$178Q}?pV+bb@&LRvV z`~qPD!L>8h@n(cPgnR@)f`)Jap&g+Mp&#LA2>*d_4d5Ub;XZ^CggS(F^t}^d`ag?@ zz+Kn^Eb;^R&-w;*?KnZQ2><*aPyEKW2jvTXKCQlyP-fI8Jql7E$KOT-E50;W#e48~ zDS{P$Ay37B27mtw!HQpdkBVP}zi&pc;%~oC#sBBqfiCfE#d{x6@eA?y76dE);)5#w zukiQV2v+?1YgGJ=_zSFEkyxSbq}b>-`7Dr@U@ zZ3DNW26d}%Ya6PoNy8-jwz{?^R99P__{q#y5DL{*ZEpxAW>jUasd%hvN5TgcKU+P; z+qPqeus2Snf2g*)VOK&q!J0>FY9FuhtgW{tUtPVezTUHxxbb=!74T2=EwTMCJf zwYYTKjBgt%LXX$hJ-TssMU6e15b z8|p(9bqQaYXLaqa-PIMGgoIC0SF)M1^3+w-*H6#HZ@z6+)%Df2p-mMD&6D!1Z-Iu2 zy1j|j$#;L%?uru7%hRSY_N};f$F{_oQDe+}_Tt!%O`*DqZM*ETDs4eEMxka~sA9vm z#K|GhUW)XW$RmOp)n7+0`k2WH-0g6dDQ zcCV|Eu}&BmmH`%9P5HLE1Ps9V!fo|cI}(eQz7*Dmv^7A#egmi?F*QGeR z5jqi$AnZfX5c~+M5ONUQ2opD=euQp>PK2Wf`w%pQVuYm#ZiI;?C=;O5wZ{*2qTM87D6Y&VT9TKB|8uQ50ekAF7iS= zv~KNI|He(5))f}ZI*G}L)@@v^RqS{a`(J(4_Ueim3>i~Cw5b7`Qbl=1IR;`a=np~(IetgNpHq3(6}EpPA?SJZqkq~Wc>V+x-j zr4m6ExB(F3XbUm_$;3FrmKbLcTu1k^^ST#o)?t&&jX#`5#qKh^IV<;zNN4^z@1SG! z^Y{d2m=SR4VE0mzlL@v=q2_o4s`B8+;?9jUcO6G5BF0f!d4QQydc%_5qvf%rVtYx` zL^rB5EIHIg>5JjbzExP*kx-suUy-j0u76fZn|BD$lmNsGgE@jS$r|3zbD3W|CLJIz z&5|Q^Atw5XUw~6gIntoTb`O#59>q6dyI;nG5zLP9knyp9()`$;`9^kj05$hZ?=W?E z1|u)M#7OaLdH5WCyHt>E2`n9gdu`lrnCbo|famU0-t!VyqX^+Ro?|TibU)cj= zYp0g0E%_>)p5{ucN^zsdox-7q2vfOD^Zi!_Ar_+=_Zjnek=xB(EzJFYSjyDUF?gjvW*$N55f`E32pI6Ce z@L+QQogO5~78q&uW?IP+Pd2qfV08kb7ji6PQ~Vm3-x$pkpFhEzNhf(m8v7*g(c-uh z&kA|&(Pp3Lvz)T_H)F~o__@k?{w_21G1GWFQ+%FRy@e&&=eZa$(fSu>o9Es9Tq>V2 z&y&XfGC-8k(uCg`(!5amy^*oJD?>wia%kx5dkw&YqN587HmzGN^s`NuLr(RvBV1Ad z!Q_~F8oz%zb|K769gSC~+!?|hZ0t?5ZR}BNV;`cPfeqnv8<;~!V<=^`j=(fSM`MC8 zd?E)h+>aj%@MqJ}Krwf+m@DaMq#}_v#8M~YrE)vw<{8k6Z=Jp}$`KQN@4w2*P`iFB zWJ%b;!;$5{X>LHVNdq*1JQ#9}lJ>v|q@1GC4ums}ZphQAkfn>R$n6QbBH#B>J~)nq+PiPV zPda|0&q)@ji9lavrkcoW27hcSE!eQ8pk$3gA=7b)ojsHkjU?cZ|3X=_pprx!^(vL0 z45b|XZ$K%Z<^q_3QXWIBb_t>v&3*e-p_GSY9bG}~i@TtfjRLh*@lxX`<&Z?$H`@-x zM6dbht4AsSAWIe~?fAJ0l4U20xf02ej?=Q%$x{2`rN;3~_T3hAnz}Qq5E1>-&#oT5j9BOe zO5;h;3n-TP)of=nisj!PRbP@&ECbf3nH0+@>r+ySWoZ&D=FtmsY*bJBvJ1dKdQq$osHu0frpZ*FR-Ocpm?A!J8bcK z7Dt0WCCY(9@tNhOE|o>_1cxjRN`pt+Jbh~RaB5u0Oq8<%je{y?Xem$+)MD{wfCT*M z8ls$z={b9u^TH5wUJ2v82IwEkU~KdbB$|&VC2^2u2PC#tk5w>zxhVjaVnNSx#rUaSi$$n+E-tlcKsXkBONHtI@HJz6S7@Y0tB1-G+Bhlhv5EJe#2F zGMl6(j#HG~kCpZ+@D*7K7Owbx+i)cu^lFrw3@;7OhL^5n+2e`hrED8s0xgt;1p5^+ z$cg)aLHhAC3kjBO!yf;F5#>Uf)3PTGl2~nsrB236O@^23B_C2HTg>(1cOCK?)GBB(4|n1S-8xo|-iZ~;U)I+XsiarPq2*w(y_{ITH%-w<d zh*3d64gKtqFEj0WqK1GLWn||2ZkR3-2a;SRk;0M_IVeDsH@5!wEOj;stFL?F&uX0`gPHnQ6nQTo@{Jv{CGrp$X zwl)1rba&>l>it}O{SRREUBb^SYuasF(|^rkuC%5rSn4E8&0ZNRb;g>8wVtiyvCX#4 zyc*dcjSRUqwMtCq{mb380OJDs8&Ea6TMk|&H zSR0OApYTHS~n~#Ml zEd>kZ84Q1rwJ_P6gmsMWzY))-E!p)j2@6h;oP^2Q4KN$>O_(NUZWthWC(h;Hlrpv~ z9=ixhVwqEsBsg)d@FvF?_{+>h(9(;OX<2#&MT*|aq(_+aWISomSrWZ?PAvJv#xVsJ zP_#>hK!jF0W0+BBafp#t^BIC*Ao}_5PE94ZHw}-w9u}F|JRB+<;J+ZHWz@PtfK{VR zKMt>xr?#L-vW6!qZGuE!xV2(3q#x$$O0U$LH6+4e$%=##r-~;BOgfbK z(NE)4E=8o$n|ZK9RpD>)!O<{p^o^kM0M5eA&UtEc-e&J&% z?BMx^8>Au2UFe)kFIdi6!KG62J+v+8(w~--EKm~qRpg1u2svxP$;zJ8wX0#|RoRoD zx|;)p6QOkc>~h5Feqaz7uT>)@ZJsgQEsE8jedgkPa{DLsfLkw65_z+`3h{aha`5{U%IPVjTo7Y9*^{3qPfWB_o@j7Pd0rW(0T$JfYM>8!@l7_L=|>vy zzT`dVY(ATXsS#7z%donG>9F+uvcA8Q#k21d`qL-)3~*9$usTMf=Ckq!t5bja&J??e zqF6PGe-&oDavmC@%pCP*Mnu1No_sh-6F$qOM%g237<-5S9@@ZWcL~shfO0M1 zFs*7iezHnlFxTp&ZLLnm)+$$EAo}u|si|cVL4bB!L}I`z;lC^SpRn(FGh9pj7yVDD zeKUsS{sDc_%DhB!_=zJqQJ6E8hJ4QEQ`Y(yba#Q74lz?_JQJs!6b*)~TE^Ttj}QR} z(fA6xSYeII3yt%ukx*X1G;iUIb3=x8?0&)o_FHT+1Zy$5ggv^L)+;%7Pre69SfnL_ za!=Eidk0W!xQh$R5xP^-@fk!Hs#1(2S4nga&d#xzK=gIpK-H|D(1BJHM@v?&8xsyB zc>;ta$L0z`e)#Ov6ad%;j09l8;*~~=z;Afe{9dWI3jAIVBE)YqR=ks36W>vkz}3+MtA7{!ZzP_T06>Ek0WdvLvYnra z6LCChfQ>2g)?9amA?H86Hl7 zER@b3%;+&7WoL=n($yq>@mtpB&-0;aQ={zCS2xtvt*O`@(jL5ZkM=e*cxW0zQrD&zao0l+$Fw#tbFQWJ z-0xawQmz1-THz5Y9%Q{f_Vrdc0H@a*RRzJOMWyvj0r13|`I%HzB&s3v^EWag2*Q zdZ!bDZ0-;5;r_5EFEv!i%^{Fmq7AUjN2N^YTqfjt2UbpubG;N9U-?6hj$iARBH_5dqbw4AwmS6I{z;!jyZxTLGs_Ay4nRiIp1!1PIg zHHuRuMPED-WgPf4o=i%~NuMHZd?#7r0^L%nuZK`=l4Dw!6ON>!luEteHj^Gx@wX+A zVgPeaBtJ-(% zy^+z4c*uCxdl~*4=9^7U#S#EWtAapANI!06R|KwIfa_ER*OCN6T7Ej4T4Ig1Q0(b| z)9@4Upu<|=@5EXTSj0&Vq=S6l0@nzmBx(3197S&dglHEQ7B>G% z5IyM1 z^oHzdZd2bp1Xn@mJzy7yfE=K(eOL|{`_wT&H}GaAyb_K5h)WBki&O1Q<>lCsHo&^` z0nci!3L6bKD0mLsRtt~A(keW#POVV;O}s{qGgoEm%Y!#ZULLeiZicqo55)Qp z*fzu6>0_0$u-}gQ!+Ws_Uq|dyn90!|XPa=+f|jHlvuH5l$7#uBk}P952*KA467YnF zXT1pLbhxB22^y?VXZU<7Q>=HY9@(jzzCP}$YbszZ%-uRk7rCV->z@?-Lh3Z%N12*G zfPTGvTKWa(AtpiP;U`><&^AFAfCx9eJb^ey8Eh=OTHqeb7ihs7ouSBp+^8l5sWBwP zb(xsMF__C>x5MF-c%O0WGsmc&d|Qj&FF`G0bn8y^vc z;-bOV5@>i@=YZV>K!KO0$+3Sip~6nk%9+Hiwx=U%jS*F593%?{Jqqu2I~typGfVo3 zl(EO8ze>FfLx8!n$;KKN{c!=_8d`t+4W=}#@%hw+m41uLEP z%mL9TaPK<+^=Ke+`=fWtGmjuEeUnczP3pbkR7D|4wwGKYU|{r?=$6dV`;f_kO^^x# zNCYc6b`(Kj7c3i`FwFPNK=kkME?!gO;7;60eu2wq zMbZ7ik%l+L8-rR^H3eW>NIipN;J;gK4WQyd zz|%_aU>)&u8VYHHd#biz6j(ggBFjw5XgPoc*y@h}TbVP}kf{xC!fMk`$!bF(-*m3W~v`LE-6W{v{ zAu;j$np8RtGpUVENr1_b$sA3&-#5{4zYTI+hAuE8P?dY;;v?*fZzHnnU9K|8- z^N1Urhx5TH4WmjftP3PCcAO@1RcVNb?)Efy;H4e;K}U^Xckl833u(d;J=l+D7&~LX z@55gIeeEz3w)y(V)+~wE{)d2z-ps=bV#43#0}1et&*Kzg2AU8NJ};YEE1%`OVYKjo z8-5{GxxvGD@>9;sXo}vaz0&fq~<^L01BA5F5bTyyN#VZhJhagS}1Xxg(-jZkK z$kg{QK)(dmEb+wfRU7)`o0{a|)^HbY7qKbV^P(`e;&t1Yk2W3Zs zP|XBbTcxE1z8-H^7Aj~9b`f6YEk_l8ia)TTuSFBEf$y#*t{Mn84mcX;jot`I<_xl! zd?a2L@du376?h65A7k#4=*quUh+bdA@4tK~P~wli)rtcj$%edTEQuXTVv#nRRypj~?DO56qLM1~$u|+s2bQpdd13C?Fhwg1Re4V=Q zc#ro42p4cjPU08B2A6rJj-VDW72165L~shgaHu%WC56o;TJtzJOROzH;#^yNP?#1E zklO6PR9hfXGydd<3szcVNGjk@I6RDYZs0V(A6b0kCTxVIQ47 zraB!yC0&G&g5~iU-xNzaZm!KeviWR3x`#!hcDR{ktDKEN8~>?HF-k^!`0FtzxDvu}nPtLQp{T?~ndl z2cgv2e1;Q<(dGmq!8EQvNqDs*gs}C4@kpc`ej>}k$%j;euYu^-Z{u=v8m)YtS`r~F zc%3~>eC0pMDY6n0+{i}8f?{ogG=+K>54saDB8-0buad|S*h)f+2@|ME?b!-+;BS_D zwgMez_*6A3B>>KliP(S>-x7cmHJB^#G#Y;}l5wCJrI@aP!Hf-#3xzh`<{bfbO;Vjy z?l_3Zc+M{5v%gFOV)&yM|B_@n@D^FCmrAq%Lj9@7PpxE=Cr-|MO03-4~bZdowrc)Z#&*16iBJ6$woAJgAMe#J3Z zOM5JO#VdmUFuJa5sG(n$yWY{@DXFNesH>>ikq}7>2X)3-G20nu0B0N=L9ljl%;`m- z5%&ldGPu4#T;zUG>*@||={BIoV*JGM=`;lyrn^fkW4e9ubXakPi*&ek7by=``O2qB zZSeFYwT||Yw#0W>^!U2Njoqrk`?V1kh>n&F?mzb`eqFyV2q#iqQ5TZ}fv-7Sx00k?0she-(i-id-L=>lK&I!Le?5q%HaCP|blYBp_@4lfNKDzTJ`cw53i^EY__ z=Kc}lOzqV!b9CH0VspzWkY3Di5MPAs#(vVf)A_=jLvw-$W==4{OXhDEveL9mrp*mL zQn+!@27MdYVDDgaO!PYlx86$h`!w3Dm7$T^zF1315e&p;LnaRNR!cG42N8d8KyT%9 z^zJWl;=BWvY6J)8YA5|azW94gI>|oe$v_5-jld>3U_4!frxL9XJ&3lUU^oKe0EAwT zPWz+(3a%qeV9-&_T0ab3gf%`8?qYu4qTm~f*~Ppr`d-zr0Yyx(OGFo_*&qGrPg#(_ zokawLo&r2b$?-xKM>A&>Vt9KkDqwN+Kfl1v0};gR>#%221u_pb#zCt0HaE(|Hk6q4 z0Sdxe(Ot(3f%6x)5&cb7Xw_EUBt>xG18Vizw*qDRiPZv>%)~ z9%08yt)lKqR@7~C6jc)a>OX?I@Qzp=fi${15H0`DsVNZTeKQDhlPNye{t>4)=HBD~ zFm#5+xu*XiE-S6Qiuesbvu+1W3g5yGt(Qqh;z@%}XrW5yWHjW>2V4=)@ zzp01{Hycl+D@9be=W=KhOqz)iR7uS}8-MT-amr8Gh(G$Pm*d(B(2_DOV22g+d88zI z1nduW3k(vkcs9cB&Q}=Kx`1Be1p9lrMK|4f+2yF3*rd$Ci+Ud?7dLO z^^m1YuJ1R%q_zZWAagL36K$m_zg-#3ek@aSV>^p}HR#yhjh@sCtcq)yM@$gN3>J`n>6J zOZD~3&Gr?pXp$MiIol*cpwN4x@eIdR@uZtCikk0*h9zbAVEV$W?v6RM}LiRqzS1P z(#~bk`T`ukz2nOGovS^FAxSq5a>)JB`}0tUZ(L6p?;I=A zKG+#nq(mtFK zE7CrkU$r9Da6&yM0c5E!V@0Upyqsh>X9ZRaAyl#jQXxE?V+b!>LkLxD4B_P&LwGsd z^MN^raBPP)ewSt)ze{TTE?IDSNh+aUySW4!FNJ$tb5w#0pp>dgj-#|D#c`oF#c{`n zKve@LeGegFV=#r}$>;^_3_C*A>OP_?(OCAhe;7I|Ijv`J$CY?G_O!1yU*}5W37$<- z{!2oekZ4xEF;1z!>phECY7^KnS8mg*%&Wnw#y`b*DO&_0ZKia&xtn@=!h9hIBLbhR z%%eojhxpiovz7cAQGbrgpM%^X`E<_Pf|LG9^-ajN82=llnc$q%qh1ew<|NR`+Sc-z zv^bvBWZCpuESugq%cdO^T4eO&5P0L%MwX4>!SJ_;4b{C_Z()fiS>iyvMA`3c?3+bu zJF;b~iyEfSu)WZ}hW__c~jPZUT|np%?&m2Z*tRdyo)7oDyz4 z44L?TfT!W@6s0D3Ha_AQ`w)J?i|I6ihoO=P-Argu;-wRM$cymiR+^f=!&C=fXj9Sb z6ze7oUZyZ_+CRnCUWdwXRP-JO_1hUfQrT0m2uh@ALr>p6m|~MoqtFFih9o+{-u`f7zpe8(umu7QR67|| zJ7-+|8a0TVH-Kv*Pe0E2!J=&%9Rv}n3Mb3c>Lg^)ya7?>TSoS8kgUhs#8ydT&7$rM zo({jbKxC|^b?*Uavq%bGi`CJL1NV_i4IWx4qBjXQc z5J(`)z{59wwpD?^9giJped1~IMfs7`+nTgv<=g0Meb??b=<4N0~ zP>uv{u@ul&?BF@I@#OSzSD(?3Azrs<1W%Sk+izh$f*r(8{QyuCN zKI?|es?YkW3*k5RMtt|4h=cb&d>7p>^*#J8l827a`&)y@;CP$~n*xRm{hh%>U~L~l z%pi&%5?k*sd{ZYc-@oI8CVNTvTe71(j^)|nz)h3hLvqjLp){Es-FJv%5L(END8aP3 z=@{M?s~c}XXSrT+%J4R&oz=ZfP{c{|HKA8fw+J^La!`Bcn3Wt3cG?LxV;fa6-FIO0 z6jjQCr_+K>g3AWeaHS~IfTe!O0Zl>Q5evfTySzOEtDnw$1g7PIX)S)mJUoxO1uEjQ z_r=jqJXG!!rlmS*``&{gsr1p$< z+U;0#9TeGMB-|KLG}Z-{ zKEl$|pNcgEYBupZym9i4Od~FT$V_ge*OtaJnZ#wk0kIy5OC{4IG5AkR-o)hX@#K_b z9mj&FUT1^VP$4k?4Y8oA5(!MZtc_*rxBP5<^CDVmBo%N8fexCl!?kU z#HFATp{{Kac`3?fqQ%>X@dGC0h2hX71;(fRtQ;@?==FVZ#q|PgJ>Xmn;rmF*PDiV^ z4{91r-4B8mn?|Jhj0c$z5i$1XGW*n$L7+&WY!g{p*cP2~j6q0gNog8ZtGyS|P$G?q zQhIHu>Yx5pp{m}bsHzM`u0U12bD}Ca;a_Qe{m;W!Sbgwj5<96q0vb*m-VcaygkzAL z-1S5mle&;f%Zn!sI$H}DwsiuZa-RJq!Wb`JzAe}l1@Y4u`RX9$Bl`3vKgVE16n6!xng7w97 z>sx4pt$6A)())2;Ad}bDfOT({rE*}f0vxK)&1m9ucO2OLoh(yUhYhXp#`7Tnszq%q zrPiKS2F1jvJw9Q4*E&<`>iORM9m~gar@A7KvX$Wvg^!? zZw$YZhI@5sv7OCE3Kt#*PFY{WA#2j4AxL*zCrx%Gn)M`GKQPiNCwFWE?q3V8UhUnq zDfi)RRU!B!4>i;)GwN}Vsflk&I)sXao)-_ZMYJT&q_Cg6tU|V{T_N-bHM{>m5p_1n90^^nvH-sDg;CXD=cyj z>?w5xP&Z){0L?#KAPw9Oxsz&_IQOoP#O8kHLTA!1F=-Z3Y0KkDO*U1(Xm;d+MHFs4 zu1fw(CO^jHUGe1J<2DT($PJDw_7Aylq5yh=nYx*2IG%}hKvz=X?#rH2x!wD|gjJ9Z=T_7n<2K;3AlV>E?z zd%G;G2r+OcPE_bSSXy9CbbvX*mkXhV(LDz!E{+IY^Bi_}EM&5l7J{{e4IR#-xas8l z7MK$*tdNkD#^`66P;4tu8#qUALoUTFI-ZnUq;lb&W}j<8goe{r+WY~ zEAbwmSBhFi;k?}lo>&=3-}mOHfCq8D>0IfoOB{fOfW=XV^u!u~jDy!AKbQ^lCf%8K z#_*k3{G1Uy-h5V-dsO!w(}PD0?-9dy4AzAEmZEgNA6=RHSPpj7SObdPzCsvu^EIk+* zgJBEQY8KzePR4jM5#iCn4pKB#UO^w(e)kDgNJo*i{WblyN+YbQQ-Tbl}?NT8_(go)7z;m z5pMRK(81awG|4CgJ8&XKSJhb;qUq)APK1PfW9rz46sIjS&V*9xe>mVrxbuOi^mg}H zHY?raCV<6uLN9=lKHfTbQ3?|X8GwxhJ6;Dyv>PLGoK*&*IWl~a*qQ?d0=r}?Dhz^J z8OFGh{o?4}W-t&ea_38zAYDoRjg=i6(4w0mk{3l@VNMSVS4+D=N>H%icu5FoNADm^HJc7o+ z5JuWyo~bStOC$iI^Psw?d!ymTsN?Yk(eFHkF~G4xwwI8HTw!X7^Fp#q7;e*WW3d3> z<*}-nis}$Iuk=RiH=4Utn{NVH#~;0rNsD4%R$8&!832gIqKe%lM9c(fXHl1Fj#U!% zLf;1Rc-SP5wTBxo35)5Hd1|6a7W9qsY&zF|`@i%`O{l7}s-o`h-;KXw(MGfJR;=%@ zwk|kmRcL%2o{cOzBxF$+A^M!R6T8^Z40XW*mG-4_(8gy-Ye1 zPioRbin0JbbS&I>OwlSXCNDmWQv`OY!BDd~oBDXANay*Sp+4wOV295*W8uY4NLoC0+0V)%A2PmX; z+4V9eTXa(h#7`Hgr0Ci|0rGjDqV6b$z^0#qP2Yna zv<4P7UHmOjV2hv0Nh?KP$K-c1x$k5Q(>@H8+FE!M@QA7VI*kI7tfT*l0R#L157BVF z+j7t7fXLTE@Yv|PO3|v(^GFNA%2JYs7Cg;jKjK}!;1F9&w>Hc`&R6G=(6 z128U0Al15Nl4=&oNm8v#NHu_=kZSQ|2ntV;YHG60{bH^OEAlW?c1JZ|aYM21*fdOFp>W``XsACF{vSSR~bPG}&?o$g8 z0!rJV;G=ugybj5{$_ll~4j01^1(ONcL6XUQEzzIkHJ8Zk%Ih{fR8YKbjmKY5QsDEJ zdP~H((6V$pG20yTn$p;;Zs$~aK82}Tg`YWRwSq~Dn6x~W)C3Z2+2(eij_sZviUQG( zL6Qx%n$crKcP2?T!}x8nW-{UZ(OlfEi}Yi)0wB@&czsii+;Sf?(48y&rrL(O z9Tl;p(zPss4>F}!X#LRk(8lqjfFtH*{(jAYD<-vU{HQPB)VQH>@=JJD`z2IOF2kJ( z2m?4EXGhL|Fbmf-Km zT@Px>l?Eqr8Q%u;V-jUm>X`*&KQ<4^Je*=gO~=G@_4id7A2?Sw4MMkQmpBZr&sf6{ z8=yxt4#6UFgdG}=c}xF7XeB3-%QB`UyeHebg@$FPm+(8C> zS%&FazJBGo5X3B(z=Vm6eH}wN-Jw#l@hq=+EQ$Vb433iPn%eUGG35*Pw&yOr-Lub= zdyn<|E>A8|th%y+4*2V8t5?_V+6`}a5boV>bGNvuMJxMUjRnR@G~p!Wx9YCV!9)-bS%@tsza9Qz))O2wO<(RZ$zDHtJHnN*l0zQ za)cLnfR{%7x^C+kL^Wjo;NtNVp{!O#xDQ95FgNZ1h*3V!aE(~@;$+n?Tyb$7Mw`{8 z_y`9oXcZPbs|iPQfPjsLkyG=L7ixJgec{wj7j(9MeDnF2e+-5id-bF?$zElnXtVe6 zyb+wNaUNwJP;xzm9u$MVM9$@>IhLKrsRa(QBIgRz^1Dzq_<3+E;fu5e(wd%YLaG*j z+9`=YPoIA{iKe+c_})^G#^(8YK^x1O>QBJ_51IQIOe`DL!G6*@0>*{+{WjtK8+R*u zqklRbN!);2V9CY&^k;*VBTrB>&irw4lDtMXKHdy9+3h3gpe6L6ShH5$S#s_m(&577-X{@K!(%GF}5VND$_M69Dt+srDkgMk6n zKii7r9e_Q!;|aJf8T09js8VbH9KbSypIH|rIXz!y(g7yD98YReIwRJa98qhM!mnXj zllP+L8NPkRFk3kWcsd{3K4e=ELA_qv@_CRiKdTb*1qHkrjUN4XRBO678^j}&b;f|( z2Y8w1fU33m3_slO8wh#vq4~v5CQ}CA5WwJ+Z(7aY%44W`vqSnckMiJF!!G)(@bEYG zIeV#!wzd9Z;F@-35cb`+vjP=9p zymp#}MqzaZYkc$?dB`Iai3L78AQQ5gW8WBk4k`VrhOq4l1QFIj1cB26C&dXVq;2(< zRjbuIJbm@by8Zd5WZeQ)Bsnc4r@!ob%9VK5_OySPeNf1{%oy2!1AtKTe-WU&8$WYG zxfoIGW71>sq%xo&XT{%XnIh7JR)@(H+%t|hH;$*Zzu6H=9aGf0hS>v&2TMpE4SFZ! z&7|2N_(+ETfD5W>Dr?0+DL$Uo_M6;3$e!m9Gp<)|$CY##652dnrSiY1$KZ8rc9c5q z9kIrWfqei8VZU=O4n&Fq7I}$3w_`QHxAFxc^8&^yI6cf z;?;gl#z!s!V}aENYwxtbqGEMlRy}*3PE7tie)A5)%mJdt9<&B{t^i+{qu2Dd=sRur zVLpk&X0LMACkp1*fEf!}rr`tI%msCWbA@mm2}WcDIvNqQZly1R15H1rzHdypQkP`_Tpe8H1?p&RmMeiWx2 zx*wv)Auwvqo=6)$#`ZS$Ipc%b#LRT#2MGsiBSi`>zTwZKupEt&2pB#Tc=W<_DV#aN z7oFH>0Zk{Mdm=usPw4BRzR&t7Pq+H~W>ud%ULSTfRUhU2J*faA%s>YiSdmFk?PR-+VBgAMC+0*-2HeNyq*o<3mP`O}A(b$v>{6R1F>QM3nWCBJ@F>A zF)QKcxb#N`xG;U$d9af8ROyB_8RTQ*t|;8VM!%2o**I>_hTNHybT*EYmuptQ`O$HU zlJvoY%FWTCj@|$UAd;|4KMr<(jDlVq&DkbO1-)UpQAsHk#J1@5&5g1g8{owpWb+%} zgIzwxmpvCg0s3mu(x8zZu)M{*@HRw!g&vy_n>ukmL~0&jOf4Tjvu-&g!~INJ%A}!q zQghcyb~GN8T}Om^#OK&`;@a+8S=JECnzWT=*LDZ0fOfleAQpwW?abu-Yh=pBkJ(nJ zl_bA2jVFP@&k_BD8HD9aNz#ndIW{5)>H4wx;830#nm2kzRvU2zk&cL*dx_SN74qA@ z{Kr`8hgs@pm;@_)0Z?oB98lSS(IwcuCo2)J6FsAm#2VqVdw?(?Q3ig1=AF0idFqVx zhR>vfJrA{cNfX)QkNy^1SINZ^!SI8#=0Z3Q9zZfI+aR!{r6vTFz#{_jlPO~(mKdCY zB_77cON&ex5j6k{402Nj7NF=W>)nC{O#7fgA|g`;_4zV|1t6+Qf(3H_RItDteB5O8 zCLPC<*t}X=(@Ouxq%*BHK*u9S7|+$WS6kO(?Y8>Ry4rR1fd(?2YiqV`udd*v^UPk1 z@if_Ibj^3qeRtn;Up*d{-Gg8F<1-x>7H?er9=VUQWMlCa^IhpOUdLiA!kISa;qKu$ zb!*2oBpYwl++RbkJp9axW|%Hl%V)YR@pLAR8MY`}%cCC*SNg&5Q`GI-0nf6?Z`3LC zg>V~eH>JqPQs1FTkvMv4+{+lv@k&~%ClHZ@7SLkbz~Mm6G7u0R`S zfzH2;bq92Wx^l5l-5?RN+9!oR!$M_Qi3;uzHC*R~f0Y_qimJ@J;k3>5BEe%Kk1aeCV%*DUS^oioen%IFNX9wSp_< z&(!i{YWgv?Ug_90?!(l*7z;cZmZPx2bOuP{H?lYB%XB)%gAdcMqXa*G=EQh+Y2{3J zAf9eEj0fVQ4|v2edYd@JP(Dl})P@y4|NYuH3vzuUR^ePmibRX6v@9gnR>X5a&(5T$ zOs#(l1yG?|RsLn1ae)q$wtYmMGw7MprVyrFVKyNltt&0O+%MLCz{`pdj1{<<1zJu# ziH|c5o+7%WDWDu4MWy{VoQ|!w{RXlJ{V>1ngncKXNhg&=PlKGL26)7BgDDO(`JJao zI31I0e2)HRlW6e3?2x?Dm=aH{MrXpEPz@f`5eT4mCw<) zO6K_dE6poZBZGHwI`h4NRJ*#Fmv@@LnJUv^UD*CZ642PRxoW)8$ne=*bU71Uj?c^s|99HV z;8Qq~i*@J6V1fA&-V1N{i#e>wPxVT!N!kJ0n&V7tPUs01(p7{Zb~Mzmd#8%=obvc~ z9I%vDEbLvV+ecWNf!JssrhGIHaDp*|;I_ZM6*UHXEqobzUG$S13Ce6O6=4aB+$L;j zY+9>;W#X;MM5~(55X%6X`Y|fRGWb51*WII>`PZRVP>Uu)vdBB2SjQ;&ia^HUJvY)r z2C2~-p`+Z?m#?1n!aSUHt&`>A=#Mw3rD)f39E$aCarBgYXaAO){i9IZH06MnY7zZ-K7$L_}Tnx0dMg3~eRxh&M@G}+lmAC0pI zY3MhdL6>-=crvY;x?T zoo-p@DHs=mUOHfUIhs%Jt*{ioh69zqDnVasuJ-wGCa$Q%EMiFJN*C8SQQ9ZaJBhO% z;25rc)83jLT3u~TZ9~21U7p)WD^l<8;kv3&g8@!Re6tE%J2?t#C5TG#3Kj1+r6N_i@qWRBaBC7GDCc=a!W#;CI-_t!T8ss3i z1_*Vd@5FY0%8C3UTfy~VP}LA}u4O$)8$9>%!jEACURP-fX7QB}MFvtPZ8inCp_vXf zc4dTZx|5@RRKMs)k=9!o%*qJM4bHr}Xeod<tTZskc6(a24Xx z)+}%WH4h@bPk~|)SCV(AwdgHPq$q}3*1rX>Mp0RKGzYKx`ZD!uN~}0w?iOgnt2SY! zxsB3=xcUj4!2U-gz}{}!*Dg=d>s-c~6tMi) zWjqtXR!<5s6@#Vi;q)GfO)n)CxH#>_935;&bxywt3OY1jw91OGEOI459v5a)T7mnQ z0v=#>>hoBtI#B89ou<;$YpL|~CaU!GnkqfLqS7;DX&j-u&=$o`>23iHs74lw#+WB3 zZoGmVilcIv5lFY(t$)a6l)BT!*?YFNzd(^_1Rmm=o=XLyYViZ)tog!KQEL{sNB@RC znlL?tLoiE)F~JVQ!#`#b7ZRcBK8m*pvzh4cY(Q9lOMFgBQ`}JhQ_yH>Ck>2!-!?aN zk|qBE^c8^9g8-nPY}%a_K*Dq^lxWMZxVbPkVi8YUR8>F8@KPQ*b$0tr0COJc?ugUacf8{ zwJ1w?VzP)25a#J6Myv21ZoqbH(a)OB<33(Kw-o)14?Z}?QaWtI z&5gstHP12uWL}$Z8~`EE!Mha!g~Qyw;=^d|C2OkcAAP`6Q|qa~F7rXnv#VlPZJl@s zS3F$qH!2OEJhJO})BxKZeuu~1WIS9V=rqHrH;`N%^gi5Yq5wBnTCWb1P_KL0g;V_U z^1tiBOK_eI?T@xYZYTmd&Wz57-l}py7o0qEaemC*Av8?FjT3Yd?miC+@`r0kL8g=1 zh>Sgs?bJC!@KG& zd*#dYcamu|Or$kjG8(fIFOY_o3&vACo_Q}T-@BRSO=5~;I2UZ~o&_K|2OQgVwJ|Pv zVFRv-rVE&LB>^?QxW`9;F~_ush{5DP5hlx?1K91uj|G$2jt~?DvMCiB5+DTFnLsGl zPmN>u!kz)}%Q8XHEucteB2!B?+ki1sJA!hfJ65X^7pkz}3UCLFWmYF}=N%CPF=>!5 z8yCM)3Lk?)wZM`u69vRrAPN@-cDfUmNoWOIVSSx-4Zz1r;u;_w$2OU*uv=Rv$0s{> z?buFc@0DaLR=QW4cUiDH5L{Q{-MV&T$=2e6_q})P!zJrVy=q++?D$YaRb9o}+PdOx zPwW+nFsY0s8C+WJU03_=ico3o?&6BaDyl(w=HBjk@IlXpU~w@)E`T96ozn<$eW&K> z1F)^aj{-KVyTr?FCZ}C)bGKH+9OdyGpr_T%EZRwlwDSh~5EK2+e8n5U1n(~cfX~Kv zdSk1cUvR@V&#(5AFt7B^#gP>I8TKu55+Bqi*o@5YSqG#LV8;g~-hwq-3ySbN9UpL?F3|Av z-;57-X-oStkj419$_d}CZDx*8JV$)OyCu>-;X{at{(O~8cx<(kn`2kvo4MNeY0l?S zNe+Hgvy!d$|C#tcVZGZXc-nfOdxEE7ZW5@izyX^30!AedKUXnX%tXyHZ3Q!x#xup| z>$pVP=j$|LqHkX*^A%fDT!zclGQ9frm3&{i3Y-*Q>FmKb*@MGBKo2_cV*&&IaV zSiNyWsdsZJZi`KRuCce{O8Cm2_SL3glI^SZ`XGLd4d|89zS{RlVyVDPB!4zum-15r zPAbhr26(c@ScA=FvRapFo&msCK7Pz4HPc}mH=Jc!Dbt1G=}Z}FGJR;}9qrt;pnS+q zhQ>%Y%&&w^8CQ&6qYbgd$#{vrUYo`UxM|8`*;6bAY=3doYH5p@I@7z+E!hwKn)8P! zEEhi(W`NeM&|ap5bDAjSLD4iVMSgf0fy!3gUzw@cX~)lOizr#Y1hFti5z@47xhk6~ zYf3b{UE9M39E~?1*w_4kc}DTFnMS4MTtF!rMqnM?2jL2uDoWC-sXIlYji#QI2C4i| z$zIOm*-6v-9{fC5-jNYx6|_thB&zGGpj%iFczEH8`)Nimi{PSzo1magO=osx4tk%qbSKUgW;({e^+ja@ebxn;_(b+F;}d+Nz<%k( zx%?$5W7ndRa|KIy?(MO(;nnawg4s(Pp7&5lPKD}D0dplk&7(qfr>RgK*9%u=yk3=& z9*2f&Sq7n@L-fKiiYSuV5FZ=Ri(jJ_bii6ji4fhA6rx*Zf#{a2 zgy@#pA-ZKYh;FeUxg#wE5xW*2fb8|$QlE~Jv!dMTn!qK=nfB+otD98z)t-L>Y z+A>Md6m())H;t|#21|raxW&>TeK0Gu0MV*{H$d(fLGJl8qp2^&Z*5C}QPhWp0Q&(8 z z=g0s^v@)q^GOy3G79RZ#6)e{am#W18F|oC}DLjc_Jwz;aJXV5Z>~W|8*ksg8mWmAC zG)+?aAa+G)QHC8h}dDVXfX-42pyu-}*PrtKnwj?9p@raSzDDULNi zPI27ylN84X5S~GJE0~Iv2%q|CisRS#zWZl@gOt>?`RViVZyv%me6any);T->(@y8b z$=evY_nM)fucR+&@8=&vU(#OR|I+s4S=Qs?(%Q;g9Ek4S$_wRhzanhivbK8L2RGK_ zde-8Qr$j|}y_0eEd7iZ!x2^`~Z9|a9ET6v^j&(fZ?i;5CfAZ5pb9X5SMp3>r4-C9O z{xre~;Dq?Wf#=efu%@&!(2!aa>B%J%H&DEr)Q!?Fne+&go{T5G;_;yoR%ezu zhtpJfE?e)vc-KH zjA-PlC^jyKg_WWlEfg=z+aK30gu0e_9~rM|(wdmGJ)YFmErcngx_bgrWw@(`pk+YZ zRi}%OHhh9}n_*fnCRdpZy$cRBt`E8JyC6ho8rR_jWodSuR1S6R{Os5X>PsNU0aDn4 zPg=UCGf!rHmOf$P$*eD_Dy%x0ZIp6*aWb2=$&1j;8)SGt$J5RmkV85FCqd{0zg{OD zS}YyPv~{R2sj8Z)_(wRNVtt@P1G?PPq;3ofN7Hq=Iw<@txXhb!XME&~JjY53s2R3a z{(^_Fw)OZUggRVaqSxG}b-190qdvLb)sWlx)E!So%5{b55C%Z6tb-aAMv6ar= zaGx1u^ti;$sXxQJpA5MN%4m~k_jQ4EC`7tk>^`HKUacC!G$X&;zHKiJ*IbtP?y6q~`33y;nlx1=ps>jyBI>qRdx4uzU4Ot{pb78D6l`2_-~(%=&creH3TjY~pAW+J?Sk zQedpAA1q@r&un2a=Ize%T#!yTkfEm*CB&w{X=E8{#|ZR69C{L?fiwCcoa(KSfCmY4 zoM#!f&A9i*N^A|AkbxAOj{dU@BK==tMdU)#s(}e@XtlP3=^Cq-5qt^P%v(&aR+PDK}a>J=B+9_b{n;HES1 za&%NSioB-p0s6af|Mch(NMl*MN6vYV0#nDpkmgB=3nK<49n9l90u=2KOeCgDA7^B6 zL_E)7fitnd!kuz96QYJhW<; zi2B_ZV_Ob%!YmIctUzSwgft9CHzX2ttBRgb=?7OY8o?v_Gk(rOTQSG~AfFBO>|VJL zP;8I!r^9J%9Ev@t-dYSt^tK`va}df3m_|Mu>RCWPYRy-(fTgjYT)CW&YO~A`4!tIN`n{#zNhnWvok=Th)#jP z--8xR_2lQ^7Yp6|$YL$@l!q5{@f3~6%b&3x1Wwiq&{|_CaKb%1uj%_(!QHw)k5$kE z>ml*Lde~oL_znZAc$r^!yd$4`AjL5{${u@<%(A}3ohz;^NHx}Dm!|7j*+gxt?Lb;T zy!m6T1rNZ>f1B?BAwS-kkJ<*y$B_lc0(SISMn1IXpv;D$lTnbtBCBt1T#+}HWc~D@ z3+DO}WQe|W15wDhDD2wjR@l{as0hYNli_V@<<*L|wpOC8Z~-y)L_+K_tWL(3!|SQD zo{D)~Kx0AjXG{mVAm(s?h7TQ5=H3QAsv^zz?}RV}iIbo(g5VGa7-4`B1VjWDI-MqI zNhh6jnis`w7zhM;6%vJ!48%?b+9m_8WWfTeos}MbGj42y?gKd>^Kkk_NkXsuTNDyRp*=+Srwr){UVOsG@6XkVyoB> zhW*E+0A4X!(+hQr^PzZ>=-Ip)szSB=8`SHc=Bzd8P1 ztG+WpeUOH>k1F~-)=g`0{`#Nq_g+wEt}?7MS5g*fst7Kaw&h0BMFDrg`z28#e9tES z6&1U(FN#C`h7zXDi!a6IhYQe5x?)wwJ3Ws(ai20noR;zdj6^2uf&UPW|E z=C86#@EX99vHkEFFG&N+fei}pYs6u)Sk`nLnL%}^0w^pUavEim`BRn+W{h2o^(VdR zB&veP*HC?YUSz&K9Vow|t~VDkAG5Mh6*7N|{CZHbaoA4>oL{x3gdb-lJVKIbGS|2- zWKA;=Jc;pgH<(9{<$EP*m?CCGD``)cvxVK>7~c=Wn7(T)tM!092wO3Z|KJxzm}Wgv zg!8NY5g8O0Katn`Q|nHB&$hl3?B1%h<^89Xr|OV2o-fyVi!4W`(;H+eC&PUp9h5HLL*02kl<2tp5bIQnWj>fL^>JnzTRxZ7o z7OhnyHGjguju(r{$U9pNt+S)Gx56P-&2d)VoLOD}o1o+8LjzwubWV-%G{zUZzmI$~ zt$b+PK4v#$yT9kF6J*$)9r<^>8C9_P4~_u1!%dE#ZQh{_A6%9+%^sYLk1h)~?}|y% z(E#xlnwaFP-64}dD+4hp416hI;6Z(N6;rfYO&nPqQJE+<$k%sKF{;tXVuFP!vuT-H zqEX{kmEU}i5?!LJi|-L_s>PVo{3|`%VHmED%y)V_$JEkEwtYr>)5@F`eLF(x<&-pk zJ&{+{nmdF>`WhxQS}Su|(_panj#W#-atDpRbx`?DY^l-$ne0e?-$0E7L+e~@cQ|ur z=CSDnXO3#wkd+ztWnp|DK{CzeUeuU|2j7*m)m#(qj)fz8nJzFD>TgJ{DS)e-0VBW8 zbeX1(q}Df0MLHVPdDEgIpchxsA!=LRyUnPpU0$WsD2aKlRSD)#odnda?Qr$zv_&#quobdwLg<>#fXgp zD;In`(NwLh1%JbP$H!oKo*gZWOGxYmY2a4TF6*DT!J^9w>VzEv;rk*o+5*;;@;=g1 zL}!T#!IKH2_f;&BjLnBTh8{att^J}f@wgYVExMZl5Hj)?LVTY7ME%e@Jc7-RR^Hi0 zLJ-gF=zVP^F%Xj_EGit8$~zS`-v38xU*=D8a;VXAdjszsvkEV+2^KcS&_%5p4Cv0= zNR1Jb)~Kcwmv~<^reTZu1<&|*!nA$f#_9L}&AA`WKFnE^%+kzrXq)5l&qeLYJVVi^ zG>`t~+x|kSZ)9DIX(Z+_X{+AC97SFaCQ}-Wu6)D>(*ZmZmm0fux;$u;+K|=vMsyzr z!P~rZ`y&W;)u}u=pGl3>_e7)Ghc+YMjxYzU+B)0gEHit5=)Y0TD@Wmw*Dd8Z!f+Cg!-V88i@S6?{T;CU=}iLs zVc%-$dPX({PV%|x9(dzPDm$W_QpL+v8mGXI4$wR><~#wGXj8-}t4fj{U&Esap!uI6-eNDq$(;AXG2vDC3vFKwTf{O?_V>RfEL?!!eT zckvBHw`7JEmMmM02ZQjg;RQ49T(l%}cKO1YoZsWPEWgc*Ze>4EI-_*_x2UG+_~(-S zYF6od`de%JQ%_yto!We|=c@G8Z=uMsFoNOwpT0xq;i9AX9n3dqQAHaHG=}Hkb0}iC z;nHXHAMlH71o8RO1eiGf#$WW=DTrVDBtG~Yc@#c*)KPp+{uIBqTRykrm%I&(ao+W3 z{912(R{R#f?lV4DW73ZOX?i>S6khl{Ut)U-X6xn|a?`3^KzvsR9zK}_zZ2nsX19z$ z=^5m@aZG2m#t~i7kku`Mr3M1ZQu}O|Ha`Fp@wBwmi9h)e!tc=X3sE+k@%K-VI>=$j z#}Hnpya7H9`5uyn-`7I=X}1aZI|MQsBI^nC-eni-y?g~Uo|{(hM>&bkbOa@VKiF!r z-bAPSqO}}7gk2>(+k(C#>rL7z$FIS2n0O!4$Cv=qfcPWTan0igg)AxTF!^adl ztJglui3h(QOS7XrLFEi0Gh&@*rgg>kdPUr81TqU;=|f;-+HE+pnXH$ zaiiV<&PSM*sK=4jJG`g4vR#W@OYv`s>u%Rv*G&9f>YC>Ax|X@h@P69a_%#cKsMge_ z(_7G{8h^|-l~TG2KWgxxS4-Dbn6=YP(9(4U$oazOQVclq(&_d%hRkWrGJ22~Ojqu? z50?<8%nDQa>W#Pr>ohN^U?1b=2qu2?d#U+!GyLq}{70IoLmvj0;~DP-O28v zo~Q{dSv0d`>C*fe3rY%R&t6(mmN^?X9OxT(F-C)yt~@#o?VxQr{NB(xOwRDQTO}TM z!@kJUpWTVq>Ro7u+?EFLOdHaHv_|%(;W6Cy@Z8+F`9SFuI5h6LQi@5|(yy5$h8E6S zxagjRu4%erkQLXoN%C^_Hm_Orcae7#srMI|SGeK*Z9!y3-@^{;aL4=IE`L4oop5;U zEfDtSTifo=I1>F{%1vIC3Z<>@LE0 z&^_*abrE6g`ZeWC+a}vR#?oK@BB)DuR>?B_UWWVgKNw{HU!{Sm@hw!h@8h_C>vWrU z68@Lkg>Jj~1;xGzQ^THIcYcmHoQ((gJjDe?Q<3ieOJ=b$II+3p{dGM4f)GA-KdB%u* zIp}oc72xTn2|hH#;M8ET*MG_WsKZS37UkpdG>)RP^M=8V9?u>dYR=$mO0n=)H$b)N2tQ$J> zC=+(LaqwlxRhR|zt#RQGVrAv1uWa~JN3Y>jrJOfQF8^Z{Gp(FTZX)%6Y(*HF2|0YFl*p!FUMVC!t8AI&TA+BWz$xv=m z4oVs*@o?(!q?N~rvng;Ur*!JL)F6Q>w z3+YnB+oNVLla(RKh^t1$h1;u-dtbUi1Q_Htef#a)gkhV&o)mjbyl*RC*dynu}tlJ z>}EQvgeI$x`M~+e80~x{Kxe#q1v{Xqdw#+gMasQ2RxG|mph-@3#rBBtHla-xBZkJk zNi3F3y{pGQ$;9xq8}4>^t-jmgExenR7#t3y^TDm!`QXcRRy_zgO;Q{F2kN!+fx~nT z@r7~+k=_F;X?$agvx^*or^XSIoNhm`U8TW#+n6jtx-^&R1fUD^lf;+r!nq8+*Ckqm zd;C&SNl4sf)LRw9t(9nmfbhy>Bzez?c(#tNNpd41Abu({b286?YwsloxS@|{d-j-$D6oVl_@xg7l>V6Eg4|Ci%G&iG&djwR8zNlp-&T0hb52lbzuJ0OB8i6Eo- zUaQ_^0L5`f>Y>Z`gHlE^P9o`oPN+&g>GI*WFs|F!AbUi?wIU44hdY5?0OrL-znMk7NjSRt#3(Bb{&QMp);;QT%D4VJGD#c z)TvYZPCx39+No2=D~xGH{@QC8+vX80n^9K26!Y?>nfARsN;FXEp0*#-|gb7Nu&WlV#0+{Z*11bx!;5f+P^!?ou6Hh@68TNOhYbmogu6+vKVy-JjSnH znDL6`$DQXbD)weuzl(i-Z$YTo`W^7*XTuI*{Vww26URZX_1j;7_u|k*;qwN~eX#Hj zV-*s12ZO#GB-vaK7WlnkI{Mv#fa9J80a*}b;Y|w@VH61miVAXySa>?`Y6TmXH8F#k z>qS%Co?@D){Jvsm9?ZgDJvw6h*Vn!IAwSIlRy_Fy;lfZsu{$U)_;GtYTzn&#xlf?T z=XV!P4Hp-=^Mio`SYPnae?F`Uva+=E7jVPQFu@(lD^^~8#lC`kXFRrhw%3pP4BzH0 zDsbG#cJ~wnriKgh^^1mdIXL3a3Au~1!@SUT{BS|7$;#c1U%fy^Vqt+xQJOq@irm56 zaCXQau>EI+CQN`igH_3dTJ@pZK)4|5RuqEmA9Yp`D)M;6`T=u`AMGNj?Jul0b1x~! zJU2_nGB6sq>|ogM^=EmDg1Npx*o&`fhp=YP=87Kan2K*IXXS9A?+r+B*mkn>BqO}e zcQN?#@g-RMUMh{@e0-G~!F<7DbV+ls;#_&R$7ED|Fa$Fk%yCv*om@~fktG=P7KihE zXkcMfK1*BI1zH3uTUvT?I14Waa@tyx3@Jz#I1af_`_gC)X-xq{&N*4zx}&GS}+5cM3EKUdH8YUkPDQ@2&md4N5FU zXjHp=)iq1wS@*(gmpsxK9ELEHw+ZfI6gl)6TbH9R1W>}>3CLG=ShZ0{d9lGMBaq$R zP2c?=D)ELgU;Z!-FXsB>DL3DQn+ARU z5PF{7j^%nA{YI{93p5OWRy&aEqNxJ~K59vw9=UG!OFPE4-SgZ*)UrF@)MAq+NA(VzDpFzOO&PA&t`kyg$xv;Yyc5ndVK!OT~)4 zMWWk6`R**3TZ;=AW|A-4>u5jJaq#E&bkTCpYSAKfl}ngEgSv8^kjD)3YprD@#(P6rem%-o0++$ z#~!Mx33&yRt?;N{(QoXERBy)rWcNg4qYh_#vqCvJC{KM)Rht-z@(O~^_JFv2`MFS< z#kwI{`SWF?lCy%vzT%Ly2){eqp(nI1!f+FqYVMKkmF^pGquqtQ{y?!qZyUFQ$<({y zf(aAsbZa+U!!Sc-q|>0Uqsbv6ea++@@1nD=`SLMDBDr3-jB(a={LX{IM+Q-eK@h7! z$KwbyA5`pCE8TjU zXyRoZVq!HB6;_OiL|lIoV|^QQ2lheqV6U@HVcd<)b&0&_9FW0*o5EquO;tosQOUQFo)OvwcBS5+{@>0v&%| zL4MAyoQ<*1S{+l=kFA`vU#NAp+L#c^GvTSHe0*e@{m)UCrtVph=nxo@?Rt`HdEWe- z;#^xz>3d*SjB0J&-#K09OvnsF=Kj1W!==ouo%c}fRb|4y&bf^*A2Vi*rnn_*#;O~q zn{(}A^5XH?ZB^-b<{lfQ9=x~Fq5qA4^j}N|sc`LkppBvsF$0!<-1<86V)AC<(S20! z_1R%`dz2t1%;X|esNRb+*Vr%EW|8q$_YLK9HkOm`yA2vcwQQ?A@-b`SRF*TCAX<%c z{1@e@M*y~dt266*lzYMxyQfJ98sCIGp9fRtoUl7Pn@g`a-OAEbOE%QM*Ve`MP&J{* z>kUuxJL0t6vQY^bt(Z_Qhjcnj8LDkXxXSd$PLnS$&zpm`;LFFXHKc+jhUJ_HA+ggM zKaVhRGqKo3zs)(vFmBQ|`99Z#beTTsSXEl(r29a&Hy^w8j=buzs<;4c$d6TuNvB?W znBh=OY^{2rV&-Z^hI^}ro3JLG&<%ltpk7Jpu%Ud+?i}r!{R2*Mea3`We#1C3kQ1jf zS*M9}O7sg~@l@TFt$Ug2NH*FdSK9IQEIrL$fm>x|?k~$_cQNb(S)pRKDjly}_j9Cx z@?gnP;W^6G3UB%3nV^~xa3KUz4N#EDG9@O`+!a3cTuL-aN zIP2Nz?kUK__?oc3r)eNgncMAI>k8AnP$GPrD`JmNSHKP3dy#aB+a=N^?!l?~#qKFs zkviIk3}Bo|6@{$+C)YUZGzFy7A=iyE*VjBn9^=bOukJQdby+@p4&gM9Z~v6Pb%&5Q}xVlf_0T6Z&rM4N6>qmNJy>dIQ=0^?qsCh^Fv zBRu@y+Ke`13(_q>V8;EmGV6GecUrtd03?gi#EFvLKnubFhvB4zR#)P%*R}hIdChGU;}EY`dDd7Ie(1t!rLbA2~zF_69xd zDEj^~-ONT=N}JQ8rgk%7mHkF79!)s3FV$nTUp3FS7UW@Py2Sb_@#|TO4kKed);-99 zl^)fdOwY5+LtkgRvx?oM#VX^Rw#!&uzIYj932qm$P8)_K8o=#931y=9HS*k9UTe;1 zbT|`| zQ+6=WxKX5D7}PNRvnv3n99uW3ONZCu|{ zVQmvpd^p^IpR=az*3mXp7~~|uu0*34Oh#xJajCS**tlDF)9JT#Fqf~6rHV<5)vg>n zGF);ScNxoc7R@y*Aqu#mg`>f4n1t;Tx7tq-J2O6yj|)IkxsG*wHV&ZD8V#+8*<^fM z(DTr^X`Z>Sc4Gr*WslHq0Zz1K+l#8x)S+7aN$*5MP`e@84Z0pz85t7}HQ{Sp_IquIjM^V%^WtXgD>oO{O|ty3>%M zN^la!EY2qE@Bx@@FXm>-Li{kk#Bj>GXs1Q5xhI73qu*#{dPP6!T zdUjr?RT2wmnfU7KCY`bgk*EOR+%}=Uus6* z%PLD=bm&{_y56;Qma$pW1~4}h1*YTDlQ`9NVOvE-Sm}1ymaSk``CvaK5eUFT-4qr%zw(eap-k(CC0J;8Wjhtp?TSoCIPYlSsw)P6X;6~Lb4a7V`T zQ3=^uW?Z!*E4ZDQf@JqPi#T^&D-%Xcr8+i%0n=j!u>Jn~4t@C20o*m^f^y29pdZTf3 z=p<1m*1)Rs=y1msJ?LsT{J~7znmJqPG<^=U+=*B#S=ZTC%^U=l>$v&OB$x=rp2AcZ z1FgP~H7ZLF&ky%0{O?2Vb+nPuaqdqudFQBkMC)VE5j8sad#L#y4)zzr3Ao z-(rGHoO1Tbn6mkZm_2^DvwQ_=CW5I`5DOGXK9n1Gs~NSPspvRuHxsWi*P46U@iM%& z)WwB0In@)LR`)gT2;a&L!wcpy(2LR(tXX!O@f*K(d7vEgvYAm+K6+0c7uEJt8`rVn zuQsvUaI^Jv>o}Di1vVmWN-_6Td+;WYjMQ$Yar^Ve?4|Fk?FrI7xK(D3B${}wxea%? zG0~H@>nK086YR38ZB`RTw;eSbbNDr>qZJ#QK`3oC?KR;f5eaiRc{&zDp|+PImek8M(%4SI=Wn}d@G~9HLhqIzVr<_shTh*sWqT!!@4W$IOF%k zTd(Wca(%^eJW$QxbU0IPs_tp~mopevS;V_DY5vR0Z?6^%G>b-d@oh(0|nMjNub_6cR z^&`7%-F95o**0l@a){Q7kEa-|_#E~ftKF*eZPx8fxj_FJFIHS8&Dy$RU5~frb9!s* zDYNIVY;>$0%m48^6|d%veoRGHyt(KI-Y_DR3+PxHA{Z zIBU6Kt-+%y2&z|%EGS3&goEtKz<|TkSys6Cy$I62ipAwK$CXUL0pqmKYtzx`(coFm@tL7<+CZ zeaudv4$D+q^`V=i2@7kR2S>|cu*~-qO;v}wTj>e4mh%)BZG73fK7gfZBV9%>fUIW z#?B12gJS1-4U=B1PjLE@(_wm!-={OWB}+Ds)qyn=&S4j}qF^^Q?)JGP39L?5S@kLP zjAZe2HcC;sT4BBT`meQ$(P7Z<hg%YUEBd`yNI(`$ztb8nkX@a|1W|=tAXn63Mir$`AJ9MGLo%RH4e6Z4z zkNqMlM13E5whV(fBXno!r!?Adf!GWz6wVjSjEv8kp|rM^N;2wa%4O0eB3^aT-j!V<%H@uw;4hSQ-?)oV2joh*i$A zD7LJqd@@3|hE082=YC{(<)co{vvsZ4ysSf<2A&GtjBQYyq}J)-elZ4EJd>xVLHauW zIBcqDt32?j-RRXi_@J-ZdyQ(##@Y7F6|>|p@u2VF)<_qJPRH3mjFoZc$3;uAFY#Fm z>=JV;&BVd846? zG5eT_y4IOCqlQh|xIp3f13f7Zxti@J<1S;Q!!T*CyF+-=(oGb_0aBLfuU4L|oTdeBGElpYE1w2TPJUWQlw8P<{Y15>Tb(xRZ`#Y`O9Q!-^ z`CxsZo{v16dszq1&6C4Ae;6bAP&TLIm?rB6sNFCT^x~+1dazz>P4VZp1Cz1ufH`>( zrxKlGu(=MsrzR&lK3>no1|JU-nT%QK%M0ZM@^C~A2~z6}yFB=8lzv*%+2*YJHTooX zGEa}k+scevz{IZ?F)R;rZ#_=6HbLriYj?Yf+t5pFz4F{V+pgaBF!5XS92yNB^Bhx6 z=*jUjRDEBWR%25L`wR$a+t~CI^_(8bbYGuVwaY`F0b;wv1c!{X>&Ly}!reN~Qb8B$4wqMM3eNGbdL;DpF#!a5PO@- zq*J$ESTSVpLT$Y2aG0EPwE?c_AolR`Z9WM;ko4v}_5tgr_K-J1If0IvbN3@E_Tvr$L zS)(@er*Y56gY+284AwGr>POtI-?3>DUX-p^(ChLTB{0&C-s1r6+hyzBarjm zmQ}iKKjtQ8vTxrj&UTA<<5aODO>EA54#7-9wSCAaSi9nEm1@!;3CGbqKI#Pn z8(#**x8GQ4RKprx=27g!L*7Urh-$=yPjE;33|P8D>peE@xN+cC%tGYYnb@P*l`thz zZ(_3IHGbkci!PUZz7YiH>ailS{G+VpX`aN#>`XfK{74mWIGE?ft453)Y??fZ$mc3B zf6_0@NvI2LJ=J@i`hhf4Pi?)6!gOBkhk8uT9Ve78uba&d*?rLd9eeaJgy3x|eCS!b z!M=hc4RUxMwuSh;Rk05#m8>3CF=@oRhhSxvhR;H9-it{J`zCODqF)YR-wWl6(=~iB z7|l~1cDJWwI_^Mz0C~d?EZz9hD?FB=CUe@|)TK;L?Og~fKhA!l&rZmloVEjPA5zO8 zS+v05f;XVagH>_q(8u2s-YuaXD4<8Yl0}+@Xu|k;8CKUO|>S zPx(T-#k0cRY-JK~^a;dg{BvU4ws)Oo_*HQ#6_V>#ZtvePaJFy~^Fv#qz;2iVW86_leal`UGY zZKV?Jw#f#~shB+Rz|ALP40D8U$99QOi%r=;1 z>F&t|lW8Y{Sxzm>A%kKeqwI`)X9y2-Fd`q`kH&H@g24cr?WRM~l7UTzESNYs zBevYt{1b1xl2@wO&WYhI7acEcM|c%O>-LgxU;fm7t$QYpe=(v;}RI;GvtNOax(=eOrGS}8_GUaN^Lqb^l;Sam4 zkw#qP_woHgRve~|(OT_m=DyZ7QAgO!V=FQR zXZ&l+t}#;t&2>Gujh`p#duTVBFVwtJUpIAa?2`pDOva^+HYIx^uEWViv*K!fEu2jo zhrZ6ti5=5yM(gWNTab*$m^E-(Xu`$0^MMc@&ZHTOY|F2?CQn5=;*fU7#f>@Jm=K4Y z2{v>1HqzCmI}hn1Vry-z!`U`{tH!MKnYO^m6YQJvc#Fx8A1{btdEz|;w7|(LON^V= z3v^JYmi4`KgK=~YyWHUB;X5@=JCVH(9Zu^BIe)+`AUPLFqnr-NBJ=_J!P=3BVV+#;Xq&5UNl*8 zA??n?Bl1(FUSx$V7t%(yW zP9E%1=i}8wq0~SZaTiOrT7c+y5gwBUdHbc#yImfPTbGAz_p`$pw`@1h+B?b@;gpRJ z^9}1=nT~L(`0=hE>EYV1qfJU`@KP3Ks>IP59adh7E7phjZfxAMrgC~AFE+82h7K#! z{$jjj!0eUk>!P!rt4Mv_l(*Im)_9_(?|MS!Xp*MSI>sog4vZd9W4B$txQDeEm3f*o zO^C=kv~KdCCPE0rohkNNJ1(yIWZB6Hr}pn0E0m6n*H5@Vrq%hFbLlhgR^FjUFb7I( zznt{M%|Nw(98C%bCOXbLI^uC=!=%fU2Ocm{ryv}4uWgI4qd@U+`l#bl*MqD<e?2LUi&tD*#Vc3MVG!+KuJIHIOd2%#CYF)7o974<(%|M{bJN`0 zbYp9@>lBM;KCy3Cww`;tJpmdvm2xWxc;snhryJO@@oueGB%GR<8w*9en~4+c%*z*9 zIpZ{L*ks2lJ^q;)rbk{fdyz2Ev{atX=ZE9+fH-CJZ|i=j&x^WY-32Y8CJymojU~^d zR;dNHGp9eJsM(LzUT(a*$+H{;)AJK&c%|id-q(K7mebvYH#(;+HxAg`ylTshXH}p~ z<&c!q-R%(zg<1V$Q8+O!yctHVtp{jlXL#oKVs0kQFl^z&Z%Sb}!>a3yLG1!w+|7Ev zQtBGh2$h|LIxzQ3c!o}efw9Vzv6)vp@23niW_#cGu*%X?JcaKVW(X9qXgSku;{2E- z1UQE2_!%~!9s-No7vOad&I4iaqrEH6Kd;*d#Ny);HG&uZnx(AsKG4IMmg0l~f;g}9 za68Rz6P)uUNBT^<#h=mP4tFeuN8KeNaD-U_+g{9Cw6W7NjzW5 zbUE7)qG;6~obH^GI@N(Q{SJSv^3M4QCy|_5JKy8W`(sNekn8hUmPTis%oExoj+S6D z;3yYe9(Z{H)_JCOo$e~k#oMcPZ>ybS4=fud9xQ0$-!Yj`R$6;$Z;pGLb~`ztzv1`< zv(u`4_5IqcTay;`1~Wvc?^Bd5FSL$dV>{BI%g5O?cp}FN&%7k~p>ZwlnOEAbS#SOT zR;lXrk`Gh_!nUw zS1$6SDowexhs(-^@J~pu+R;h;MJh2#igTiksnpwKH~CYad}%+u>7d1L{bp-kHqC4m5cnSx< zj`kM+$*!dOm4oDJ60Sb0u5Q}I-2G1dK-J?%3_qG~QAtjc7;1Q>zq-;+uB=l5Qsl>4 z^`pJ~h|=$c>!n`XpKtk2H-;ajul|e|<@@W8Kcj2wOS(&A$Vgw^paP*Wyh3+2hJT~G zbid5>)lbr08biB(mXc0#wNp7Fq*pzJ5@Qp2*}7@3^wmqOo32)YrZNzFIw8Gk2`WI^ z<@YTYbW*NJUp>Z3N{46VRwG;~Dik5Ts)LHPa?c+bN)p&1ef5v51P)W7(xfTqDv}>n z|ItrZ-WByLXGkrwfoxS*li**fh>%`2Oh`<7;%2-L~HA$ckhAE=vjbh*Z-uUnZU zIg}q&e}kSu@!)&guJm<(RE=DIRQ*l$tQ5GcTnsOS^r|9t^%eMBc_Xe8(yLs&J@WSN zNh*gc(^t<>H^*1{DwpnHhp)aJe^?U#UXL)!pC^6wDBEAB=fvMv#$S8fQTgkL{!f3R z!V2IGcSa|2NdqIKS3Sxkpv0OwGn6T@4^*>*y17S%f+ig=4T6wf1s$Z~!d3QJgvHgn z)K&CkL>y2*kY>2}@uTUth!lQ-xKf~;QH=PJN9Q@br}x6(_PC@pbUWxjUX%v0OC@AO zGH%KKK}fIqdki;HIQTT|c$I0?U{4hl3hzx7YLY8ig(9R^eV?f_jWQT-^^gC_#v{#S z;-96co)yn`^p<3&xUN9R-~LQ~w3i;YBpo2_A)O+k2Huhjx?S$f;5FRkhGZ8o3w^> z4QUJMN>UxE9qAzHJo-W1Y0?*@F4uxSB@H2cK$=22L@FaSkk*rSlXj4vCmkd`MLI=# zl$6#3R7>hfijl^UDoMqpdr0$13rH(SGf5jrQ%T!M1*DfrUeXcLXwo^-P*Pe?(DkHD z(siVpNmr8sq>iNdq?TTwD$>`a&7@}1%cK*egQWLKr$}#+Qm+HOM#?0;L>f+dmXu3+ zf;64JYWs<%m4IzC-$|HS9nofF`w2ZW$w1M;rX$R>A(mvAD zq~oN=Nasi!Ng0`-8qy$Agp^HMPMShmL@Fbdkk*rKCv77Yl3pg|kdBeYl1`I`ky7xb z&!z#SOj0k>7*bc#6jCSBGEx$0E$J-QLv`CppOf~IJ|P_^9VNMb26~&6NqU_$hO~<` zjr1I88R<#VCekCMoumgz2S`!UNzzJ^s}HE0lu4RL8bg{v$|FrCO(*$Dt4JQw2GS_f zHqs5GeWZS*o}g)@uSm;CO{5K^k4QU7?~x9Z-XxtS?IC6K z1HDKZM0$plM|zwzpY#xE6=@x56RDcCopdj$o^%)K2x$)K9O({Hm!E@zq#-09DVH>k zR7x5_T16U2+Cu70sv})PI!wBfbcWQ9)a826`5vI*q%TOtq)$nUNgt5bk`9r!kQzuY zlXjC1lb$D?B0WV)?GJjClu4>3-Asy+rjRO0i%Iv8){+*GwvuL&_L8QOPLc{pDFZ-W zQcu!o(iqZE(iGD5q%zWVr1hk$Nn1%BNp++a%$w>CkiI6JBsG&RkWP@g{Q~qpX%Oix zQa0%|(sa^Gq!pxRNgGH{kamzBCLJI>Kx!ndCb(kj3deZfz3}1 z)KQ=?sV^x+8c&)?nnrSymXSu1HjoCBc98mz4wAZ)PLa|{DYt;ylX{ZAg~hk-X403W zV$x@%#iS2OYf0~twvzUf_L5#9og}?LxM439MTZdSW+Ho7->Ff0BH@W7il}GE9n5K6X_T!iFAf^_G(bZ zSkULBA*4@80n$;@eA3&bHKf-`+eo`e`$*4`j**@uogqC!>hgD>2TA=&QPOzQO41Zk zIcYv=9%(IU25AdvGO3Q_CmkVqNM}f+NL|K(ZXgXJ^&{nxdXP#>84vo1)RXicX$a{}QXXj!sg(30sfzRrX*20@(oWJtq=Te&q()LT=>q9q zQidCJ7ikb_4k?>-2Wc89NLohnkv5RVk+zdYkPeUrl8%#llg^Q@A$7?DT}c{FYDdZ? zo$m~qPWpnhg7hhA1L*_O4$>jgK~e*$k+hqX;sHHR>PdQvG=%ghDUVc3nnj9{R*))5 zn@IPNc90g34v=P&PLZaPQnNt?q(LMvDL@)cnok-^T1&c~w2gEfX)oz&(s5Ep(m7HK z_H^pHc|l*3ZYDL8ib*F(i%IX3)|1{M?I68IIzW1fbdvNe=^W_^QsxBE!=y2!2S`&$ zt4Yg96{HQMrKFvtxukuhFzE;>L^@5HNJ`BCxk)`qBS}L@gGsrhKBW1i?xZSGI%zAZ zJ!v25+jLMP=}S^dF6c8-Ptu2^F{F1%Q%L(si%GALR*_yHZ6-ZUsv|u{Izrk=x}&Amx#Ik(QCVk~Wh% zk?KiFq+_JBKL(v6eNO5!5%dXZIO!;jmNO`1wq*783(ppky z(l$~D(gD(U*t@K2Bz;9n%?CA+GD#ni#*^M7O((rcT1MJK+C+MhR7ZM-be!}!=>q8? zQbqx29jQO5nlzqtFKHU-F4AJs9MW3S9i*+KAn9e2k92@Ej?_pRL2?B^14%tey-7Ed zt|0|TSCYy|?MUlM=dl-Cx1IC_X&>oR(n-<>q|`#tAyR)*11X!dn>3yDJZS~#Dbfbg zqof_ATGBpJjC7n-NxDF~ht#tOw1706G?SD|no24q6_D1DyrgZU(WHH(p`??f>q#j= z&~>Ct($%E#q>iL1q!#Q6*OigJCaotmleUvikoJ<^CmkofMRFB`UL$oQy+j&9dX|(& zdV*9+dYH6^^Z;oqX*Fpdse;rlftC&q!4L3iQC+D%Sdk0Celb!9ceJ> zFsTpe45>S*%Op@bX%MMBDVOvu_Dt$#k-j8Vkv=1BA$>^NL3)?8kF=k3lJp8GWisdm zQeV>3q-@e-q*BsG(ppjtX$L7nIzU=ZY9uWprA`5rkouEuCuNfgNwY{fq$<)_(q_^y zQXOdk=`g7m=@h9eDRnBS6R8_1i8P3G7TbAs<4K>Brjb4&Eh8NzttY)r+DdwzR8QJP zI!=0ybb<6FsmpDkM@WN650dgoQBo;sC8>&3PTEGAM>;^7L24vTCZ*gC@{{_KJfvLG zDAIh=4W#v?exxm=9;7-_XVPI(2hu6hcd4MXX`ru2{Yg!vT+&CRS)}(!D@bpWHk0;{ zUM9UrIzoDebb<6ZDf14{L!|Mfb)@N}YSIeQy`&AKyGV7UIi$m+J4lVBASw0lK|WGn z(l}BsX#{B&X&`A0sW)j0=^9cU=}OXJQajRV()kXc)G+7^QeV=ir17K=NV7xxNVl1fRRkyemCB&{dC zOWID_Pufd*g>;-tB<&+TLOMx$kaU3*C3Tw%T1gs0DklX<^GNeaGe~Pl zlSx}heo{TjLpnklMLJEofs}S9s2`~>sR!w1QfE?t)PXdM^j$m9GSXM1wWKD}R?f`Vq#!AmQDNDG@kS+ zX$t8BQW@zGX)URNw2iczw3qZe=_KhXl4~L8QBoIDEonF@M#?2sl4gyGeG@45^8b8TJb-S~5L-5CB!tDD9@?dw+IPwdk>UQKa5hPL=LwY- zuFLaHI_AP+$vhdcv$5wZvJCgeTH zN027SSCH=@9jcREogw`oH$X-~JPnF(0{xd&1Si9u>1k3yb;JP+9oX@DGp zd;s|r@&)8Pq+JyC4!H)>8!`|w0x}Nbg9IUWK;}U1g4_$KhOC1;1bH0t4CF<~9>|-J z_aGlZnjl|6zJqkQAN3CD0qF<10Wu2Wf%qYlAu}NJAmxyikSOFq$Rm&^Ar)I83}PiCPG4xFk~)dDWn3j8u9?-VaOAZXCW^^UW2>^ zc^`5D(hT_;(gNvNgSv-Y2e}?H6fzp(g%m)hLS{l1K<nM$Oy4$TN@^A$uTi zLf(UX1ZjeN1^EurVIAro(gV^Dasy-(!~^j|CPQXG=0VCKD0Av_sEF=d~2)P|n0$BuE4v9c&AR8f%L7s-Z0C@$n zAM!5bL&#^4FCpJT+CPB$hjfSZfeeO>gt#FSAt6W@G8eKGQUO^Fc>wY-h6!d0(We`nRjsMDLHSt@+)$^$#37cI+P>+)(?E8#f($==TqA ze&i32Zh7pV9^d-JAD`Uz)SsT-{>(o=yW_b(Kfm*Z|M6noOMlq~-~adj_ww%l@0I#J zufDeT^*0*!?f>hW2j2RZw+|kA=iS5a{q6lDNB{MMQ7B9g#1EManE{yxDTl0tL?I7C z9)Uawc@DA*@;c;g$Wh2Akk27!AxX99M3AnKUXTHhVUV$q97rMLc1Q_i5o9?e0;z#) zgggd$8u9|fOo|f!z5=)Xkar;;LOz3h3HcV%{vXk~Al)H-AcG+zA&kR~zY`%LNEk8~ zvJ_GQSq*sr@-XBH$g_}_Ag@8*g1iqo0cnPO4QYXN+=vbaVcgf@@AZ(OkkJq?Br)CQ zcLCg{LS{l1K<+gebe+2R*ZkZ&RFA4c1Obcd{l zJOFtZ@&x2r$V-sdAn!v?K$;<6Ls}pmH=`{;u7g|;844K<@j?n9Qz0`UEQ(eYWIyCx$cK>6AYVehg|tUH(;?j;E)D#Nr`cW!+-_jMxLS5M8vk7;&g5lA6=;z;SHNW?rx1^_Q{`!?60A-P7>ntEXe3 zG>M|RzC1PNJ=gR;42g(&*gLahog?2Qm-}Phv{-J6{ynXHY|Ps&5R;fdZTZ(^U)pDyEa!nVvxya}TiqoOvv!m7YUn8LkV^Wbtjk6#AzC}Gf=PE12 z<8;w#RwP;liiS_p#R`W&NBOWD3t-Umq-wtqHKvBz0F9du)AdK4`} zjF>gGWw>QgOd^ft4k|>o6*cl(VKLbP+FqMNJiX6b&ca^3evI&#rN z+QOis(#3yHb~SF9{C!JgZz>Y;dr=JY!QTS0Z zvux3l<(ZyE3(HCtmMInXOKh-Hzghk#EGl0(>y}Jvxv~9%O0$hMn(fY((k<5}xk~@| z<0RLt$55)Sz^rIL{*CP28=N$`!FvF;S>ND2&T9?cdj5ICdlGnr*x;>Ge_rMv>57A* z{=E&}3;bQ0J!@WOX)0p4GpVKPAXvhq-s6#q{I#=oyn5)um?hc>K7 zJMJbu=uTJTFaO5Ia3E4~z*TWoY37TllunaaDJf0887q=}vn##o8)ndd9Pa}t{E=$H zv!kJ7G4CQ5#V zl5sq;Clx6faf||I3fZDtfBBKB4Zq6=lv^fzOz_Wodw!{b`7qwIhgy>f0TP zhU#&{Vf&-rx~TtUY3pmzGh(5Wmg<7uIDpe^XdLJSEiH|xKN$a6Z)I1+yoUoVU56tF ztZw}FA4iV(`?Z+&K+J!7Ruo5}T(0on-_GXVEv~uC`0QCyGNY`7Af8(a3*V#T3N z6QVvAI)KOHvy%I*Lh6jawQ_Sb%CyRl@%*{VM7R?X?rH2M!&9_+8IxnBGTEe(!zvn! znKb+~vYQ^0%Q`A(2Tf5u9#;^rtN9AWK-c{>yt>9;g|1^-WSI_~6c>7oBQ#k;SCiIw z_ey!D#Io?RmwhH1KaPgbRW{R~)?;@jL9<2bhoebPLlZ`YCB^*5BFl%n%Am-$p(WQh z{R6s!Qe>+T&{kweA{9qmP(L}C7d@%VqQ#yzT*%?YZ-ze%~Vp9Q+bmJFwtJ=8u=#P(79Y?VxRi~Ks%RfcKj zfmm+0SYc)?D=q5X9y6gM=acXLbu6@*6SpkRT+8Rj{F|-$Wq5YXyJ_~|WEZsFCMyv1 z*yhNq$xyJHQB*JEtqjyF&M2>si?X{jN|xj>mSiptib}Gmq&DgDV3eg9e}TGMguy+s zHzVdhQdkq(f_rVpG-VUKrWG{?&S3ENZi`fGbEVfb;iv^tspe|9Q&gsOrDGV$FC>x_ z-Oo&;`-yIJWmhU_pI&{nn)=4>TZI-FIi9K-y=ksY^FJ}o8_)(~{=;TGD(fB#?X;Su z)kYS=SEORQE4}(B=x2^*UlNn4q^h{;{l5vuWP&Lpi%bh+GBu@w&&&Ega(-I*(6)Wd zZphC1-sPIDTvY{0RLzex|FTsODG=6avHN?@zO975j?EB72klo;)(Dq^ASvHSAabn59Att2Z`%slOuL4 zbfl=py9GJkUTCKJ-n2kt`!B5;s%YPsh7>oqZ)}f0P1s7qIV!YYOIwZHm5(N2}Z zWv43~68kF@IL3scZn0kvPf+8cmrZ`7@axbJu@_{asuVmz#%Xs|zW)PN+g3-ICLMwQ zIy%DNa4ggA2y{e8sNr8UA*xukht%IVJA!hI?+EJ=i`@|%ty?+*#+EhG5%yp*yFGfp zbcAPbWk>LCZ_j>!A%p!ux|*elMk7+ySfS0)N4DW#%yt2^wKVmFbJG&mi_CY7%1y6& z65hBRStEM;L~6oPlo9+BBj8C>%&r=;dg6GRiQiF2H(s`mP(tXNeP>7AL!dRJV*AGa zN`1B%Mh*`6v1Ph)%|u+3U0T$?rHT4Vk3Qu;iA%=_rfw`#hnRAQM^0oUWT9MzODgMX zMlEJag8fJ`wceD5Oj7>B_&&!8OvD#iHYmA#M9g1rI|E$<(QNZ4y1CSIv_+>SAlSLTjBV zW&ww&>YF_D7pjZhC;pD7R@X~9CNUS+)6KuZBtE@r3LAhu4@|G>h6}^$VO2mAh8afw zoq~U7H&ow>KbW?}Y6uuRa`C68Ry@{n&JHj9@k>`tHJy-~I%ThmWepPjTW71)14Eb) zxHAFhCdd{odur96hM=&Oe3*gZSlu=Sx2;vTt(DvA^y%9c$!(D`0#e3g)QCrC)UcYh zN=LS&V|(j#h-cV*kYrdrijb7%!B~4n>W462c1FfsPg@Zx73)n_fy^}P(Ic9D&Q>z! z2dMb_5lYHLD(EAcV^zRLYq;dW8~zKf=|d>RrHc_|m(Tz3z}s2!@Se03*&prAP& zM!{?a?t@0E!z5PEC@b2_Nz>+D2wb^`-reJ~WVJ{B)w*L)=k(4=E`$HSp(;sCOkcpaTYJXicH%)78|I5+b48;xO zyCLa}3?bB|Xl@r>OB`joAlB%uu;R)1B#Mjm$SP4)?kuq?me@9rTE>KqTj}p=7s_A9 zD~=Yz61lLSH9|j#*K!yHT@aCbSEv->!cLNI_W_c&&9`E*r{Z^ZC)6wspoPA zZmpKK{S1rr>TLLr)$m_SD=<3hsODZqZ=ljRh$9s+6Cf@OQdqfh0grGkjhsBld08%| zX^z^g%~7%1#f(^+$<vmi}f>_N9A-R#_2U-T1C} zF?IuSHx_Forh0$*RkREsEtr6-iB$7XWDw2J*D;h@CbMm=OlGMLlNq+CBB%NqYtaST zu4yegjX+{8Is;R-!&-C>*AuKoG-RH!j5RP2GNiJLoD$!duEH*I5_?a&xs+W|*Ny}A zH^>YoXr^j#SW~H&Mr&(H2 zDwNBVG*&2=WNFb#GGdI~$JCgMP{HzVU0vp!D?9Fw$(7Q_qdo0sl!oDM~0)!8oY=3ODgv& zV+!ma^&Z6RLMj(^auVAuQU7t+wmI9(#mw?>tZO4?Y3K-}?_>D#P-*?YKb;fGl*EjPZy+xSvjy6zPviCM(lySNE*M9!vb z`xp#;W}=e}C>EM1Ir%Pu|<3LR`2kkLwRzUg(FX7i z&?jshIAkKxPfPU&iFw!8m0$tY=e~GIE?QUfWfJpE#WaO}q~J#~_FA*uhdKZPcUc+Z zX`p?r{6y^Q5j_U7iL|&CVah}lPpHX23-yjO zi+H|-?}7lcoo^0-;uQFfiD-cD6*V`~?ng9e=u9sgTWC)o)gdEjF+Q#IcLxNMPeg#K1;!-Q6^uJ!U5PsKJYZAL2W<|3?>T zx)ozQwf#8+vThg7VN-Uq*4ogM8CZ zo?cS6=|Oo0rzp%{ffE$}Kpa=~1q^tzAnmkKByGVr)jfC)-88apVhXSw?-e~ zf{xPl7gE&te(r2{;ycKHJT7`XA#zw1r8vhG+uBB7)Ey))rL+ z<`IUT?o2(lYXbA!842W%(ejN}BT4^f@H{;FP~3iU|q7Fv#o zrDL;+4Zrw^UP7^eU`^?6Zo zG{j*za6~Lub}pxU!?{5j>c^DuF;iVw)PO{RQ%+vE4yHWkaLifE{PYe$49h6Pqd*)U z1+rrsqi81L33nv?7dZlVJ$k_9#h~GKltR4Vn-%hc!a|QUd|88IFpN7NVJB9S+MzVi z6r9HtqTTF=Z#q8jgIJ;xJJ~!l?9cq zzoUO=9D`^F$Uj7X8i47SXLy;)NSp)n*VGEy=u8ZxVLGsvok$y-%VZ6JWbh6)wBYnn z!$R-fd*8*d9??m|x|xV88<2zrGsmDVvdF3>0$szIkCA!T?2a2oaF?QUby<4ar%dGPH$vqTZ{_#crzFn%{K zdt?)yNDK%6LZCOme+{7%5*LEhAowO@Vu9Cvr|}#QViLYf`|g~iOQbo1urogBo8gwd zhq;N;u(<)}>#IYdQ7r69$feR$5@#(5Q>Ud#aO(h|LupKS@oW?I=$)Q`1B#doe8vaj zIvDzzPZ}0*q&~KeQ6HL7@|57kG1mhkgh23(fyhIdI3s4jF2Vl3rqTzhSBy@u06uP#uZ-o!1mpsV6F$%<_QU8GajAI}kWiiWqUd8Dh z=D(OO*MB`!A@bS7XH_t^>UKs#8JS*26Or&D7%kXz-tGb7#K8c*^tXrT?8%Q%UY778 zgz|WETCyk6z36wC`o~mk>P4O^s*PwWKM4C-0H4&<4yxBFGiU7{s8~lzq7Tz93*`5R zeVPo9BRHQBIA+vAZ31-g~q|wX^^& z1)Q=zA65b+pOJKe*K}WTNnv_MmPx+RwXLkQQ0{fR=THJi{Of7OtX@EDF|;O)@03FC1^m@xMG`=X4_ zLEm}|ll-ejjXsjcVmUC7dfz}GeqtbRB6QjydR`A~a&!kWCdG$-pUIdM$L3jr(LOFm z^_bC&Z*&8pSzU0JbnX9&#{F0`=-+IZJqf#MqmDrOqo@bZVNpQ~f_OzE@eR~xO^H{3 zUT=}b{Ixz$7CZfXpsF*F-v!43vt!t&f_iIqj`-$B6i-^Mi$_dh;(pl3^=;`USn`8^_1pZ zY6`v1n807&lEJJHdOEh}0EzAxhBH`O=F)Z-K$Ubu#{gXG9KnA0>W#;e z2*07Wi~MMO?)!D}Ft(Mt>J0oR@lRx5m{Cp#L~8~CUB1lx1PR%d@XrC7(^mim$PV!{ zFP0I^m62Cx;sV&A@$(q_c@k8hQXYVH9NEJuX70K6t&cJjgmmW#w+axcJ4 zLz}NL(F&joqQU}j!+L{6K@VchGHE$Jjx+RbV0~9ka441Vw~Nq~dd9jNj50c8zFSyT zydzSN(&45~MhnpBgz!kn`J<;He*gkY5Y#Eu1^lKhMRbVCuA>E*ME9W{5X`k`p9wI1 zTZoD=Vl==6xXUy45+`-Q;LrdFHRL4P({CTWSiS%Ci`7bt_2PVKv0B&^5a)zm04* z^q5JpVaO-luN$I37v>cH5BqKv@qz>MNDP?|uyE|Bvp3}Xi zF+xD}MI_ost6jvHl%&5D4-zGk&^j|7=pOn>TT+sF?un1-NC7hmi+>2hIvIp@G6?JB z5LU4sk0YUrMEk^O^Hi^9oELe~v3N6U+&6LNsXke7(j7EUy`U|9umA1x<^H2hOK-y&u;k>$8M{s{0>;33%wLURp~ZafkS zv$|BXLpBZxjnwgo_K}lrZzN5vPn@c52?J5^t#5{qGJ>WXorHJc&VZ9Kh+1?lB02bX z63Jm2xE}3uB6(K`?*@S#Loo0$BIz7q$4Nmvkd-P16$oOX=Rwi##h0cTJ&QG$ffWQ`T@eb>Pfwvb_hC@hUD@JbS4?IhNo z6Z~haWIud^2k?lD1ma%AVGuhBw64c^g+3dG#(D*vJ`uJS7JCT~a9aPfr?M6W0Gl~j@*(lSU}AM{rZ z3cke+&OtDW#9U%9BIr#0Jlyr^)OB|w4oC!#f!hEH`?t~V7YX}=f%v^x&8P-Q9CeN% zj6E5oAGHxHCzBtymoS6Nzem^`c%5BT=Q^=YFvuZk^f+fYb~5kfGeFuNHl5jKDYG)* z20HPepLdGCYOde~ZJY}!DG*)f7-5HzT#Z^V3b0EDcfa@Z_X3so>%Eahek!$Jdo(3Tp*MC%)ogVCG1~M8t>9?ad29F@6 z_Wv5oXm<9(7|_^{)vdl&BHLf0?Qs1#yFpeER)2zj8{W|_EQ)6B?o9CCi{EIOSwlc~ z+r$pR8qx+2De5w_hH%}V`{h8ncx5e$30~~kw&JhQFK1&eq`DWeT}K)=5lIr@VN7Wy zc^$%aeJvFP(6-{2hyXHN=PKduG&fW$A^4J<4W+Lgbw_lrCEU3dc$-n@ppT({nDr{02xpT)jP(v6>2yo$1NMcle3_I6s6FDzKP*vx z4+A)mEl8t1W~P)@)U3#sK#`m4GH-;Qw0VT%)3bB~!xcokUXo=BaP9b<@_V$L7&*r@`q0(m3lUv_vR z8bUy~*tu#F3|Jpz@#Z%l30bzf`y2Wu)1-{2BTs=N>SR!5W&`W)_aIXse*k?&0ihpf zvwPm|A$9=}%|@E)Wj&uqhnfwnLiPQEhv0c8>#sW8lg;nu1;U$>=9*fL7!%Ym+1hL=XTRcf+j2 ztO6pQ(asrY7knqWBbTH;D-KdD8U964pglQ46!4$mdTE5MVk+oazl{-JdIv^mbaulf z^h)tqq(I0XX+lVWnTfV-t~4PqIpZoO1jQ#nw42a1E*(?sNKS1crDLv@4u$Liw9h)e zJz$i)OS!;M9ld5phbMi^{D>gC`<(YS%xUC0;22LdI|U^Y(|d53v~SVKWtD!w zM?{tOO8MEDcn$eELh5=Qw{b+wZFjw)mdsp8B^vOL{!o|rH(~%K!}L!F(5Q#UrV8_ zU*_(>cN5%;h5%qqHxYo*s3jQ~7{tuzqqWAosn|*)wXp}xp*uHt0Ocqr$%`P;A-w3l zCSG)n#fz@-@q!F^nCfv&YhLPh6zewj2Kx#aUJxcn;sq=$|GioxxvPzgXESL6jQkjwTJdEv4ikLIvLy8rz#kUdJz3`2Hv z_b5G6+ScQnp`yN-RtQ%h@x=ev2?9Xy{r8rEp#{!~9anQsY+}xdoq&TDkvWHSR9Y1X zr%Y@-<7lH_6eZxaqlL@PBqK68a=aKA2@uoCX%y;U-)HdJ0FeV$g^t_SI@(1i7QArE z#yE3AWXd95K~pOe&)2P<$^15DA>ViM+hqFj)q)XpvJ($MX`jq31D^|Tk?}LUI2ggR zQ4DH^jErFAZ17(Yk26cECAg=fr_PyJn|WRTb&vy2r(cHxV9ZG*{Uwt?6m7kPUOxg+ z`#8BSkZ&V<&V!@`9LG_t&T+gpeIh6Ui#Y(0O2+YiPz4BLFkDXiF&X4==)W#=qW|P% z{|6vCJw<_KIMmAKALkb!;*yvE-QC(eIyp_J)*$^@}XRCv+O ztRk+-a1FR9kU6Wt*_;D9%v3&N3T;>mF+YBZ%GuBLYw8<>iecz!@h0i8@yMY}- zk}-&4JU#!{+xcC7$s7EvzGE$|6+u!gzQhjJ?pyuHV zyqg2r$$cL{k`i~@c+`rjYf%>R^^z#dB`}$6v^t8i;HZYA|4k2evmB%#XkgbQ!ZX&* zUyO)>U8<0KKP>lSypBgj#2{Lp3)j#}m!s6{+4gnFKPTlqS0m*ujFgi(BuvW1O$A0g z#84rehIe4iu0_A$`ql?OqATfk$KOe}56Q-v-D}eAZbrA?z&OUs778N6vptJ!p%^Ib zVd8i^fMY-TjrER3oQq+^aVv5Xam2IZL>%4tJvy9BmqZ*%vSya0Zi z_RDB+G=ms#hHl*n3~U7p0zW~Q7MvQ>DTZHi4ID=Do0+Au1sO=lB;!gXJ!PWH7YM}= z8WhgA&f+^*;wXy(>DVg@7Yf-eA`B+I?;^Sx5vzr4=2$?QPMj;If#$>_c1|lJaGZ#> z6A^3gbAgCmftU`NbOw!|$3Y($$0tEeCZ5MBnnI8hAsi6m!LAnK$kT(1Sr$pK;E35X zDm0B4x(2a$LWs%f=@r;HMnWU}{F?rGsn;^{i)MW+U)ZbH-WEk>wSZ`OH0z3Xy?c7Q76%E(MNLh-uyIoix49OTjDv?lavGBjC$q}26Gg& zyo49qPM{CMI~Ul=BJyz(ZSCS$+UV{fcb3GR*gGPv7a~;HJU)z{BBMD3z!7OM?E3sL z+K@z)Zvf1}oN*?WJoqqp#Gg_#iw4fZ(hfgu{7Uu^XY%PND83Oa>5)J1X-p$-Hwe&R zdsWOf52f^jSV&=Eoi03c)U_bpB*JE2Ttseqm)eAVo&3j=BKCX zqKjmZh925IB8zr!B$y3^I4L7pp`8ylu+wE^eI-lm zU>JJJLvFRo73jh>%V)VtAMm=bSzgpV zotrjF@(Q^?%HisN7fO>QW~olI)qNNLBj;WLaChfk0o*nN-8Ec(xo^uxmq(uKE2V=0 za=c*Szr=l>6p*0X1(JUur@_0F4u>Sh04W_w)3JA-ADrzN*m+8TgyQd@W1Rjj0gR0p@7 z%QHH~{>4%MM&*yk%7EW|@iyiFvP*2yZ6~P`=xgACn2vBsZeke^-isld$Bo`)ZI+;J5gmHM!1)5cI|uQj$5WV~u8aR`%la%`sY zdPkY>V0~;LyZDXVBZ?Nno<;GN)hekw48>I zwy3=LtKtM-BGC38cXb?)`5-<-5`be~2CSvYhrOdX|F+nCFXdbAZlrwe;e2$Ub{csg z-oOs!k`o{)TNG-eM~2q=R-jE-66-UugTakWRMGuz&Go1#8y{kW`CU6t97aiYKo-8C zT|1kO;O8L}XH9Q#ucZ=OLnTPB?c%Da3^V}4f^gF%g=vZgrMk)8hTOrMVi?0khvra+ zxPNb#|CKmYEg;hnWg3bemFatU6&%1b5*PiaG{7tpt7+~?NQ5JzERku2QWr>m7rU_Y zR1zC=mvJwB@y>K7O+pL%MzzpyLhr?B4`<<5*A>`Xjm&gv5swq`H8EBoBGK0AK_lz3)G4kh;Ph8rdMbQCby!NAtA^kiz*%bcJvVr60zW$3 z!;TK)P*A3HBAPZP?$xlP!;nHvsN6=mALuEr2q2PdxB#1Rqx=36%9$lvQ>E zvZmrgLgufc3U8v+XsSSUouj(;Q(cV_bzOrnP@#XPLd{gDD^w_gHbfw11a0umbf-)K zVtsk(OS0;Uv>_5HFMK&ZQa(5gq|BqTCqre?gKHt>VPu5BAQG#ugOt|jYa!(+oGHP1 z{&A7=>*3=+0-pzj`Uesj3!-J53XcVnuy_%J8GK!xed4B4>K+N0_zJ!v3~;y zWKQrUP+Izx%jDSW5D$@lWw4xoi{rm^I2lT;PNJ>|tsSDSUV#Og7)w@#yJ&-Bh(yp> z;po&D;RI3}(s`s_Bq267HVP>kiT=e%8)jc`egCoOEm5{56$sQ#Uy7jSRLF}cayLjB zCsVSkk*Q9IE##mEBRk}Xma%(sBZPP%2yzlwWMduOCA6komAO)mAz;g7D8@(*vNgHiO1t+{tFvnyiFB~7SvjiQ%u=C=|Pasz% zx?>TyHR!k~(k*7$X8TkV`d~1|@#Jo@nZjy{VUqAfwuqcK$S;SXQ^4HC@<#VRgr=}( zqF{R;-L=aUw1JbET>ZhL*ydr{KfLL>>$BIIbJkWuIl=BuTYb*jK=xWjwy{0Y9UxHx zg&^3qVh%UuS6r65D8bp z(DnlM-{e#&y7p6DjS+RVkJgdeBXlGx^f?u3rb1nz zLL>^cb2W+6rw*t|?e)79)NE!luCkzrMW9c>NTH98?*eHVEA1iMGO^NLvM{pXBsoF% zi7;_m1l@@3e;cffHYq4-+!L(g^yIl;hJFRoliew}GdlR)zeG~4eowFt53*4^_lV#c zRtNKeY0nA1fLNI5eSW*2>0hDVQ)ft5^1lHp)E=m#@1Y)IBh^o$o7mw%PO>|Xnog9O zj!>OEV<`)ak6~5n;~^%siF0=~sjV}D*?(vFS~Mjdhg80rrd$g*!}`=eiu^|Q0|LC2 z;B;;U?$U8*;p3V}vWl{#&u`*W%;Q4y<@sB0%T&vIjlk^qwmbUOaAHvqF zux3eCCh^?b*nEZJ133&?g}6g1B)BQAMq9r^zbqmkSTq|zuofTJgqLE8Ts9YP@%7*U)Cab@cV?Gx5<*P zE#Am)=V3*dopw|`BI*>C_$tUii-U69VjI?G7F`V~+L<=fA=EkIYZ1m1hi~vNq`pwF z33toQfU|CVh`>o9v?8pc*!MUQvWgN!zfOgMR4DeAP$7u8SBVXd{c>i&%#Y(dl^aew za45Nlt0By57XgLHaEUuv;Pnrd4&U{5K-dI&XvD=hHSeI`c(JqZD89g~OI*4uR)lPG>u3*=Tdx?|uPETi7^5x%uU?CH5nf0e zMc2xgf{a()ds!mwy^PH?-rfsk=6f#;2lB$mS^df zf(KkHu~}Sgrn%J2{*J6$`X#2 zV-?vJ>#bC%iwX^e3xR{}+JGEa!BpRJcwU4&e9}m36(bI2+=dlj@(}|I+Gr(ZAFurp zVWANWEe}=uDJ(Ps2GV!*%D+t^cyV%6j4hb$c2i9weXJ&8XmNfPGMeHhBbR?W!c@1wr$N*Rt3Ma-`j_4~R z2DHQ3y$Q@k0RBgB<3>et9uOnF!P6j_c^b%fo}w)9F_63q2AMMrcJPNDUAP0bm0@%K zV8vY4n|SDy{6Ys7pn?MCk@ME&8Qp*^DJEaCc<^>S_;}b;>~$@S+@Bs_-;whDPwpE@ zefTO_NXqyBdSCil^9KsM!h?>17%`f6FU_kYGr?Ph1w@0-jFma7$g>L`fLz2LE{Bi= z>Pp`wGfMXOQq9g*y32uCQd$8a*j;YIK4{k{GYW0^7P;l$1cF%baaCNRe8uie%2yc9 zC(8OA%#aBerz3RL58JgabGK98U^uVi$WBIz#Z6@A5l)K94$3x>J?fV5C?j7O0j-H6xAsHdc))6x8wlZ^YEqr1m(+OkxqUi)%--tzBcer;+Y4gus#>=kJM@u9^ck?u4Nh_G0OhIS3SOh&UL+rdo(%`OTauKv-&F zrV60eahO>f@!)8-yB3`d-qA}WJ&9d51GmXegu^BX5Rb6*_0Sa~Qa!Lu-wx;C+X=g| zLkxGqqulie=Ok%lEZ{jAVlXn=MxM%|33+kPXIx#*)anbDfbq52Q;`!9(}lho%86M& zNjxXeK=J2!6nb(tPLJJj`=dA1^QZZZ=BXa|`gbDWxY)a?v^$^9YG{_UorIc`cpKp} zpRl`;9^fK0T%(Xs^CSEq-gP9>!qpT-0_hR|sS@y}Ah9!gUvhcI2Kr7BWyojeD5w)n z+mT4t+3DYwBvipY8moh7V6A<}V6GM$C;tS)mF77aZl#{v?@=WpvrlH(yWpD8ELN4U`!1{j zhN%XRXhi%T=ke+A>^rja6k8j1?HIp5nBO+V@0#LQl)zDZhwf1szmbaHRA!E@oQqL$ z$zlP#$9Jwq^|Kwv1Gol^fQIo60&@vY$OA(O@bjM}Pp(c#-3&$>oQ*Ve9#9h&{9d*` z0R1GmP4{oc@?-~pz|Oqj5H}7>(~JZOGE!o(yMfzC=w`glQ6%)x?RcXr>tU50t@m}; zR~;UE-VzB%ZGRVQ8Xg* z+@ly1yV;D)ui3%vi1`Evq;BGNfcYe2(4Dii25^;3A!&-k;EuS%VcHna;hvB#WtB!5*kq8VOCnQ^6{V-MXY=-f*J9^Co(l@<+- z0|4;7ShzieG1pY%RU1##js-aj=j@apmFp-YCa5$3mgY# zqa{amz**B*LX()kpGEMiJ(D2=MJ3?f&%z$oQomxc<8u&krEquvqhH{xo}FKV=L^tZ z-@)0wy$jlApAXf*;`%uc#58PW^&Xtg;-A+$_QW`<>wSBt`)c?dM7XFN83OD&q`*sA zl(~VPm>cN(4*R21aN#ojW_J};0(Dsp&b`x}HN5{~lg?TS=Xb_YP5nOOsG&doW_}?^ zy<SksDFb297 zl^ZFfEyjf1H=sJ|0KYbQXBDH@zWX^r0$-%v*5Ip;hmaSCZRo)4uTQfl{de&!^^VpE zS>D+*t}Opsoa^Y@hY96!1$I=KO|L!FS1<=I27q_tdSa{sI5TJ|&RgOzB!vb!J{`mh zh7Us^+Y)i#l@Iq)AU7fmwAH7lR=3N@I+B*k+sO{T`g?9KY#sMLiF9;}f-+!KdVIyE zM(Y)(1Zks`^l~P5ithgiBg-xt=4aOBr1XcyP?9$BZ)_PjS91~7EgvPdQueWV^UAyh zC1T|%tl_*ex@Q25+#&i@hl4ARU@2R;ev%BxCU0XIpj z=`aP0w_1I1~*3qV~eS zIP|+UROvcaDe!iPQ4qwo9EbrCfjdk858%*Zb|iZz1n)tnP;@9%HIVDxK!tB*g|T-p zmq1@m_&kU#ZAJ^AExYX%058Z<8d^ET~-4|K`e{KUhZO- zE%kC|9(MaR{E{eYQXn6K+95JdlZGnYa1O~ICVQN_{vb-aM*Rrg4@Y21G(;aJ&2VT5#X58dO*OD5Jy)?EhKeM=(|Z&ETwR6x8t&H)P?ni z*AGbC0a1e`rL~bMt$zaV$I!?#XexKYLO@MuQd6rxxCAy=y9`QeBU4&mMNZtEcG-6m z?)|*vL-;wka5$(_5PT_|Tk!E;n~cWrF|z`H@O!)n)G;eCb{e)a{gze|3Rh!aODxlGsnrq)J7b$5hH(HY*FoN~ z6lCH0EqbAm^xMP8L}mjF2fieCVRq}%XJLIQ4+N|+3M-%VOtcG3CH*!cJIQ0?X1|GL zCl7xSgs|*)(5?tt*?E#Y`B8ER+F#_FicSuT8tpWU3xToNZxqi_Y}V*_wBfzKX>sliP*j?x{4muCzzb(zL4zAvN)xW1D@ z>9vPebT-hG1j>UXP#z+Ive}%Ol<*jxw*{3Y00lJFrvX#;1RQ$-F=TT%NH&K<)6YVg z2{>yRaAJy?NoY6wbk>rc!3dKOe+uO!x^jMlvxXoU@U|a|3;E%ZpI-`{eU91dxCEg?V124Y>-&0{JlGrbm;7$*|Dec zn;6~#=N^o2cK%+9>$MlT_poUR^`tRKN-B^H<6sIayPp;2J+rfxkApppHalu6VdKZ7 z;DlaHeOlsdC{GA`REz3rFt8?6OPKZ?P>%o1c^sZtJ8uWd@d)7?9GT zf6?F+SPH3f1Efiz1bshrPpV|%7ay27R@uq>4U9^(;j$T2?>kKhinC*I~NVB@$B zvUc>9jvxbsHTVh@uyK49@PCi|&Rx;V#}_jFt=yxj3qa5^R-*g^+2({ah*!z@xTZw; zA!SXWtQp~~qO=DWYc7fP(Af^U_7aj9JjBVZy4Qb_bhT~(@Gzs%J!ckyC6YcW#-|#A z5G)=ETa1b%k7%6)OkEMq&+os**Op%wId%te6OOB3LA%CX(En}gS$(zj?1jb<+Si|o zxpa4=V_639am^J>q^!e~HF2?&RRjp2gSbZ$3&xBK=0FIZV>iZh^}%-^G!8@%hb4O? zUtmPhB)3}}Mk4W%5&MIIa-OpWuixrf$eL}bh7|sgo^9M z!n>$2JWsCT1wM9V$_NNmm5HXMZ=mnV-Z7kw8H3jDw6}4j9^Osm8 zgK)g-gqj*QVwrfEwWvH`*ZE8uW)@hImPmg>ksw6mp;)%Qn{Z+X4GiT52Un4UjTi@p z1xqIz$q=YHy+AysIwo7B$wKvna@Q}C1=8cd^Q7XT5Hb*pPWD`HOpmREX-=#gBpc5{ zKLhEp;p{9B6iHjMK#nXx_nU~JryysLSS1E}3Ka%h3S=jdZvOzx`=04Kf| zPvV$^Zs9@X3EDArcCa`{t;k7nj_|CV;v5~v?`y<45~HY!f<_z!=iq-XAuwjUP*n-; zy-T2_zImFo)L3j&A#g7uz%2uT7NdUJrvyN zLZ7(ZSI%ROKU`c=BFD8Ah3uw^!dtmLH8MXP&|jH;r)}l>CAkjA`t+<7i|<(}+E>YA zcx?SE`8f@`4B#t@GR#jV%oh=T3?PS~IwjX#or%fM!R=e{2V~i}W-H@n2T4)!59YPFRbeIty`B zT{Jm+;lURgMJh@UhLQW?F;)Y`yWg=fL?C!9JGxv&q!<*-E}{*(;Q)MzKO#V9XE$c~ zhoc^4ag_RRWSPTnu&E#hSPI3_PpE_9jW-EIfT?RJoyMh5{fqTB7Dw*U_%m)j9ikw(G?Vfv$3lY-sI}9YXGyOU0?Ji(vrl^sfwO`)_7aIOr zU+Eu8Zkx#W|Jtt1C<*u6BgdWl-5psZ$>Ad`$z9b$lS*uG4^xRmXQ%`%21D&kA|PYP z3|)wM=ilLbi9^Zkpf3^SYt3JHn__%_H))>#C;i=|K77@FhLrEW!{1G6OY(OMIVl6w zuQlH($~)vcx6Ft00P4pJfd{+S3M8Rc;( zx6NPG#y1VVOLa9hv~L6xh_+m84ul-Zu4e`$9_Z&WupyuNw^`&C=A7yY{+B{ z7wH;#1a&a;(+eobjP;UQ!rcBSbSr|O1$W{0i~z1G!BrtU%yfF0g#yRs#O(s6io4xO zq!OZe_QvEK==vFn6)>>cxH!cH>j4Kl}vJY9KpR z66Tm+LK;m}*v#sk9{hGQvsCqRy3Q?C(!rjD-O&3%ncJi&7ICA7kgyvzJX8lYZiD}$ zxfFuZ*YnEt^sK7&vmZBYKwK|g09>8+o!+Neuclc)7@qZTahO({p+-?LSm4g2$&nqc zH=l;)+k}p=*td9dIxS`qi*yJxB+gwo*JZ|3zfp~hwaa3pe3*six}2EmvvOpp&5j|U zz62b z%y(C>#9|)8$5rVH<-5~;l=8KQ@=59x(G~>I;HCh6>X+MrXRrtdh|7Hi8g?=?Y{b%_ zM^XHsj%+j9PX)TdVu0p|8qvNIiCjEH)DvW|!il1OtYv#W+=trhSqnQ)(F%FWxeVDC6EDCZR)yB)u}ue{xn)z5T>L^@_SMJ(;S;Jj zEk%Q~1uDx3Z1@N&$`Bj`g`(b(iyCca@1Q7u(W(}93s=Oc5n{md3{NqR{j-yK>|h>R zAicG)!dsSCyv4<@nG2s+l{2Mw<+cj1Yl~P`zHyt}S>W}`@AdI~iiJu=0qS84o??+K z!|h#4ja;QrsO3t9NuxKZ)Twg1dwxY}$+lGaVz-OpxuwdN=VfHvW4-;ht#Ubn4pcxQ zu!@HR*9uE8|0P(HmBKcx3a!o-VXfd0w&J@At?~BcOUo7`Mx57`;i@d&6z=|7ApzBorQ(YUV$=iopj z*@->?K-aPB@cCYpfKM1{@CnL~&mQ)9fqnLpXDwY++Jz-Pf?6b2dxJZZ+I;sV)~0&{ z{WvTBsKpPr08ZxKOOJoS9>=@8@uPw5E>@$W284iQ$Qjpw4M=wu@Qq+giblfX9aPP5 z3#(DXL%d=jf8Wb6lheIoWc?g^g<{^qB33o@*-zmK^&=K&P7F6U5O^Yk)j1g0nMq&R z^D|LP?#?iAvT`OpmResPS3Ejm-(gI>w#PBylBMQ3)>gGJ;<$~Z&OnO*ci z;IVcl5WnH)D$hjS^&4ux6N|k3EovXf3F7Q;Q~Nmf5Z`wW-&hrAcD10?HzCciHqTVI z;^&2T@R|e6&NlJ2l)YVi&$3S-&ct&Dc9JB*bBUlq4+3>8O9ZRj07A#dS6|zM964^X zhi%RmS(V80F5nGt?jYvq%FOO^2uP#ztMDW;KM{6T{o5ai4J3^&u2&(vh-}HXv0Z?Lyjv^gL24Qa92tQet7WFb^pmX&urIr2RnK2kc;YNS%6JxI?ZokDsKX$VPHjCzq4A+1K* zj&u;I5$P0C7t+T_!$|R)qlGz0sYr{EvXR_KHAsh$nvgn>-beZrX(Het1xbgLi{wE% zgs~q*qJQV2?r~+g3MyTTaj>m;Q$b0t>jAK5;Z7lA;{(~A;!=o0&k9Q_a=j%>3M#ye zqh}$$;*v5Cb3+7I82>Fv0fH%NY1!Q_?_!_FgGjg8p0Z7@iVERpXcK~o%QL3Um>9H@ zR#D;dc!lk;>s?znxyrrk-3Sj*;_|2k;h%U*i_6NlvDy!We~W$bKsL#R9loH#mFub~ z^LaM8(9t|MB!|K*9NZIxV`w|vBmM@Q5#`c0J>aI%?gEdC7dp?|!E97Q0HM(f z!jHqF=3yjP;@n?}OZd^)=V>J+f^c}8r|H}7acvWp@)^o2E6;LOx=LWa5`-0awzL8f zZ#{^zP*%EfTj?gZr>wNh2cgwOJ>>xyT-jx1CHEG4-FXEM2e$8_%FY|0ED1r0& za&LvVz)QW`f|_#+aBuNS{$MLcveM7DrBur##5{u$*C(gQtg0_Llp%|;9WXZ@9yn7=#9 zN3*n4dQB~`MNUI0zK=7y#2~2AD*%o5~6?!$8glaMoCytBe9~fgr~(%r|ZV z^KQeHb(lK#Sok58$BXo0FIH(j;dVN3;=$}PLU0$o4UZq0oCW2=Ow=V_dnb5e*B6wO zZ1I%{?b6yKZuPdv86YSXel~V4vkDMm1o7B~1k@I8g2f4-MufAG^@TIA+HL{#aG@WA zbroz0FFit`;~ifc36^@VT$NDk&+~TxpXIKtUgmi?u*4K@-#QOSN_m+7cTnbf6c!}4(v|@R| z7Fy14ifka^s@i!S|F7}S1h!+%>-dkK!xESbCA+*t|h8605MU>9U{ZRH2iWFf^&f4@8>N?@(FsLhRAcE{L{lZrMVLxVz5|3-SScVm zUn1cPA%Y)dxHfrQTWIM7mDnz^n&(i0y6F+i#N%DM4T?BlDI z=5Y~nRyZE=6@WY1&>E*K%f}(b_R!mLUJBnt?|Ipk+qP^hD=FTTRa^>bp-`f*V<37z zJ!cGo#I6cl-nFWr1f)a|E-_pvr(j`XnY=QQ=cpXx&Bq$dEE@nvEjo)P%nr3D(dHMZ$HeWH6uU|aEAp5LO8B|-l>g@M zgd?$-htf@3%7t&E9;|O9(g-(F-DFl8_4Huu7S|TK08Ow`olA;K3mI5*es?{aF9LJ^ zJ0PxmVWC9kIVboXf6h^L^ef>6e@Fb>S3c%l3Hl_$=c@9JD`f0RD2Ra@6xX z0Jm#go-)pxlkh9s<094$cFP6X8^h0lg8Z2VYa!OgWmCvl9$fh*NjicMjZy>_JpXO@ zh1p}&*9{VUw+GayqyS?6HsMJ=nn)_m3Z-!}EhM6>)NqJU3#Hz&iU&QVB@10!AxUQl zk&^UM&qKhS%(Se9g(UD^<6jhQ9SKQ-P(3c)NXpDHi76kFe~&q3H{(bFT``|c_e&D^?toIBb=f&8eQMmm5N*^-oKS>MmM2XG`h(C zWw8FQ!gEh()M0E8AWOy~2cNxC%vlK=V;JVHk8Pw3qy8Phub*j-X?iqC+HYuY)0S#0 zwA-}LYk#4AMSE7;rTtu+rCYCa>q>S1q&uX0PWQ2HpMIht*)YjC&$!$8s_|yiVpFc^ zTc$Mg5_6Wh#Qc!?VYA=-Lvxe4)%>=(%Y4BcG!L66TV_~(Wce4%af@J`WSwcvwtm<8 zJ8P=VVoS5#ZChb`)^^19g6+8NgssJP+D3$mV#<{(w<>oiYn6MI`;~{3N0djEP0AK! ztFlAcrR-J)m4nJ5rJ#ya#jBE3a@AawLbXVhty-;Gt8%Nhs%ljSR7X@zsy0=ZDySM( z#i^6jbJZzogE~{aTJ2VstG()Kb**}j`iQB?)Mn~31x>@IICGLY#cVKVnpd0M=B?&h z^8xb_jHU(SX*0K*JItLJRkyjv+>4P7m

67~hClu*6#8Eb$hZCDD>(Nw&x>b1f;B zRExr*u^22C%OXpLCDW2+$+qNKR$JCuHdqQRZcB-!+~T!twd}A|TWTz|mOYlemi?9k zmV=f49azSXtpD4vQ6!R1&#bU)q#Xl>4r|eOFsFbN@sAj9? zW8QQsi|RgAK=mtioBB=lu=-1NjAoi9NprJiu4b|3pEOQguC7MctUIYYqnoC`QU48n zs$Qix=xzEe{r&oKL#3hC@VH^W;c3IK3~h$r7!H|!Y)lqTb){9XPq6FlWp=N9yZzVpv-S@A@9lrI585x$ z7(mpU@h3r1pnO2NU0JQHR~}cMQ2tu^iF!yqN3%w=UgOd`F$Y3+;JKWZ1~Y`VL3PFxlK=)o;Dpa-G}vh+;ZCTZtgG1>jc{zJ4hDeGP#O2#UZ7j zoua)9^XS($Y3Jz|=s(l1H541R8S;#WO!bzZSpHz?vmCTGS^wR7!TO1H#1>`0&aSlU z>=yg|b{AIkh`rDLnH|P2p$YR4qmTg-jf#AQOYsB6ONz6K-zzRDzM-6?Nzi0zay0j9 zyqayAM>UUYUe%n^v|&AmG#52fvdd-Dx*Xjm-4@;VbkFDx z>psyf)@SOM>o@4@^au54^pgzt8=f_sG~8(1XuQv~!Bk{=%v6uneAd)zss=0`H@{+j z-TZrC@ki!M<`uxZf3m!8`4wj5-z;xgzHdEez0S7OmTdzu1|1cIE>*XxN7V~TQlkxM zN3>D8>vZ4LrRr3=G~G7cBfyU1x>t0s>;9k%f<~$tZfw<8>HYd2>5u4N(62N6+VGiS zkX^?7x-+M*fOOwyXPFKDB6 z59$26Cv`v39n~Gv{fF*8!v@2T3`Yzv7~V9zWB4tgKH3;(R2lU~tFgdXWGpf6G5yl? zGf=YUEmrGVYl-!J>%+G168`OF{|g@F!^&R(YF`7~{z2KNyg@Y$ls8>Z98ncY_HqUpF()cw0pXU3TpJ-muoYVAc z(zH(P8g03@3Xr{5`;_)DqY~9sH4^`qIGZ8Tu*78`SoJJGK_#$OnljIUuzA)WsR)LTC z&F_L+T`+%X&bK^ZdBXCs zCiL?gip`4GFt>e*j}=3}(JZA$`6uOo@>8W!wNR}F2lc7Ht$srNx%w_(ZL{W1txmf_ zn}=E5rro9ex$a$EuTHMtt3Rw?Y{)b$2mHAV4}x-h&+x9{FNWjBQ^rZAWRnA&qT6)A zbjdW&tN|2kF&_fA{hj%*<_zmn>k4b7_1o5+*1guJtOu>nTK~g3X#Enn5@(ayHi6rf z+Ml#PZ9imx(f*SCm-dtPFR1?=f^ZQ1pA1?vQ*pB*Px&q7dgWu_8c#rucn)&JG3CDj zhWjBwe6GBtj8acj$E$T}vpP+ktzM;GtKO*gs2@@PN#ul+HM4ZL=<;;mf+Vy*who1jYHG{wMlY{TuqX^bSLo;fJ=5ZPV;C?X&DR+vnKl+2?~3 zs6Z3ZsUC#$!=Fsx%wE-#s()7fQq`h5t@?M>b?C!1wFP~+Tm2yBwo?5|b&LA6I!<$g zX1YeLF=%X>pJ^s&AAwxK`djNf+cMj7Tdr-D zZH;XmFy}tIFv#cQVNhI;Ql`n!73gN^&H5h09}WG6IO7e*>EM55MuW*}DmImxyr7d$ znGTv7K`U=Gf5U9BSS^de0bP~{Ep?XrtaVt2=d90LU$7ptzHB`K+I7l$+IrUdCaC6l z>wBOZ7pxyzKeB#q{hM{Etr+mN)Amc-Z5aQHz=+e}?dR=1;O_s4)gsBCye?xElN2{9 zk`*c7lV-&eidO-5=M`#$(QuF9+mI^G8qOPnhA87rMmZ$URO1@ZtOtx+j5~~V#wU#b zWch9Ofpj{n;pB!W!h?b6nI*1`l;y{B)!*6y}*u3rdabN&>f{& zZ?>8@nJdjzz?FdcUm%~nY;Feh#apIZZnE5BS!P*jDYkeZojn2W@EglJmd`Dh!7*>P zYOGf4Dp1Oe)?L;BB-$sfE!H#E-&o(V4qGpSlTNl-Z5ddNY@6R!XWMIg%Jzn>0}?{F zEzX``pJAVE&#>QP&#~WY-vMe7uzwdYOcbMyq#oMC2Ao{SsV7~dLOp{>-m74&%zMtR8gJY@OTY;Cr480&|ShA!G-?NjVY zz=c#m!6N%Id!BtAu-Ai;KW5(x3_fgs!QOxI$Ua1KP#q;$U9@=H=$2lPz|U)R|)D#>O}R;&?!{F+a;hKYt)76QuS8#E@%}`sSl~2S07iu z2ATRCIP-_N%QJjZU*jvrLnxS*LMpJenPv$25C2Piqb{Iq;OGU2`5f z*+-CmE@|Sl(;&~zgA8QSW@wjdS8F$FOSF}chw32PJ_DX`OxvtIt?kghr|s2#tQ`jL zkJruA$#wH}8pynvklxqoige|=?T}L**B#J33z^_$U5oClu2c6uB$iKgBf5!tnSPdj zu6`k8mvnHxRgk4N>%EXNYxVm;;hxhs>Q8{iy{YfgU(gTeKi3O}Nrptj&4v_%%3v`p zF=QLo7zz!ghOLHOkgcBr96fJ1Zg>qE!8t>>;X}iq;i4hdIK`L*SvA$DGcGbNgEX)X zGLZ*({1~L~r;Ue=FMx}kGPWDf8+(i&8HbFQjB%!E;1lyq3X{o{VOkEkcB84pRB5U< z)tUC2o`HOO3>@#Ysl)UhaQkCuana^@^GvfG_^mP9pv&c&*P4r-8m_pJFS zu)M{57TVnV(BnRZ1~(D9+bn2p3!$&2LsMG?inkfs*(1RGebC6BgUoyaTG*S=zb;q? zKm|ybO#~fCv8o`$ErC|M##(4CwQdDH*aLob2sH9IsAC)GVmBz_p!K3P);7hKWSe74 zwdrh&KpXNvqun+SWShr8A)dA!h92BxJ7sGJo#=sHH)Oj6YB9~83@)Oun?Ny^+gIB+ z+Dq(};MR5a{q|=dVILFe>U;KH`^WZSCbMzeiB`me2g()m6&i(2k*Ua4tOYG8S8P|* zC>~cFP&}(Rs(4w^0y(@>@xCIc_*5~Xn5dK~XDR0@7b*?PbWoU8$_>iRO0V(}=;Hg7 z2f;xbAz`&D--I510rJ4-pfi&|VQyBXs8rA-mp}_&qbgLDLJQxe+M{|(bx8HR>bUAP z=;G%fM}MdqR9#fXs;59BpQBC%=Ut>;rp{BZgI4ZQ?@&Lc-m89EeOUd1x=DRX-4407 zNBt2ry-VPQ(=^GNc^ZYrq{+}M*R0lT)Rbr{HPxCr&3?@@nj^4eG;2<4IyCQTdNm(I zeu~z{YiDZZ+WA_I)~3ybB(+vs1gUSkwnqE7_5dWRquQ6XE#Rr0+V{0V?Wd6KC+cLn zS-QEpg*t;SU6-X>1?_9I&I>8OR<}=g5LS>z-3eVQWPmQ+1>Jz|bDf}{q)*h}tWSYf zY=PXEtzV-r)R*eF>UZh)=%3Ob(m$_1u76G6ra!0e)_6mObol7p6OOg2*{Y&C143zeI;n`%st zn+`x9I%;~^)M7eo>NLF%3&^LY5z|Do40`)q^Fqjv>9FdoGH-wm?=?RHYsfzHLGyFq zktbjed6U_92F#yBXP5-L$IY;Ks9@_@0xQQF*f&aH+1Le}##69nJP$j@Yp`IPgYDu& z%b?|=CDu9x`u`m0KRW9o>oQ2B>#T08$GQVD>0ay8*29o5njl%UL#F6~G%;koWR0^; zvnAW+*%UStIO}rTYRESwwn|$y`0IY#Gq55Zvo*tl)M0xMR*{cw!?tL9JmfGrBruKL zX3wW89)?umjh5%S|K#au`v z21U9eOR-9^0TQtnT3M}PpW-0&jz+}^MJqIqF2x1KfZ}uTUJH z*C-2>rAi;{SblKmC%}7t0Q~tG>=(aOo>IO6Th_baK!0RdbP=*>v}z)7X$mx}nczk@ ztLCWY!9ueTc%@UBR5oy?C8}kr<*Hopr!}f|s*S25aH&$22m04`@Ty&^$5eHy$HB3l zQa!DDM)fTC*7K?tRL4{=gL}QEIt5wtEO^*C)p^x>s`tUkK2&|A`dIZT_}N9(B~>(J z;Yq;EY3iBkS>SDR)brHy)eFJlbZV2@rcMW+Tc%#F&V`)31{k|hU8LR&p67wQx*am} zE?{q+`f>F>@V}?k�eOKL;-Og8G>HW%UX0!c&lF&%(xZ4p{x3`hE2U@WqeRAFDrw z7I6_69<7D52 zpp}~KnnyIdz(?y~J=mvt3f%M=&9j>4G|z*l9@D(6IRX31DNu*Anm3^Vo(GM1AJ&!+ z!DT;&uJt+W43|JJCTb_a;xP?WW0v-2?Husk`PzkA6?7XDC`dZ=v1Q=Fx!P6GbJl?q z7il-cYU%+$-VWJ(7i<)Dpe*~KuRRUk{H*plSW{mBhkjXmLi?Kb6!`R6?VGS-oCmjl zUwc9Oq4p#2>`!57y{Nqe&OK2#NjF6|4g7nS?q=N_-8^vdg|IW|bSCifblnozgO-D% zuhOm2tzbmw*Nf%jj~eW?2g7K=|o#V+bD>7w-$LCdD-r|D-x8n{_M2l~x?$OJ0APH%#} zFCElv8SE^%kPp`A*XcLviy$SG>OJ~O{dUL-|EIn4agVAx^Z1#WFae^XfJUGSGHalw zC3Ej2xxep4Sf!9^kVvD28f;L+Ah69^x=`g;D^@E(BTF?ED5<7M6$-8Nc~S{(*dk`z z3`_+Yc8yBqr-C$H*@|2C^WK@%^m+OR^m(><9K7E-zuxnnU+?=p=iFIgJOTr=8jImy zjc1MZ#wP5B7vVp)8?RtJ>@xlhw(1RRhy%t!qsw>;OX8Su$~a^E9(&?r<4;D^jAK?VxtVUuCj((*J7y@SvOeY;7Q7vbA4-q^|;+&H`?p$CVPY3Y`5T5Y_)g5u(jH4 zcDudT?yx)U3_k4TWVLtW{tf+J~g8l81c6I^ODT;3LEtFyz| z>9oRUwL5#A4yV(};PoGY-8$+VcTPKJogU}BbHTaj#N2$hz#W8VQ|OMsw@J8T++w%H zO}U2axB*_?B)7t?#N(-UXSg+PEu2A}yTGk?7r9H^rS3|1mHW8c;5NdRHMtw$^jq95 z?pAjPY+`F4{wxEpc*O078$9lwcF(#!?s@kDUQ^7=_X@m0-Vm?Q8{v)g5-_R7UWu22 zeRRA426B>DfzMy%Rm1(%c(rh>b>0H6-dh9K*q^!%FtR(O$qO`%8{yq@VD|_{A`{Dc|rNKkz5A z8&Sc2M3rCd&+u#fT7QmThyPj+`?SPgiXXQMuB5?l^w;@K{szC-5?4Auor!G@qYXbHC9Rqudn zY7N?g_F!+&5p)Kb;81V`2K^}9(`ohsdhoO_1Q$aN3TK=DV#)kuL2^)X2wwLH_{KzX zOtLsx0yAace+TRnOiETHE8!ullQWVvuvK%Cb;$+Ep5*!Dh2+I#3=gzYtJ11rvum_k zc=j?Q`WU@fFVR!Fp*wn@PlR)<&@1&Sy_$WC z8ogGZqn|H-h}q|uaVfsXRWOW)trJ!&mdzITpj(IyG1h-TxWnDD)5!Vko|amW~E&a)OqT;Z;D2hy9>+Y#9s zP@kthGxg{2ExS@DkfRXKu(osotJs|KX?S4EnK#qSio?u1toLk-9jQXtl`G+NA|Xe= zkTrh;9PntUW7lly3&rC1L=`lY4MvyN;lKT`fSE5>BwZetEJ ze4Ft}nEMoSp*i2K#}j*rxiD?N$?SK^9_Cz&6#-Ss>x9$Kz0rNheZ_s4 z(bO95_Z?%5obwe7nGtyO_<8UG%i#nLN`Jkavj_ZdFuie{meMS^yt}Zee!za>^IJ_-h5&dz<5l6oBW!& z$b5)?(;vTdinWsVdfkdJbAM=mWM9QheVy|by(lAAYxPX(Fg8$@;kykh zrU^Ucjnel@ca^o5?JGNpUGRsp`^qmd_OW6K6MbclufNNxwdUe4ueF-6_g}O2TJ!Ds z&T{7o_^VE4{@=5wk#MKE*WryecypxRC!?~Jp&m%y#z@_S?OCdK=)X%@*iA)c6?iP` z@bNdXKJPVtmD5gv=S~Fo;_80NL|Cu$f)joj75QAl&=RC;n*mLg7 zZlkvX*5}D!8~a||Eug&7SjXG6pRrqThTYns`Y=ZGG%V6(sc*Auu??&6VCqQfom63I zvTPrAi4BK3!@L>&Kh5e@%lfj*eK2IITf85`H=go@IV9t$++|=M8uvhzlv(PP)|D=#){Uj#!#>=DE%;Gse%Yni zc@VO|&Uoim*891v^uj|v5&BueQf!Bde2snQ!_I%Pj{lK%9p)CXW>1EnnBgvFJ^n5$ z@Xy^>;U?c?#XTt#(%=97u7SS+4KO@~#t#3+&8*E{N}V}3WtPw6G`N0m{p@k|{~`yC z{-6A{aQfyt&aBBfxPGcAlZIosn`gelB+E;W=U14%96rl;vGhi83m6IX0rx#=rSB<0NlkI!LA zKmS_xsVI+RoXsoB?7EJd6g-PO{Z%~uLV~m;?!}Xe*xw{RVukg4_6Fkj!5@!9-ahzb zN~v97sm}oNUv4UOBUtp451!6kR*=Ja;61EkPvpuIeGI=bTOYon4zct$@Fs+jLryWm zKe>t5rsd*Ckazbaxe=7rHxll@WU}Hca<=}GUZ0{Aze$-(-~Yg@Ta?;KIMqZy1qVjm ziY|~RPM(63Q?vTwD{x+V6L@3zoW(0{Q>v{Go;po&>m;i$k!KC~$KZZpoOpVCm7J&h zv^~~9l3>!Z2^t>mPdXMnYx$uF{C^eMC z(!V0;=M1l7uFC0C@YL_~P7T6(<=qJWTo_m6jirlu9rJFm%FBaXdY9 zpHlzBGa~Tmf8ZBya4(T((NCQEt?5vTCd>7Qc)H|Q+5RE|^oGmZduM|nb z@+JHvnQiD3{%%HbCRO6fCzc+1koqCa=ny9|6W-+}!6o5wFTxq`XXx9x_Q^xO^jW25 z5tl0QiKlP>P^l?|OM404cn)6-<(7bB^v?rS?nRz^%hNyRdw|qm^8f57+^GZi>g&V* zWj+QY0^b#7esnS0UXs7`-|z5m4bOtnQ2J`#-Cm5cq`hSPEgBs8i}}3a>+s0Vr};m( zJ)#yN{Cwi~Qv>%e+8I&brSPGW8}0KmUPiNgaCT0X^2c*Qd>Qgcdr1DLe;rXj1^4!c z0bCY;51a_o7aVZ86V8wfxYJiJWe%fJ%<#M=?og>cdy{TN>(k44mD=&N`BQzyB34wmr#giqtu zhW`nc{+alV0>C>7V&SM9I&nOL_@^^gJ(lpfZJE(SH@MLzqSRSBBw<%rUew zJeR+W2O}0$SAqu-F5}&fN7cQ^FZuN&d}Dr;JCxb}){p+32D5~bi^!LkzPx`lJfALD z#>aTDoeLLy-$3pO6Daw~c>l&_QH6+q#>20OD&9{J>QCBlB*wsY;`h!M-ztBkhpO8LV|NQ;`cn9UtUt~OreR1mqEy<($!s3Ly=~dlq&*ZY0T!F3c PHDLd`Rl9KZSJnRk)F;&# -- 1.8.3.1