~ubuntu-branches/ubuntu/hardy/psycopg2/hardy

« back to all changes in this revision

Viewing changes to psycopg/adapter_mxdatetime.h

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2006-08-09 10:28:30 UTC
  • Revision ID: james.westby@ubuntu.com-20060809102830-grac1dsp24uyqfp4
Tags: upstream-2.0.4
ImportĀ upstreamĀ versionĀ 2.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* adapter_mxdatetime.h - definition for the mx date/time types
 
2
 *
 
3
 * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
 
4
 *
 
5
 * This file is part of psycopg.
 
6
 *
 
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.
 
11
 *
 
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.
 
16
 *
 
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.
 
20
 */
 
21
 
 
22
#ifndef PSYCOPG_MXDATETIME_H
 
23
#define PSYCOPG_MXDATETIME_H 1
 
24
 
 
25
#include <Python.h>
 
26
 
 
27
#ifdef __cplusplus
 
28
extern "C" {
 
29
#endif
 
30
 
 
31
extern PyTypeObject mxdatetimeType;
 
32
 
 
33
typedef struct {
 
34
    PyObject HEAD;
 
35
 
 
36
    PyObject *wrapped;
 
37
    int       type;
 
38
#define       PSYCO_MXDATETIME_TIME       0
 
39
#define       PSYCO_MXDATETIME_DATE       1
 
40
#define       PSYCO_MXDATETIME_TIMESTAMP  2
 
41
#define       PSYCO_MXDATETIME_INTERVAL   3   
 
42
    
 
43
} mxdatetimeObject;
 
44
    
 
45
/* functions exported to psycopgmodule.c */
 
46
#ifdef PSYCOPG_DEFAULT_MXDATETIME
 
47
    
 
48
extern PyObject *psyco_Date(PyObject *module, PyObject *args);
 
49
#define psyco_Date_doc \
 
50
    "Date(year, month, day) -> new date"
 
51
 
 
52
extern PyObject *psyco_Time(PyObject *module, PyObject *args);
 
53
#define psyco_Time_doc \
 
54
    "Time(hour, minutes, seconds) -> new time"
 
55
 
 
56
extern PyObject *psyco_Timestamp(PyObject *module, PyObject *args);
 
57
#define psyco_Timestamp_doc \
 
58
    "Time(year, month, day, hour, minutes, seconds) -> new timestamp"
 
59
    
 
60
extern PyObject *psyco_DateFromTicks(PyObject *module, PyObject *args);
 
61
#define psyco_DateFromTicks_doc \
 
62
    "DateFromTicks(ticks) -> new date"
 
63
 
 
64
extern PyObject *psyco_TimeFromTicks(PyObject *module, PyObject *args);
 
65
#define psyco_TimeFromTicks_doc \
 
66
    "TimeFromTicks(ticks) -> new time"
 
67
 
 
68
extern PyObject *psyco_TimestampFromTicks(PyObject *module, PyObject *args);
 
69
#define psyco_TimestampFromTicks_doc \
 
70
    "TimestampFromTicks(ticks) -> new timestamp"
 
71
 
 
72
#endif /* PSYCOPG_DEFAULT_MXDATETIME */
 
73
 
 
74
extern PyObject *psyco_DateFromMx(PyObject *module, PyObject *args);
 
75
#define psyco_DateFromMx_doc \
 
76
    "DateFromMx(mx) -> new date"
 
77
 
 
78
extern PyObject *psyco_TimeFromMx(PyObject *module, PyObject *args);
 
79
#define psyco_TimeFromMx_doc \
 
80
    "TimeFromMx(mx) -> new time"
 
81
 
 
82
extern PyObject *psyco_TimestampFromMx(PyObject *module, PyObject *args);
 
83
#define psyco_TimestampFromMx_doc \
 
84
    "TimestampFromMx(mx) -> new timestamp"
 
85
 
 
86
extern PyObject *psyco_IntervalFromMx(PyObject *module, PyObject *args);
 
87
#define psyco_IntervalFromMx_doc \
 
88
    "IntervalFromMx(mx) -> new interval"
 
89
    
 
90
#ifdef __cplusplus
 
91
}
 
92
#endif
 
93
 
 
94
#endif /* !defined(PSYCOPG_MXDATETIME_H) */