Commit Graph

899 Commits

Author SHA1 Message Date
Colin Walters
549d895fa4 glib-unix: New API to watch some Unix signals
This new API allows watching a few select Unix signals;
looking through the list on my system, I didn't see anything
else that I think it'd reasonable to watch.

We build on the previous patch to make the child watch helper thread
that existed on Unix handle these signals in the threaded case.
In the non-threaded case, they're just global variables.

https://bugzilla.gnome.org/show_bug.cgi?id=644941
2011-04-27 16:01:39 -04:00
Colin Walters
0ff211f520 glib-unix: New Unix-specific API
GLib historically has been designed to be "mostly" portable; there
are some functions only available on Unix like g_io_channel_unix_new(),
but these are typically paired with obvious counterparts for Win32.

However, as GLib is used not only by portable software, but components
targeting Unix (or even just Linux), there are a few cases where it
would be very convenient if GLib shipped built-in functionality.

This initial patch is a basic wrapper around pipe2(), including
fallbacks for older kernels.  This pairs well with the
existing g_spawn_*() API and its child_setup functionality.

However, in the future, I want to add a signal() wrapper here,
complete with proxying the signal to a mainloop.  I have initial code
for this, but doing it sanely (including factoring out gmain.c's
private worker thread), is a complex task, and I don't want to block
on that.

See also gwin32.h for Win32 specific functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=644941
2011-04-27 13:29:38 -04:00
Maciej Piechotka
70a1981532 Allow caching have_qsort_r which re-enables cross-compiling
https://bugzilla.gnome.org/show_bug.cgi?id=646309
2011-04-26 23:41:51 -04:00
Benjamin Otte
d5dc79c0b0 API: testutils: Add g_test_fail()
This allows tests to fail in a nonfatal way and the test runner can
continue if invoked with -k.

https://bugzilla.gnome.org/show_bug.cgi?id=647826
2011-04-18 14:52:29 +02:00
Matthias Clasen
c36aa59bf0 Fix duplicate private subsection
gtk-doc doesn't understand duplicate Private subsections in
the obvious way, it seems.
2011-04-11 13:21:12 -04:00
Matthias Clasen
9d048615da Add 2.30 index to GLib docs 2011-04-11 12:53:25 -04:00
Ryan Lortie
de3a3b181a g_time_zone_new_local: cache the result
Add a function to drop the cache.
2011-03-31 12:47:02 +05:30
Emmanuele Bassi
0c1acc7e74 Revert "Deprecate G_CONST_RETURN"
This reverts commit a7fc7909da.

The deprecations was not discussed except on Bugzilla:

https://bugzilla.gnome.org/show_bug.cgi?id=644611
2011-03-15 09:02:08 +00:00
Ryan Lortie
a7fc7909da Deprecate G_CONST_RETURN 2011-03-15 01:32:22 -04:00
Ryan Lortie
d2a2fe96a3 GVariant docs cleanups
Fix some gtk-doc warnings
2011-03-04 00:57:51 -05:00
Ryan Lortie
be04e514c0 GVariant: add G_VARIANT_TYPE_VARDICT for a{sv} 2011-03-04 00:45:14 -05:00
Matthias Clasen
deab106457 Docs: Mention gettext setup requirements in i18n section 2011-02-12 12:45:25 -05:00
Will Thompson
dfeb02ee86 GVariant: titlecase ‘Unicode’ in text format docs 2011-02-11 19:10:18 +00:00
Will Thompson
c3fe071813 GVariant: Correct uint32/64 thinko in text format docs 2011-02-11 19:07:45 +00:00
Ryan Lortie
ea4e3ea1cb GVariant: doc the format of g_variant_parse/print 2011-02-11 13:53:10 -05:00
Ryan Lortie
b1d02f9323 GVariant: support NULL for empty arrays in varargs
g_variant_new("as", NULL); now gives an empty array of strings, for
example.

This was documented as working already, but was never actually
implemented (due to the fact that it muddies the water when considering
maybe types).  It's being implemented now because its convenience to
programmers exceeds any damage done to the conceptual purity of the API.
2011-02-11 10:14:29 -05:00
Javier Jardón
ad1f882a1c docs: Remove some unneeded template files
async_queues, atomic_operations and bookmarkfile are already ported
to inline comments
2011-02-01 13:20:33 +00:00
Behdad Esfahbod
0a57086540 Update to Unicode 6.0
One new GUnicodeBreak enum member.  Three new GUnicodeScript members,
and one member renamed to fix a typo.

Tests, docs, and scripts are updated.  PCRE update still needed.
2011-01-21 16:30:19 -05:00
Matthias Clasen
d2347f34fd Move GMarkup docs inline 2011-01-17 23:46:20 -05:00
Javier Jardón
c7041e221f docs: gvariant-varargs: Fix typo 2011-01-14 00:50:44 +00:00
Christian Persch
3d824065b8 Add g_get_locale_variants()
Make _g_compute_locale_variants() public as g_get_locale_variants().

Bug #635998.
2011-01-05 22:57:20 +01:00
Xavier Claessens
4e30904331 New API: g_sequence_lookup() and g_sequence_lookup_iter()
Fixes bug #617254
2010-12-20 17:30:58 +01:00
Matthias Clasen
1bbf4cb87c Remove the dead --disable-visiblity configure option
At the same time, document --disable-Bsymbolic.
2010-12-15 11:41:05 -05:00
Matt Rajca
4817dae0bb Removed mention of inexistent GNOME 2.0 porting guide 2010-11-28 18:35:03 -05:00
Dan Winship
d15cdbefec gmain: add g_source_add_child_source and g_source_remove_child_source
This adds "child source" support to GSource. A child source behaves
basically like a GPollFD; when you add a source to a context, all of
its child sources are added with the same priority; when you destroy a
source, all of its child sources are destroyed; and when a child
source triggers, its parent source's dispatch function is run.

