~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/my_time.h

Remove PLUGIN and MODULES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
  declarations for my_time.c
24
24
*/
25
25
 
26
 
#ifndef MYSYS_MY_TIME_H
27
 
#define MYSYS_MY_TIME_H
 
26
#ifndef DRIZZLED_MY_TIME_H
 
27
#define DRIZZLED_MY_TIME_H
28
28
 
29
 
#include "drizzle_time.h"
 
29
#if TIME_WITH_SYS_TIME
 
30
# include <sys/time.h>
 
31
# include <time.h>
 
32
#else
 
33
# if HAVE_SYS_TIME_H
 
34
#  include <sys/time.h>
 
35
# else
 
36
#  include <time.h>
 
37
# endif
 
38
#endif
30
39
 
31
40
#ifdef __cplusplus
32
41
extern "C" {
65
74
#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \
66
75
                                TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND)
67
76
 
 
77
enum enum_drizzle_timestamp_type
 
78
{
 
79
  DRIZZLE_TIMESTAMP_NONE= -2, DRIZZLE_TIMESTAMP_ERROR= -1,
 
80
  DRIZZLE_TIMESTAMP_DATE= 0, DRIZZLE_TIMESTAMP_DATETIME= 1, DRIZZLE_TIMESTAMP_TIME= 2
 
81
};
 
82
 
 
83
 
 
84
/*
 
85
  Structure which is used to represent datetime values inside Drizzle.
 
86
 
 
87
  We assume that values in this structure are normalized, i.e. year <= 9999,
 
88
  month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
 
89
  in server such as my_system_gmt_sec() or make_time() family of functions
 
90
  rely on this (actually now usage of make_*() family relies on a bit weaker
 
91
  restriction). Also functions that produce DRIZZLE_TIME as result ensure this.
 
92
  There is one exception to this rule though if this structure holds time
 
93
  value (time_type == DRIZZLE_TIMESTAMP_TIME) days and hour member can hold
 
94
  bigger values.
 
95
*/
 
96
typedef struct st_drizzle_time
 
97
{
 
98
  unsigned int  year, month, day, hour, minute, second;
 
99
  unsigned long second_part;
 
100
  bool       neg;
 
101
  enum enum_drizzle_timestamp_type time_type;
 
102
} DRIZZLE_TIME;
 
103
 
 
104
 
68
105
bool check_date(const DRIZZLE_TIME *ltime, bool not_zero_date,
69
106
                   uint32_t flags, int *was_cut);
70
107
enum enum_drizzle_timestamp_type
154
191
  INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND, INTERVAL_LAST
155
192
};
156
193
 
 
194
extern uint64_t my_getsystime(void);
 
195
extern uint64_t my_micro_time(void);
 
196
extern uint64_t my_micro_time_and_time(time_t *time_arg);
 
197
 
 
198
 
157
199
#ifdef __cplusplus
158
200
}
159
201
#endif
160
202
 
161
 
#endif /* MYSYS_MY_TIME_H */
 
203
#endif /* DRIZZLED_MY_TIME_H */