summaryrefslogtreecommitdiff
path: root/libsoup/soup-date.h
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2008-01-15 17:40:47 +0000
committerDan Winship <danw@src.gnome.org>2008-01-15 17:40:47 +0000
commit96d28e7f42ead1ddde6bccca9fba6831710a531f (patch)
tree8b3fd4ae679d19656aef6264cfcf260e515a8eec /libsoup/soup-date.h
parent3f957a48574e9ac8eba06cf91fb2f101ffcf982d (diff)
downloadlibsoup-96d28e7f42ead1ddde6bccca9fba6831710a531f.tar.gz
Merge libsoup-2.4 branch to trunk
* Merge libsoup-2.4 branch to trunk svn path=/trunk/; revision=1041
Diffstat (limited to 'libsoup/soup-date.h')
-rw-r--r--libsoup/soup-date.h50
1 files changed, 42 insertions, 8 deletions
diff --git a/libsoup/soup-date.h b/libsoup/soup-date.h
index 29bdf486..106b0824 100644
--- a/libsoup/soup-date.h
+++ b/libsoup/soup-date.h
@@ -1,23 +1,57 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2005 Novell, Inc.
+ * Copyright (C) 2007 Red Hat, Inc.
*/
#ifndef SOUP_DATE_H
#define SOUP_DATE_H 1
#include <time.h>
-#include <glib/gmacros.h>
+#include <libsoup/soup-types.h>
G_BEGIN_DECLS
-time_t soup_mktime_utc (struct tm *tm);
-void soup_gmtime (const time_t *when, struct tm *tm);
-
-time_t soup_date_parse (const char *timestamp);
-char *soup_date_generate (time_t when);
-
-time_t soup_date_iso8601_parse (const char *timestamp);
+typedef struct {
+ int year;
+ int month;
+ int day;
+
+ int hour;
+ int minute;
+ int second;
+
+ gboolean utc;
+ int offset;
+} SoupDate;
+
+typedef enum {
+ SOUP_DATE_HTTP = 1,
+ SOUP_DATE_COOKIE,
+ SOUP_DATE_RFC2822,
+ SOUP_DATE_ISO8601_COMPACT,
+ SOUP_DATE_ISO8601_FULL,
+ SOUP_DATE_ISO8601 = SOUP_DATE_ISO8601_FULL,
+ SOUP_DATE_ISO8601_XMLRPC
+} SoupDateFormat;
+
+GType soup_date_get_type (void);
+#define SOUP_TYPE_DATE (soup_date_get_type ())
+
+SoupDate *soup_date_new (int year,
+ int month,
+ int day,
+ int hour,
+ int minute,
+ int second);
+SoupDate *soup_date_new_from_string (const char *date_string);
+SoupDate *soup_date_new_from_time_t (time_t when);
+SoupDate *soup_date_new_from_now (int offset_seconds);
+
+char *soup_date_to_string (SoupDate *date,
+ SoupDateFormat format);
+SoupDate *soup_date_copy (SoupDate *date);
+void soup_date_free (SoupDate *date);
G_END_DECLS