Eneboo - Documentación para desarrolladores
src/libmysql_std/include/mysql_time.h
Ir a la documentación de este archivo.
00001 /* Copyright (C) 2004 MySQL AB
00002 
00003  This program is free software; you can redistribute it and/or modify
00004  it under the terms of the GNU General Public License as published by
00005  the Free Software Foundation; version 2 of the License.
00006 
00007  This program is distributed in the hope that it will be useful,
00008  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  GNU General Public License for more details.
00011 
00012  You should have received a copy of the GNU General Public License
00013  along with this program; if not, write to the Free Software
00014  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
00015 
00016 #ifndef _mysql_time_h_
00017 #define _mysql_time_h_
00018 
00019 /*
00020   Time declarations shared between the server and client API:
00021   you should not add anything to this header unless it's used
00022   (and hence should be visible) in mysql.h.
00023   If you're looking for a place to add new time-related declaration,
00024   it's most likely my_time.h. See also "C API Handling of Date
00025   and Time Values" chapter in documentation.
00026 */
00027 
00028 enum enum_mysql_timestamp_type
00029 {
00030   MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
00031   MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
00032 };
00033 
00034 
00035 /*
00036   Structure which is used to represent datetime values inside MySQL.
00037 
00038   We assume that values in this structure are normalized, i.e. year <= 9999,
00039   month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions
00040   in server such as my_system_gmt_sec() or make_time() family of functions
00041   rely on this (actually now usage of make_*() family relies on a bit weaker
00042   restriction). Also functions that produce MYSQL_TIME as result ensure this.
00043   There is one exception to this rule though if this structure holds time
00044   value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold
00045   bigger values.
00046 */
00047 typedef struct st_mysql_time
00048 {
00049   unsigned int  year, month, day, hour, minute, second;
00050   unsigned long second_part;
00051   my_bool       neg;
00052   enum enum_mysql_timestamp_type time_type;
00053 } MYSQL_TIME;
00054 
00055 #endif /* _mysql_time_h_ */
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'