~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/tztime.h

  • Committer: Brian Aker
  • Date: 2008-07-02 20:56:30 UTC
  • Revision ID: brian@tangent.org-20080702205630-go36gbsrq1zbjyvg
Second pass on removing PS from client library

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
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
 
 
 
1
/* Copyright (C) 2004 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
 
 
17
#ifdef USE_PRAGMA_INTERFACE
 
18
#pragma interface                       /* gcc class interface */
 
19
#endif
 
20
 
 
21
#if !defined(TESTTIME) && !defined(TZINFO2SQL)
21
22
 
22
23
/**
23
24
  This class represents abstract time zone and provides 
24
 
  basic interface for DRIZZLE_TIME <-> my_time_t conversion.
 
25
  basic interface for MYSQL_TIME <-> my_time_t conversion.
25
26
  Actual time zones which are specified by DB, or via offset 
26
27
  or use system functions are its descendants.
27
28
*/
30
31
public:
31
32
  Time_zone() {}                              /* Remove gcc warning */
32
33
  /**
33
 
    Converts local time in broken down DRIZZLE_TIME representation to 
 
34
    Converts local time in broken down MYSQL_TIME representation to 
34
35
    my_time_t (UTC seconds since Epoch) represenation.
35
36
    Returns 0 in case of error. Sets in_dst_time_gap to true if date provided
36
37
    falls into spring time-gap (or lefts it untouched otherwise).
37
38
  */
38
 
  virtual my_time_t TIME_to_gmt_sec(const DRIZZLE_TIME *t, 
39
 
                                    bool *in_dst_time_gap) const = 0;
 
39
  virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, 
 
40
                                    my_bool *in_dst_time_gap) const = 0;
40
41
  /**
41
42
    Converts time in my_time_t representation to local time in
42
 
    broken down DRIZZLE_TIME representation.
 
43
    broken down MYSQL_TIME representation.
43
44
  */
44
 
  virtual void   gmt_sec_to_TIME(DRIZZLE_TIME *tmp, my_time_t t) const = 0;
 
45
  virtual void   gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const = 0;
45
46
  /**
46
47
    Because of constness of String returned by get_name() time zone name 
47
48
    have to be already zeroended to be able to use String::ptr() instead
59
60
extern Time_zone * my_tz_UTC;
60
61
extern Time_zone * my_tz_SYSTEM;
61
62
extern Time_zone * my_tz_OFFSET0;
62
 
extern Time_zone * my_tz_find(Session *session, const String *name);
63
 
extern bool     my_tz_init(Session *org_session, const char *default_tzname);
 
63
extern Time_zone * my_tz_find(THD *thd, const String *name);
 
64
extern my_bool     my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap);
64
65
extern void        my_tz_free();
65
 
extern my_time_t   sec_since_epoch_TIME(DRIZZLE_TIME *t);
 
66
extern my_time_t   sec_since_epoch_TIME(MYSQL_TIME *t);
 
67
 
 
68
/**
 
69
  Number of elements in table list produced by my_tz_get_table_list()
 
70
  (this table list contains tables which are needed for dynamical loading
 
71
  of time zone descriptions). Actually it is imlementation detail that
 
72
  should not be used anywhere outside of tztime.h and tztime.cc.
 
73
*/
 
74
 
 
75
static const int MY_TZ_TABLES_COUNT= 4;
 
76
 
 
77
 
 
78
#endif /* !defined(TESTTIME) && !defined(TZINFO2SQL) */