glib/gio/glocalfileoutputstream.h
David Zeuthen 366b3ffcde Bug 619142 – Build fixes
- Fix various #include issues

 - Change #error to #warning for the EXTERNAL authentication mechanism.
   It is not clear if this should work on Win32 at all.

 - Call close() before unlink() for the SHA1 keyring

 - Change #error to #warning so we don't forget to do
   permission checking of the .dbus-keyrings directory

 - Use Win32 SID for the SHA1 auth mech

 - Apparently we can't use word 'interface' as an identifier

 - Implement a _g_dbus_win32_get_user_sid() function. For now it's
   private. Don't know if it should be public somewhere. Maybe in
   a future GCredentials support for Win32? I don't know.

 - GFileDescriptorBased is not available on Win32. So avoid using
   it in GLocalFile stuff. Now, Win32 still uses GLocalFile + friends
   (which works with file descriptors) so expose a private function
   to get the fd for an OutputStream so things still work.

 - Fixup gio.symbols

 - Fixup tests/gdbus-peer.c so it builds

With this, at least things compile and the gdbus-peer.exe test case
passes. Which is a great start. I've tested this by cross-compiling on
a x86_64 Fedora 13 host using mingw32 and running the code on a 32-bit
Windows 7 box.

https://bugzilla.gnome.org/show_bug.cgi?id=619142

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-05-20 10:53:08 -04:00

92 lines
4.3 KiB
C

/* GIO - GLib Input, Output and Streaming Library
*
* Copyright (C) 2006-2007 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Alexander Larsson <alexl@redhat.com>
*/
#ifndef __G_LOCAL_FILE_OUTPUT_STREAM_H__
#define __G_LOCAL_FILE_OUTPUT_STREAM_H__
#include <gio/gfileoutputstream.h>
G_BEGIN_DECLS
#define G_TYPE_LOCAL_FILE_OUTPUT_STREAM (_g_local_file_output_stream_get_type ())
#define G_LOCAL_FILE_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_LOCAL_FILE_OUTPUT_STREAM, GLocalFileOutputStream))
#define G_LOCAL_FILE_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_LOCAL_FILE_OUTPUT_STREAM, GLocalFileOutputStreamClass))
#define G_IS_LOCAL_FILE_OUTPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_LOCAL_FILE_OUTPUT_STREAM))
#define G_IS_LOCAL_FILE_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_LOCAL_FILE_OUTPUT_STREAM))
#define G_LOCAL_FILE_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_LOCAL_FILE_OUTPUT_STREAM, GLocalFileOutputStreamClass))
typedef struct _GLocalFileOutputStream GLocalFileOutputStream;
typedef struct _GLocalFileOutputStreamClass GLocalFileOutputStreamClass;
typedef struct _GLocalFileOutputStreamPrivate GLocalFileOutputStreamPrivate;
struct _GLocalFileOutputStream
{
GFileOutputStream parent_instance;
/*< private >*/
GLocalFileOutputStreamPrivate *priv;
};
struct _GLocalFileOutputStreamClass
{
GFileOutputStreamClass parent_class;
};
GType _g_local_file_output_stream_get_type (void) G_GNUC_CONST;
void _g_local_file_output_stream_set_do_close (GLocalFileOutputStream *out,
gboolean do_close);
gboolean _g_local_file_output_stream_really_close (GLocalFileOutputStream *out,
GCancellable *cancellable,
GError **error);
GFileOutputStream * _g_local_file_output_stream_open (const char *filename,
gboolean readable,
GCancellable *cancellable,
GError **error);
GFileOutputStream * _g_local_file_output_stream_create (const char *filename,
gboolean readable,
GFileCreateFlags flags,
GCancellable *cancellable,
GError **error);
GFileOutputStream * _g_local_file_output_stream_append (const char *filename,
GFileCreateFlags flags,
GCancellable *cancellable,
GError **error);
GFileOutputStream * _g_local_file_output_stream_replace (const char *filename,
gboolean readable,
const char *etag,
gboolean create_backup,
GFileCreateFlags flags,
GCancellable *cancellable,
GError **error);
/* Hack to get the fd since GFileDescriptorBased (which is how you
* _should_ get the fd) is only available on UNIX but things like
* win32 needs this as well
*/
gint _g_local_file_output_stream_get_fd (GLocalFileOutputStream *output_stream);
G_END_DECLS
#endif /* __G_LOCAL_FILE_OUTPUT_STREAM_H__ */