msg 1.12.11devel
Loading...
Searching...
No Matches
msg_date.h
Go to the documentation of this file.
1/*
2 * This file is part of the Sofia-SIP package
3 *
4 * Copyright (C) 2005 Nokia Corporation.
5 *
6 * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef MSG_DATE_H
27#define MSG_DATE_H
28
39#ifndef SU_TYPES_H
40#include <sofia-sip/su_types.h>
41#endif
42
43SOFIA_BEGIN_DECLS
44
45#ifndef MSG_TIME_T_DEFINED
46#define MSG_TIME_T_DEFINED
48typedef unsigned long msg_time_t;
49#endif
50
51#ifndef MSG_TIME_MAX
53#define MSG_TIME_MAX ((msg_time_t)ULONG_MAX)
54#endif
55
56/* Current time. */
58
59SOFIAPUBFUN issize_t msg_date_delta_d(char const **inout_string,
60 msg_time_t *return_date,
61 msg_time_t *return_delta);
62
63SOFIAPUBFUN issize_t msg_delta_d(char const **ss, msg_time_t *return_delta);
64SOFIAPUBFUN issize_t msg_delta_e(char b[], isize_t bsiz, msg_time_t delta);
65
67SOFIAPUBFUN issize_t msg_date_d(char const **ss, msg_time_t *date);
68
70SOFIAPUBFUN issize_t msg_date_e(char b[], isize_t bsiz, msg_time_t date);
71
72enum { msg_date_string_size = 29 };
73
74SOFIA_END_DECLS
75
76#endif /* !defined(MSG_DATE_H) */
msg_time_t msg_now(void)
Return current time as seconds since Mon, 01 Jan 1900 00:00:00 GMT.
Definition msg_date.c:52
issize_t msg_date_delta_d(char const **inout_string, msg_time_t *return_date, msg_time_t *return_delta)
Decode a HTTP date or delta.
Definition msg_date.c:402
issize_t msg_delta_d(char const **ss, msg_time_t *return_delta)
Decode a delta-seconds.
Definition msg_date.c:377
issize_t msg_date_e(char b[], isize_t bsiz, msg_time_t date)
Encode RFC1123-date.
Definition msg_date.c:328
issize_t msg_delta_e(char b[], isize_t bsiz, msg_time_t delta)
Encode <delta-seconds> field.
Definition msg_date.c:392
unsigned long msg_time_t
Time in seconds since epoch (1900-Jan-01 00:00:00).
Definition msg_date.h:48
issize_t msg_date_d(char const **ss, msg_time_t *date)
Decode RFC1123-date, RFC822-date or asctime-date.
Definition msg_date.c:182
#define SOFIAPUBFUN

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.