Use cases include:

    - adding a GTimeoutSource to another source to cause the source to
      automatically trigger after a certain timeout.

    - wrapping an existing source type with a new type that has
      a different callback signature

    - creating a source that triggers based on different conditions
      at different times.

https://bugzilla.gnome.org/show_bug.cgi?id=634239
2010-11-26 15:07:28 -05:00
Matthias Clasen
3570c4a00e Add indices for new symbols in 2.28 2010-11-24 16:00:32 -05:00
Ryan Lortie
48ca3add14 G_STATIC_ASSERT: clarify when use is valid
Clarify when the use of G_STATIC_ASSERT is valid and fix up an invalid
use of it in GDBus.
2010-11-11 21:49:21 -05:00
Ryan Lortie
ba9fccf71e g_get_user_runtime_dir(): New function
Get the value of the XDG_RUNTIME_DIR environment variable.
2010-11-06 17:35:10 -04:00
Ryan Lortie
7fc6f8a159 Add g_variant_lookup() and tests
Convenience API for doing lookups in dictionaries where the key is a
string or object path.
2010-11-05 21:33:43 -04:00
Ryan Lortie
1cf14de82f docs: Recommend against using GTimeVal 2010-11-02 22:39:09 -04:00
Ryan Lortie
5dab4727ee Add g_get_real_time() for wall-clock int64 micros
Similar in spirit to g_get_monotonic_time().
2010-11-02 22:39:09 -04:00
Ryan Lortie
92df8a1d77 Drop GTimeSpec type 2010-11-02 22:39:09 -04:00
Ryan Lortie
29ce7385bb Add g_get_environ(): portable access to 'environ'
Return a copy of 'environ' on platforms where that is possible, or do
something else on other platforms.
2010-10-28 22:20:56 -04:00
Ryan Lortie
7c184df292 Bug 158725 - free linked list with data
Add some helpers for freeing a linked list along with its elements by
providing a GDestroyNotify to call on each of them.

Add a test.

Based on a patch from Cosimo Cecchi.
2010-10-28 11:20:57 -04:00
Ryan Lortie
b7d8363fbe Add g_source_get_time()
Cached version of g_get_monotonic_time() that does similar to what
g_source_get_current_time() does for g_get_current_time().
2010-10-27 09:22:12 -04:00
Ryan Lortie
ab548d240a Add g_get_monotonic_time()
Gets the system monotonic time on systems that have it.  Otherwise, call
g_get_current_time().
2010-10-27 09:22:12 -04:00
Ryan Lortie
ac82e74895 Add 'GTimeSpec' as 'struct timespec' equivalent 2010-10-27 09:22:12 -04:00
Matthias Clasen
727c2a58c2 Add new gmain api to the docs 2010-10-25 08:30:28 -04:00
Ryan Lortie
fff6814973 Bug 630077 - GDateTime week number support
Fully implement support for ISO 8601 week dates in GDateTime and
document that this is the case.

Add an exhaustive test case to ensure correctness.
2010-10-01 11:20:55 -04:00
Ryan Lortie
dda9707377 release 2.27.0 2010-09-17 18:32:35 -04:00
Ryan Lortie
5109778e93 .gitignore some sgml 2010-09-17 13:20:17 -04:00
Ryan Lortie
6b0e31ce48 Clean-up/tweaking of GDateTime and GTimeZone 2010-09-17 11:40:10 -04:00
Emmanuele Bassi
67f1e52ce2 datetime: Rework time zone support in constructors
Timezone handling is complicated. Really complicated.

In order to simplify it a little bit, we need to expose the GTimeZone
structure.

First of all, we allow creating time zone information directly from the
offset and the DST state, and then pass it to the g_date_time_new_full()
constructor. We also need to clean up the mess that is UTC-vs.-localtime
for the other constructors.

We also allow creating a GTimeZone from the Olson zoneinfo database
names; a time zone created like this will be "floating": it will just
reference the zoneinfo file - which are mmap()'ed, kept in a cache and
refcounted. Once the GTimeZone has been associated with a GDateTime, it
will be "anchored" to it: the offset will be resolved, as well as the
DST state.

https://bugzilla.gnome.org/show_bug.cgi?id=50076
2010-09-17 11:40:10 -04:00
David Zeuthen
3d8095588a Fix tmpl files
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 12:00:39 -04:00
Emmanuele Bassi
64300c0cc4 datetime: Add get_week_of_year()
https://bugzilla.gnome.org/show_bug.cgi?id=628029

Based on a patch by: Joseph Pingenot

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-09-06 11:50:30 +01:00
Jon Nordby
fb15dde6c1 docs: Inline docs from tmpl/memory.smgl 2010-09-01 09:48:16 +02:00
Emmanuele Bassi
250b1d576b docs: Fix the section name for GDateTime 2010-08-25 16:13:24 +01:00
Emmanuele Bassi
96dc06e6e0 docs: Add GDateTime to the GLib API reference 2010-08-24 23:41:21 +01:00
Emmanuele Bassi
d62eb80c54 docs: Mention TZDIR
The timezone code in GDateTime honours the TZDIR environment variable,
so it should be mentioned in the list of variables GLib checks at
runtime.
2010-08-24 23:41:21 +01:00
Simon McVittie
c29d800d84 GVariant: be more explicit about adopting and returning floating refs
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=622770
2010-08-13 22:42:24 -04:00