236.1.23
by Monty Taylor
Cleaned header headers. |
1 |
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 MySQL
|
|
5 |
*
|
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; either version 2 of the License, or
|
|
9 |
* (at your option) any later version.
|
|
10 |
*
|
|
11 |
* This program is distributed in the hope that it will be useful,
|
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 |
* GNU General Public License for more details.
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU General Public License
|
|
17 |
* along with this program; if not, write to the Free Software
|
|
18 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
19 |
*/
|
|
20 |
||
21 |
#ifndef _libdrizzle_drizzle_time_h
|
|
22 |
#define _libdrizzle_drizzle_time_h
|
|
1
by brian
clean slate |
23 |
|
24 |
/*
|
|
25 |
Time declarations shared between the server and client API:
|
|
26 |
you should not add anything to this header unless it's used
|
|
27 |
(and hence should be visible) in mysql.h.
|
|
28 |
If you're looking for a place to add new time-related declaration,
|
|
29 |
it's most likely my_time.h. See also "C API Handling of Date
|
|
30 |
and Time Values" chapter in documentation.
|
|
31 |
*/
|
|
32 |
||
236.1.24
by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME. |
33 |
enum enum_drizzle_timestamp_type |
1
by brian
clean slate |
34 |
{
|
236.1.24
by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME. |
35 |
DRIZZLE_TIMESTAMP_NONE= -2, DRIZZLE_TIMESTAMP_ERROR= -1, |
36 |
DRIZZLE_TIMESTAMP_DATE= 0, DRIZZLE_TIMESTAMP_DATETIME= 1, DRIZZLE_TIMESTAMP_TIME= 2 |
|
1
by brian
clean slate |
37 |
};
|
38 |
||
39 |
||
40 |
/*
|
|
236.1.24
by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME. |
41 |
Structure which is used to represent datetime values inside Drizzle.
|
1
by brian
clean slate |
42 |
|
43 |
We assume that values in this structure are normalized, i.e. year <= 9999,
|
|
44 |
month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
|
|
45 |
in server such as my_system_gmt_sec() or make_time() family of functions
|
|
46 |
rely on this (actually now usage of make_*() family relies on a bit weaker
|
|
236.1.24
by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME. |
47 |
restriction). Also functions that produce DRIZZLE_TIME as result ensure this.
|
1
by brian
clean slate |
48 |
There is one exception to this rule though if this structure holds time
|
236.1.24
by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME. |
49 |
value (time_type == DRIZZLE_TIMESTAMP_TIME) days and hour member can hold
|
1
by brian
clean slate |
50 |
bigger values.
|
51 |
*/
|
|
236.1.24
by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME. |
52 |
typedef struct st_drizzle_time |
1
by brian
clean slate |
53 |
{
|
54 |
unsigned int year, month, day, hour, minute, second; |
|
55 |
unsigned long second_part; |
|
236.1.26
by Monty Taylor
my_bool cleanup in libdrizzle time stuff. |
56 |
bool neg; |
236.1.24
by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME. |
57 |
enum enum_drizzle_timestamp_type time_type; |
58 |
} DRIZZLE_TIME; |
|
1
by brian
clean slate |
59 |
|
236.1.23
by Monty Taylor
Cleaned header headers. |
60 |
#endif /* _libdrizzle_drizzle_time_h */ |