summaryrefslogtreecommitdiff
path: root/gio/glocalfileinputstream.c
Commit message (Collapse)AuthorAgeFilesLines
* gio: Add SPDX license headers automaticallyPhilip Withnall2022-05-181-0/+2
| | | | | | | | | | | | | | Add SPDX license (but not copyright) headers to all files which follow a certain pattern in their existing non-machine-readable header comment. This commit was entirely generated using the command: ``` git ls-files gio/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs' ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
* glocalfileinputstream: Drop custom skip vfunc implementationPhilip Withnall2021-02-151-61/+0
| | | | | | | | | | | | Since the previous commit, the generic `GInputStream` implementation of `skip()` is now equivalent, and results in the same calls to `lseek()`. Heavily based on an approach by Dan Winship in https://bugzilla.gnome.org/show_bug.cgi?id=681374. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #587
* gio/: LGPLv2+ -> LGPLv2.1+Sébastien Wilmet2017-05-291-1/+1
| | | | | | | | | | | | | | | | | Sub-directories inside gio/ already processed in a previous commit: - fam/ - gdbus-2.0/ (which contains only codegen/) - gvdb/ - inotify/ - tests/ - win32/ - xdgmime/ Other sub-directories inside gio/: - completion/: no license headers - kqueue/: not LGPL, BSD-style license https://bugzilla.gnome.org/show_bug.cgi?id=776504
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* Replace #ifdef HAVE_UNISTD_H checks with #ifdef G_OS_UNIXDan Winship2013-11-201-3/+1
| | | | | | | | | | | | | | | In Windows development environments that have it, <unistd.h> is mostly just a wrapper around several other native headers (in particular, <io.h>, which contains read(), close(), etc, and <process.h>, which contains getpid()). But given that some Windows dev environments don't have <unistd.h>, everything that uses those functions on Windows already needed to include the correct Windows header as well, and so there is never any point to including <unistd.h> on Windows. Also, remove some <unistd.h> includes (and a few others) that were unnecessary even on unix. https://bugzilla.gnome.org/show_bug.cgi?id=710519
* gio: Don't allow skipping past the end of GLocalFileInputStreamRoss Lagerwall2013-11-031-4/+19
| | | | | | | | | | The overridden implementation of the skip method for GLocalFileInputStream allows skipping past the end of the file which is inconsistent with the documentation. Prevent this by first seeking to the end of the file and then seeking backwards from there as much as is necessary. https://bugzilla.gnome.org/show_bug.cgi?id=711048
* Rename the generated private data getter functionEmmanuele Bassi2013-06-241-1/+1
| | | | | | | As it turns out, we have examples of internal functions called type_name_get_private() in the wild (especially among older libraries), so we need to use a name for the per-instance private data getter function that hopefully won't conflict with anything.
* gio: Use the new private instance data declarationEmmanuele Bassi2013-06-241-23/+9
| | | | | | | Use the newly added macros, and remove the explicit calls to g_type_class_add_private(). https://bugzilla.gnome.org/show_bug.cgi?id=700035
* Add g_close(), use itColin Walters2013-01-291-14/+10
| | | | | | | | | | | | | | | There are two benefits to this: 1) We can centralize any operating system specific knowledge of close-vs-EINTR handling. For example, while on Linux we should never retry, if someone cared enough later about HP-UX, they could come by and change this one spot. 2) For places that do care about the return value and want to provide the caller with a GError, this function makes it convenient to do so. Note that gspawn.c had an incorrect EINTR loop-retry around close(). https://bugzilla.gnome.org/show_bug.cgi?id=682819
* gio/: fully remove gioalias hacksRyan Lortie2010-07-071-1/+0
|
* Fix build with the Microsoft compilerTor Lillqvist2010-06-221-2/+4
| | | | | Correct a few gccisms and C99isms. Ensure the Windows-specific gio source files are listed in the generated gio VS project file.
* Bug 619142 – Build fixesDavid Zeuthen2010-05-201-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* GLocalFileInputStream: Implement GFileDescriptorBasedChristian Kellner2010-02-151-1/+21
|
* Fix up GIO docsMatthias Clasen2009-11-291-6/+0
|
* Fix a lot of clang complaintsMatthias Clasen2009-09-181-4/+0
| | | | Mostly dead assignments.
* Local file implementation of GFileIOStream and opsAlexander Larsson2009-05-131-0/+12
| | | | | | | This implements all the GIOStream file ops for local files. We use the "fallback to output stream" for all GFileIOStream ops. Some helpers stuff was added to the local input and output streams so they could be reused.
* fix attributes argument of query_info methods to be "const char *".Alexander Larsson2009-03-171-2/+2
| | | | | | | | | | | | 2009-03-17 Alexander Larsson <alexl@redhat.com> * glocalfileinputstream.c: * glocalfileoutputstream.c: fix attributes argument of query_info methods to be "const char *". svn path=/trunk/; revision=8000
* Moved all relevant typedefs into these files.Cody Russell2008-07-011-0/+1
| | | | | | | | | | | | | | | | 2008-07-01 Cody Russell <bratsche@gnome.org> * gio/gioenums.h: * gio/giotypes.h: Moved all relevant typedefs into these files. * gio/*.[ch]: Updated wrt added files. Split types into separate file for easier maintainership. (#538564) svn path=/trunk/; revision=7127
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * *.[ch]: Include "config.h" instead of <config.h> Command used: find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g' Rubberstamped by Mitch svn path=/trunk/; revision=7092
* chain up unconditionally in finalize() and dispose(). Also don'tMichael Natterer2008-06-161-3/+2
| | | | | | | | | | | 2008-06-16 Michael Natterer <mitch@imendio.com> * *.c: chain up unconditionally in finalize() and dispose(). Also don't dereference these function pointers when calling them since that has no meaning at all. svn path=/trunk/; revision=7048
* Save errno before calling other funcs that potentially alter it. BugChristian Persch2008-02-061-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gio/gdesktopappinfo.c: (ensure_dir): * gio/glocalfile.c: (g_local_file_query_filesystem_info), (g_local_file_read), (g_local_file_delete), (g_local_file_trash), (g_local_file_move): * gio/glocalfileinfo.c: (set_xattr), (_g_local_file_info_get), (_g_local_file_info_get_from_fd), (set_unix_mode), (set_unix_uid_gid), (set_symlink), (set_mtime_atime): * gio/glocalfileinputstream.c: (g_local_file_input_stream_read), (g_local_file_input_stream_skip), (g_local_file_input_stream_close), (g_local_file_input_stream_seek): * gio/glocalfileoutputstream.c: (g_local_file_output_stream_write), (g_local_file_output_stream_close), (g_local_file_output_stream_seek), (g_local_file_output_stream_truncate), (copy_file_data), (handle_overwrite_open): * gio/gunixinputstream.c: (g_unix_input_stream_read), (g_unix_input_stream_close), (read_async_cb), (close_async_cb): * gio/gunixoutputstream.c: (g_unix_output_stream_write), (g_unix_output_stream_close), (write_async_cb), (close_async_cb): Save errno before calling other funcs that potentially alter it. Bug #514766. svn path=/trunk/; revision=6466
* Whitespace cleanups.Matthias Clasen2008-01-211-2/+1
| | | | | | | | | | | | | | 2008-01-21 Matthias Clasen <mclasen@redhat.com> * glocal*.c: * gvolumemanager.c: Whitespace cleanups. * glocalfileoutputsteam.c (_g_local_file_output_stream_create): Use the right mode when creating the file. svn path=/trunk/; revision=6341
* [gio compiles and links on win32, not sure how much already works] ifdefedHans Breuer2007-12-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | 2007-12-08 Hans Breuer <hans@breuer.org> [gio compiles and links on win32, not sure how much already works] * glocaldirectorymonitor.c : ifdefed out inotify emulation for win32 * glocalfile.c : use HAVE_UNISTD_H; implement file system size info base on win32 API; prefer g_lstat() over lstat(); instead of localtime_r() use an all GLib implementation on win32; get_mount_info() still needs a win32 specifc implementation * glocalfileinfo.c : use HAVE_*_H; start of implementation of win32_get_file_user_info to get owner/group info without uid/gid * glocalfileinputstream.c : include <io.h> on win32 * glocalfileoutputstream.c : include <io.h> on win32 and some S_IS* definition, use g_win32_ftruncate() for G_OS_WIN32 * gwin32appinfo.c : optionalize a bunch on #ifdef AssocQueryString it is available with mingw/w32api but a mess with the M$ Platform SDKs see: http://mail.gnome.org/archives/gtk-devel-list/2007-December/msg00014.html * makefile.msc : updated svn path=/trunk/; revision=6070
* Rename all struct members named: read, write, close, truncate, or mount toAlexander Larsson2007-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2007-12-05 Alexander Larsson <alexl@redhat.com> * gbufferedinputstream.c: * gbufferedoutputstream.c: * gdrive.[ch]: * gfile.[ch]: * gfileenumerator.[ch]: * gfileinputstream.c: * gfileoutputstream.[ch]: * gfilterinputstream.c: * gfilteroutputstream.c: * ginputstream.[ch]: * glocalfile.c: * glocalfileenumerator.c: * glocalfileinputstream.c: * glocalfileoutputstream.c: * gmemoryinputstream.c: * gmemoryoutputstream.c: * goutputstream.[ch]: * gseekable.[ch]: * gunixdrive.c: * gunixinputstream.c: * gunixoutputstream.c: Rename all struct members named: read, write, close, truncate, or mount to foo_fn, as these are reserved names and could be defined as macros in libc. (#501645) svn path=/trunk/; revision=6048
* [start of port to win32/msvc] HAVE_UNIST_H and _pipe() only includeHans Breuer2007-12-031-0/+2
| | | | | | | | | | | | | | | | | | 2007-12-03 Hans Breuer <hans@breuer.org> [start of port to win32/msvc] * gcancellable.c : HAVE_UNIST_H and _pipe() * gcontenttype.c : only include <dirent.h> in the UNIX branch * gdatainputstream.c : pointer arithmetic on void* is a gcc extension * gdummyfile.c glocalfileinputstream.c gsimpleasyncresult.c : use HAVE_UNIST_H * glocalfileoutputstream.c : use HAVE_UNIST_H and s/ssize_t/gssize/ * glocalvfs.c : use HAVE_PWD_H * gio.symbols : ifdef unix specific functions with G_OS_UNIX * makefile.msc : new file (maybe later converted to makefile.msc.in) * Makefile.am : added to EXTRA_DIST svn path=/trunk/; revision=6027
* More coding style fixesMatthias Clasen2007-11-301-27/+25
| | | | svn path=/trunk/; revision=5999
* Removed unnecessary fileAlexander Larsson2007-11-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2007-11-28 Alexander Larsson <alexl@redhat.com> * Makefile.am: * gdriveprivate.h: Removed unnecessary file * gdesktopappinfo.[ch]: * gdummyfile.[ch]: * gfile.c: * glocaldirectorymonitor.[ch]: * glocalfile.[ch]: * glocalfileenumerator.[ch]: * glocalfileinputstream.[ch]: * glocalfilemonitor.[ch]: * glocalfileoutputstream.[ch]: * glocalvfs.[ch]: * gnativevolumemonitor.c: * gpollfilemonitor.[ch]: * gunionvolumemonitor.[ch]: * gunixdrive.[ch]: * gunixvolume.[ch]: * gunixvolumemonitor.[ch]: * gvfs.c: * gvolumeprivate.h: * inotify/ginotifydirectorymonitor.[ch]: * inotify/ginotifyfilemonitor.[ch]: * inotify/inotify-helper.c: Append _ to all internal functions * gio.symbols: Add missing symbols Export symbols needed for modules svn path=/trunk/; revision=5977
* Added. Added. Added. Added.Alexander Larsson2007-11-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 2007-11-28 Alexander Larsson <alexl@redhat.com> * Makefile.am: * abicheck.sh: Added. * makegioalias.pl: Added. * pltcheck.sh: Added. * gio.symbols: Added. * *.c: * inotify/*.c Initial work on adding symbol handling. * gvfs.h: Correct ifdef guard name * fam/Makefile.am: * inotify/Makefile.am: * xdgmime/Makefile.am: Include toplevel Makefile.decl svn path=/trunk/; revision=5972
* gio/ docs/reference/gio Merged gio-standalone into glib.Alexander Larsson2007-11-261-0/+319
2007-11-26 Alexander Larsson <alexl@redhat.com> * Makefile.am: * configure.in: * gio-2.0-uninstalled.pc.in: * gio-2.0.pc.in: * gio-unix-2.0-uninstalled.pc.in: * gio-unix-2.0.pc.in: * gio/ * docs/reference/gio Merged gio-standalone into glib. * glib/glibintl.h: * glib/gutils.c: Export glib_gettext so that gio can use it Add P_ (using same domain for now) Add I_ as g_intern_static_string svn path=/trunk/; revision=5941