Commit Graph

19 Commits

Author SHA1 Message Date
Sébastien Wilmet
6231b1abc9 License headers: replace current FSF address by a link to gnu.org
Even if the address is correct, it's far more convenient to have a link
to a website.

https://bugzilla.gnome.org/show_bug.cgi?id=776586
2017-01-04 19:12:57 +01:00
Emmanuele Bassi
a0c3fdfae0 docs: Replace <structname> tags with back ticks
https://bugzilla.gnome.org/show_bug.cgi?id=731050
2014-05-31 19:22:15 +01:00
Ryan Lortie
0156092a42 various: add GLIB_AVAILABLE_IN_ALL everywhere else
Add the GLIB_AVAILABLE_IN_ALL annotation to all old functions (that
haven't already been annotated with the GLIB_AVAILABLE_IN_* macros or a
deprecation macro).

If we discover in the future that we cannot use only one macro on
Windows, it will be an easy sed patch to fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=688681
2013-01-13 13:11:57 -05:00
Matthias Clasen
e1b99b2ddc Move single-include guards inside include guards
gcc has optimizations for include guards that only work
if they are outermost in the the header.
https://bugzilla.gnome.org/show_bug.cgi?id=689810
2012-12-27 23:43:14 -05:00
Matthias Clasen
7455dd370e Make single includes mandatory
This has been the official line since 2.17, which seems plenty
long enough for a transition phase.
2011-10-12 00:25:38 -04:00
Ryan Lortie
ab8938c64d Revert "gdatetime: Add g_date_time_source_new()"
This reverts three commits:

 - 1feb752996
 - 5763c63147
 - 21a5389340

https://bugzilla.gnome.org/show_bug.cgi?id=655129
2011-08-31 12:56:28 -04:00
Colin Walters
1feb752996 gdatetime: Add g_date_time_source_new()
Several different codebases in GNOME want to implement wall clocks.
While we could pretty easily share a private library, it's not a
substantial amount of code, and GLib already has a lot of the
necessary system-specific detection and handling infrastructure.

Note this initial implementation just wakes up once a second in the
cancel_on_set case; we'll add the Linux-specific handling in a
subsequent commit.

https://bugzilla.gnome.org/show_bug.cgi?id=655129
2011-08-29 10:24:08 -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
02451227ec fix argument order for g_date_time_difference()
The names of the arguments in the header file was reversed.

Closes bug #630000
2010-09-22 06:30:54 -04:00
Ryan Lortie
cec629972b GDateTime: G_GNUC_WARN_UNUSED_RESULT for modifiers
Emmanuele suggested adding G_GNUC_WARN_UNUSED_RESULT to all of the
g_date_time_add_* functions to help deal with the situation where people
may mistakenly believe that these functions are inplace modifiers.
2010-09-18 16:31:00 -04:00
Ryan Lortie
6b0e31ce48 Clean-up/tweaking of GDateTime and GTimeZone 2010-09-17 11:40:10 -04:00
Emmanuele Bassi
3e9fb52214 datetime: Rename g_date_time_printf() to g_date_time_format()
The function does not use any printf() modifiers, so using printf() is a
misnomer.

Prior art: strftime, g_ascii_formatd

https://bugzilla.gnome.org/show_bug.cgi?id=50076
2010-09-17 11:40:10 -04:00
Emmanuele Bassi
0746f74036 datetime: Allow setting fractionary seconds in new_full()
Otherwise we'll have to do:

  dt = g_date_time_new_full (Y, M, D, h, m, s, tz);
  tmp = g_date_time_add_usec (dt, usec);
  g_date_time_unref (dt);
  dt = tmp;

With its additional allocations.

https://bugzilla.gnome.org/show_bug.cgi?id=50076
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
Damien Lespiau
43098d0038 datetime: Rename shadowing variables
timezone and tzname shadow variables declared in time.h. Let's rename
them to time_zone and tz_name then.

https://bugzilla.gnome.org/show_bug.cgi?id=628839
2010-09-06 11:51:11 +01: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
Emmanuele Bassi
ca7dee5949 Build fixes for the fall-out of the inclusion changes 2010-09-04 18:04:34 +01:00
Matthias Clasen
7c68050451 Remove excessive header includes 2010-09-03 21:15:45 -04:00
Thiago Santos
e1f13ee9ed Add GDateTime to GLib
GDateTime is an opaque data type containing a date and time
representation. It's immutable once created and reference
counted.

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

Based on the code by: Christian Hergert <chris@dronelabs.com>

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-08-24 23:41:21 +01:00