1 /* adapter_mxdatetime.h - definition for the mx date/time types
3 * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
5 * This file is part of psycopg.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2,
10 * or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #ifndef PSYCOPG_MXDATETIME_H
23 #define PSYCOPG_MXDATETIME_H 1
31 extern PyTypeObject mxdatetimeType;
38 #define PSYCO_MXDATETIME_TIME 0
39 #define PSYCO_MXDATETIME_DATE 1
40 #define PSYCO_MXDATETIME_TIMESTAMP 2
41 #define PSYCO_MXDATETIME_INTERVAL 3
45 /* functions exported to psycopgmodule.c */
46 #ifdef PSYCOPG_DEFAULT_MXDATETIME
48 extern PyObject *psyco_Date(PyObject *module, PyObject *args);
49 #define psyco_Date_doc \
50 "Date(year, month, day) -> new date"
52 extern PyObject *psyco_Time(PyObject *module, PyObject *args);
53 #define psyco_Time_doc \
54 "Time(hour, minutes, seconds) -> new time"
56 extern PyObject *psyco_Timestamp(PyObject *module, PyObject *args);
57 #define psyco_Timestamp_doc \
58 "Time(year, month, day, hour, minutes, seconds) -> new timestamp"
60 extern PyObject *psyco_DateFromTicks(PyObject *module, PyObject *args);
61 #define psyco_DateFromTicks_doc \
62 "DateFromTicks(ticks) -> new date"
64 extern PyObject *psyco_TimeFromTicks(PyObject *module, PyObject *args);
65 #define psyco_TimeFromTicks_doc \
66 "TimeFromTicks(ticks) -> new time"
68 extern PyObject *psyco_TimestampFromTicks(PyObject *module, PyObject *args);
69 #define psyco_TimestampFromTicks_doc \
70 "TimestampFromTicks(ticks) -> new timestamp"
72 #endif /* PSYCOPG_DEFAULT_MXDATETIME */
74 extern PyObject *psyco_DateFromMx(PyObject *module, PyObject *args);
75 #define psyco_DateFromMx_doc \
76 "DateFromMx(mx) -> new date"
78 extern PyObject *psyco_TimeFromMx(PyObject *module, PyObject *args);
79 #define psyco_TimeFromMx_doc \
80 "TimeFromMx(mx) -> new time"
82 extern PyObject *psyco_TimestampFromMx(PyObject *module, PyObject *args);
83 #define psyco_TimestampFromMx_doc \
84 "TimestampFromMx(mx) -> new timestamp"
86 extern PyObject *psyco_IntervalFromMx(PyObject *module, PyObject *args);
87 #define psyco_IntervalFromMx_doc \
88 "IntervalFromMx(mx) -> new interval"
94 #endif /* !defined(PSYCOPG_MXDATETIME_H) */