{-# LINE 2 "./System/Gnome/VFS/Init.chs" #-} -- GIMP Toolkit (GTK) Binding for Haskell: binding to libgnomevfs -*-haskell-*- -- -- Author : Peter Gavin -- Created: 1-Apr-2007 -- -- Copyright (c) 2007 Peter Gavin -- -- This library is free software: you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public License -- as published by the Free Software Foundation, either version 3 of -- the License, or (at your option) any later version. -- -- This library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- Lesser General Public License for more details. -- -- You should have received a copy of the GNU Lesser General Public -- License along with this program. If not, see -- <http: -- -- GnomeVFS, the C library which this Haskell library depends on, is -- available under LGPL Version 2. The documentation included with -- this library is based on the original GnomeVFS documentation, -- Copyright (c) 2001 Seth Nickell <snickell@stanford.edu>. The -- documentation is covered by the GNU Free Documentation License, -- version 1.2. -- -- | Maintainer : gtk2hs-devel@lists.sourceforge.net -- Stability : alpha -- Portability : portable (depends on GHC) module System.Gnome.VFS.Init ( -- * Initialization and Shutdown init, shutdown, initialized ) where import System.Glib.FFI import Control.Monad (liftM) import Prelude hiding (init) {-# LINE 47 "./System/Gnome/VFS/Init.chs" #-} -- | If gnome-vfs is not already initialized, initialize it. This must -- be called prior to performing any other gnome-vfs operations, and -- may be called multiple times without error. init :: IO Bool init = liftM toBool gnome_vfs_init {-# LINE 53 "./System/Gnome/VFS/Init.chs" #-} -- | Cease all active gnome-vfs operations and unload the MIME database -- from memory. shutdown :: IO () shutdown = gnome_vfs_shutdown {-# LINE 58 "./System/Gnome/VFS/Init.chs" #-} -- | Detects if gnome-vfs has already been initialized (gnome-vfs must -- be initialized prior to using any methods or operations). initialized :: IO Bool initialized = liftM toBool gnome_vfs_initialized {-# LINE 63 "./System/Gnome/VFS/Init.chs" #-} foreign import ccall safe "gnome_vfs_init" gnome_vfs_init :: (IO CInt) foreign import ccall safe "gnome_vfs_shutdown" gnome_vfs_shutdown :: (IO ()) foreign import ccall safe "gnome_vfs_initialized" gnome_vfs_initialized :: (IO CInt)