1. 26 Jul, 2020 2 commits
    • Philip Withnall's avatar
      gfileutils: Add a mode argument to g_file_set_contents_full() · 24ed91ce
      Philip Withnall authored
      This is used when creating the temporary file, or new file from scratch.
      
      I wondered about also allowing the file owner and group to be set, but
      that’s not as generally applicable — if your process is operating across
      multiple user IDs then it likely has some fairly OS-specific
      requirements and will need tighter control of its syscalls anyway.
      
      (Eventually, support for setting the file owner and group atomically
      could be added by writing out a file using `O_TMPFILE` so it’s not
      addressable, and then linking it into the file system in place of the
      old file using something like `renameat2(AT_EMPTY_PATH)` or `linkat()`.
      That’s currently not possible without patching the kernel with
      https://marc.info/?l=linux-fsdevel&m=152472898003523&w=2, as far as I
      know at the moment.)
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      
      Fixes: #1203
      24ed91ce
    • Philip Withnall's avatar
      gfileutils: Add g_file_set_contents_full() and GFileSetContentsFlags · 554107c2
      Philip Withnall authored
      This is a new version of the g_file_set_contents() API which will allow
      its safety to be controlled by some flags, allowing the user to choose
      their preferred tradeoff between safety (`fsync()` calls) and speed.
      
      Currently, the flags do nothing and the new API behaves like the old
      API. This will change in the following commits.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      
      Helps: #1302
      554107c2
  2. 30 May, 2019 1 commit
    • Philip Withnall's avatar
      glib, gio: Use GLIB_DEPRECATED_MACRO instead of G_DISABLE_DEPRECATED · b4d58a71
      Philip Withnall authored
      When defining deprecated macros, annotate them with
      `GLIB_DEPRECATED_MACRO_IN_*()` and `GLIB_DEPRECATED_MACRO_IN_*_FOR()` to
      conditionally emit warnings if people use them, depending on their
      declared minimum and maximum GLib version requirements (see
      `GLIB_VERSION_MIN_REQUIRED` and `GLIB_VERSION_MAX_ALLOWED`).
      
      The old way of doing this was for users to define `G_DISABLE_DEPRECATED`
      if they didn’t want to use deprecated APIs, but it reported errors via
      missing symbols, and wasn’t version-dependent. It’s being phased out.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
      b4d58a71
  3. 30 Apr, 2018 1 commit
    • Georges Basile Stavracas Neto's avatar
      fileutils: Add g_canonicalize_filename · b9b642de
      Georges Basile Stavracas Neto authored
      Getting the canonical filename is a relatively common
      operation when dealing with symbolic links.
      
      This commit exposes GLocalFile's implementation of a
      filename canonicalizer function, with a few additions
      to make it more useful for consumers of it.
      
      Instead of always assuming g_get_current_dir(), the
      exposed function allows passing it as an additional
      parameter.
      
      This will be used to fix the GTimeZone code to retrieve
      the local timezone from a zoneinfo symlink.
      
      (Tweaked by Philip Withnall <withnall@endlessm.com> to drop g_autofree
      usage and add some additional tests.)
      
      https://bugzilla.gnome.org/show_bug.cgi?id=111848
      b9b642de
  4. 09 Jan, 2018 1 commit
  5. 07 Nov, 2017 1 commit
  6. 24 May, 2017 1 commit
    • Sébastien Wilmet's avatar
      glib/: LGPLv2+ -> LGPLv2.1+ · f9faac76
      Sébastien Wilmet authored
      All glib/*.{c,h} files have been processed, as well as gtester-report.
      
      12 of those files are not licensed under LGPL:
      
      	gbsearcharray.h
      	gconstructor.h
      	glibintl.h
      	gmirroringtable.h
      	gscripttable.h
      	gtranslit-data.h
      	gunibreak.h
      	gunichartables.h
      	gunicomp.h
      	gunidecomp.h
      	valgrind.h
      	win_iconv.c
      
      Some of them are generated files, some are licensed under a BSD-style
      license and win_iconv.c is in the public domain.
      
      Sub-directories inside glib/:
      
      	deprecated/: processed in a previous commit
      	glib-mirroring-tab/: already LGPLv2.1+
      	gnulib/: not modified, the code is copied from gnulib
      	libcharset/: a copy
      	pcre/: a copy
      	tests/: processed in a previous commit
      
      https://bugzilla.gnome.org/show_bug.cgi?id=776504
      f9faac76
  7. 06 Apr, 2017 1 commit
  8. 04 Jan, 2017 1 commit
  9. 12 Dec, 2014 1 commit
  10. 31 Jan, 2014 1 commit
  11. 13 Jan, 2013 1 commit
  12. 28 Dec, 2012 1 commit
  13. 16 Nov, 2012 1 commit
  14. 15 Nov, 2012 1 commit
  15. 26 May, 2012 1 commit
  16. 03 Nov, 2011 1 commit
  17. 17 Oct, 2011 1 commit
  18. 12 Oct, 2011 1 commit
  19. 11 Oct, 2011 1 commit
  20. 09 Oct, 2011 1 commit
  21. 14 Aug, 2011 1 commit
  22. 20 Jul, 2011 3 commits
    • Allison Karlitskaya's avatar
      Change order of GFormatSizeFlags · 8cadef1a
      Allison Karlitskaya authored
      David requested that I change the order of the flags.
      
      Also, assign numerical values to the flags in the usual way.  This
      wasn't a bug yet, but only by chance.
      8cadef1a
    • Allison Karlitskaya's avatar
      g_format_size: Return 'gchar' instead of 'char' · 4aff6119
      Allison Karlitskaya authored
      I meant to do that in the first place.
      4aff6119
    • Allison Karlitskaya's avatar
      Change GLib size units policy · afd1e369
      Allison Karlitskaya authored
      This commit changes GLib size units policy.  We now prefer SI units and
      allow for use of proper IEC units where desired.
      
      g_format_size_for_display() which incorrectly mixed IEC units with SI
      suffixes is left unmodified, but has been deprecated.
      
      g_format_size() has been introduced which uses SI units and suffixes.
      
      g_format_size_full() has also been added which takes a flags argument to
      allow for use of IEC units (with correct suffixes).  It also allows for
      a "long format" output which includes the total number of bytes.  For
      example: "238.5 MB (238,472,938 bytes)".
      afd1e369
  23. 04 Jun, 2011 1 commit
  24. 04 Sep, 2009 1 commit
    • Benjamin Otte's avatar
      Bug 594034 - Add g_mkstemp_full() · 24bec5c5
      Benjamin Otte authored
      This function exposes more variables than g_mkstemp() and therefor
      allows more flexibility when creating temporary files.
      The intended use is gio's code for g_file_replace() (see next patch)
      24bec5c5
  25. 05 May, 2008 1 commit
    • Michael Natterer's avatar
      #define __GLIB_H_INSIDE__ around including everything. · e0aa9d8a
      Michael Natterer authored
      2008-05-05  Michael Natterer  <mitch@imendio.com>
      
      	* glib/glib.h: #define __GLIB_H_INSIDE__ around including
      	everything.
      
      	* glib/*.h: check for that define instead of __G_LIB_H__ if
      	G_DISABLE_SINGLE_INCLUDES is defined.
      
      	* glib/gdatasetprivate.h: #include <glib.h> instead of
      	<glib/gdataset.h>
      
      
      svn path=/trunk/; revision=6875
      e0aa9d8a
  26. 14 Mar, 2008 1 commit
    • Michael Natterer's avatar
      make it possible to disable single-file includes by defining · f4bb21aa
      Michael Natterer authored
      2008-03-14  Michael Natterer  <mitch@imendio.com>
      
      	* glib/*.h: make it possible to disable single-file includes by
      	defining G_DISABLE_SINGLE_INCLUDES when building against GLib.
      	Approved by Tim Janik.
      
      	* glib/glib.h: include <glib/gslice.h>.
      
      	* glib/gi18n.h
      	* glib/gi18n-lib.h
      	* glib/gprintf.h: include <glib.h> so the above works when these
      	files are included without including <glib.h> first.
      
      
      svn path=/trunk/; revision=6713
      f4bb21aa
  27. 19 Dec, 2007 1 commit
  28. 27 Nov, 2007 1 commit
  29. 23 Jun, 2005 1 commit
  30. 22 Jun, 2005 2 commits
  31. 05 May, 2005 1 commit
    • Owen Taylor's avatar
      Add g_object_add/remove_toggle_ref() functions to get notification when a · 2ae1a46b
      Owen Taylor authored
      2005-05-05  Owen Taylor  <otaylor@redhat.com>
      
              * gobject.[ch] gobject.symbols: Add
              g_object_add/remove_toggle_ref() functions to get notification
              when a reference count is the last remaining reference; this
              enables better memory management for language bindings.
              (http://mail.gnome.org/archives/gtk-devel-list/2005-April/msg00095.html)
      
      2005-05-05  Owen Taylor  <otaylor@redhat.com>
      
              * glib/gdataset.[ch] glib/gdatasetprivate.h: Add
              g_datalist_set/unset_flags(), g_datalist_get_flags() functions
              to squeeze some bits into a GDataSet... this is needed for
              efficient implementation of toggle references in GObject.
      
              * tests/gobject/references.c tests/gobject/Makefile.am:
              Add a test case for weak and toggle references.
      
              * glib/gfileutils.[ch]: Rename g_file_replace() back
              to g_file_set_contents().
      
              * glib/glib.symbols: Update.
      
      2005-05-05  Owen Taylor  <otaylor@redhat.com>
      
              * glib/Makefile.am glib/glib-sections.txt gobject/gobject-sections.txt:
              Update
      
              * gobject/tmpl/objects.sgml: Document toggle-references.
      2ae1a46b
  32. 08 Mar, 2005 2 commits
  33. 27 Oct, 2004 1 commit
    • Matthias Clasen's avatar
      Introduce the idea of a filename encoding, which is *literally* the · 8a7eecd7
      Matthias Clasen authored
      2004-10-27  Matthias Clasen  <mclasen@redhat.com>
      
      	Introduce the idea of a filename encoding, which is
      	*literally* the filename encoding on Unix. On windows,
      	use the Unicode name converted to UTF-8. (#156325,
      	Tor Lillqvist, Owen Taylor)
      
      	* glib/gdir.[hc]:
      	* glib/gconvert.[hc]:
      	* glib/gfileutils.[hc]:
      	* glib/gutils.[hc]:
      	* glib/giowin32.c: On Windows, keep old ABI versions
      	of GLib pathname api for DLL ABI stability. Use different
      	names for the new-style UTF-8 versions. Hide this through
      	a #define.
      
      	* glib/gstdio.[hc]: New files containing wrappers for
      	POSIX pathname api.
      
      	* glib/glib.symbols: Add new symbols.
      
      	* glib/makegalias.pl: Drop Win32 specific .def syntax,
      	include gstdio.h
      8a7eecd7
  34. 27 Aug, 2004 1 commit
    • Matthias Clasen's avatar
      Fix #151193, Stepan Kasal: · 981fe434
      Matthias Clasen authored
      2004-08-27  Matthias Clasen  <mclasen@redhat.com>
      
      	Fix #151193, Stepan Kasal:
      
      	* glib/gfileutils.c (g_file_error_from_errno):
      	* glib/gfileutils.h (enum GFileError): Add G_FILE_ERROR_NOSYS.
      981fe434
  35. 29 Jul, 2003 1 commit