1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * gsf-timestamp.h: A useful little type for metadata, contains a superset of
4 * all the features it would be nice to have.
6 * Copyright (C) 2002-2006 Jody Goldberg (jody@gnome.org)
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of version 2.1 of the GNU Lesser General Public
10 * License as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 #ifndef GSF_TIMESTAMP_H
24 #define GSF_TIMESTAMP_H
27 #include <glib-object.h>
31 #define GSF_TIMESTAMP_TYPE (gsf_timestamp_get_type ())
32 #define VAL_IS_GSF_TIMESTAMP(v) (G_TYPE_CHECK_VALUE_TYPE((v), GSF_TIMESTAMP_TYPE))
34 struct _GsfTimestamp {
35 GDate date; /* In local timezone */
36 glong seconds; /* time of day */
37 GString time_zone; /* possibly blank */
42 GType gsf_timestamp_get_type (void) G_GNUC_CONST;
43 /* void gsf_timestamp_register_type (GTypeModule *module); glib dynamic types are not thread safe */
45 GsfTimestamp *gsf_timestamp_new (void);
47 GsfTimestamp *gsf_timestamp_copy (GsfTimestamp const *stamp);
48 void gsf_timestamp_free (GsfTimestamp *stamp);
49 int gsf_timestamp_from_string (char const *spec, GsfTimestamp *stamp);
50 char *gsf_timestamp_as_string (GsfTimestamp const *stamp);
51 guint gsf_timestamp_hash (GsfTimestamp const *stamp);
52 gboolean gsf_timestamp_equal (GsfTimestamp const *a,
53 GsfTimestamp const *b);
55 void gsf_timestamp_set_time (GsfTimestamp *stamp, guint64 t);
57 void gsf_value_set_timestamp (GValue *value, GsfTimestamp const *stamp);
60 int gsf_timestamp_parse (char const *spec, GsfTimestamp *stamp);
64 #endif /* GSF_TIMESTAMP_H */