ekg2
Strona główna
Dodatkowe strony
Moduły
Struktury Danych
Pliki
Lista plików
Globalne
All
Struktury Danych
Pliki
Funkcje
Zmienne
Definicje typów
Wyliczenia
Wartości wyliczeń
Definicje
Grupay
Strony
plugins
python
python-session.h
Idź do dokumentacji tego pliku.
1
/* $Id$ */
2
3
/*
4
* (C) Copyright 2004-2005 Leszek KrupiĹski <leafnode@pld-linux.org>
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 Version 2 as
8
* published by the Free Software Foundation.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
*/
19
20
#ifndef __PYTHON_SESSION_H_
21
22
#define __PYTHON_SESSION_H_
23
24
#include <Python.h>
25
26
typedef
struct
{
27
PyObject_HEAD
28
char
*
name
;
29
}
ekg_sessionObj
;
30
31
void
ekg_session_dealloc
(
ekg_sessionObj
* o);
32
PyObject *
ekg_session_repr
(
ekg_sessionObj
*
self
);
33
PyObject *
ekg_session_str
(
ekg_sessionObj
*
self
);
34
int
ekg_session_init
(
ekg_sessionObj
*
self
, PyObject *args, PyObject *kwds);
35
int
ekg_session_len
(
ekg_sessionObj
*
self
);
36
PyObject *
ekg_session_set
(
ekg_sessionObj
*
self
, PyObject * key, PyObject * value);
37
PyObject *
ekg_session_connected
(
ekg_sessionObj
*
self
);
38
PyObject *
ekg_session_get_attr
(
ekg_sessionObj
*
self
,
char
* attr);
39
PyObject *
ekg_session_user_get
(
ekg_sessionObj
*
self
, PyObject * pyargs);
40
PyObject *
ekg_session_users
(
ekg_sessionObj
*
self
);
41
PyObject *
ekg_session_get
(
ekg_sessionObj
*
self
, PyObject * key);
42
PyObject *
ekg_session_status_set
(
ekg_sessionObj
*
self
, PyObject * pyargs);
43
PyObject *
ekg_session_status
(
ekg_sessionObj
*
self
);
44
PyObject *
ekg_session_connect
(
ekg_sessionObj
*
self
);
45
PyObject *
ekg_session_disconnect
(
ekg_sessionObj
*
self
);
46
47
staticforward PyMethodDef
ekg_session_methods
[] = {
48
{
"connected"
, (PyCFunction)
ekg_session_connected
, METH_NOARGS,
"Check if session is connected"
},
49
{
"user_get"
, (PyCFunction)
ekg_session_user_get
, METH_VARARGS,
"Return user object"
},
50
{
"users"
, (PyCFunction)
ekg_session_users
, METH_NOARGS,
"Return userlist"
},
51
{
"status_set"
, (PyCFunction)
ekg_session_status_set
, METH_VARARGS,
"Set status for session"
},
52
{
"status"
, (PyCFunction)
ekg_session_status
, METH_NOARGS,
"Get status tuple for session"
},
53
{
"connect"
, (PyCFunction)
ekg_session_connect
, METH_NOARGS,
"Connect session"
},
54
{
"disconnect"
, (PyCFunction)
ekg_session_disconnect
, METH_NOARGS,
"Disconnect session"
},
55
{
NULL
,
NULL
, 0, NULL}
56
};
57
58
static
PyMappingMethods
ekg_session_mapping
= {
59
(inquiry)
ekg_session_len
,
60
(binaryfunc)
ekg_session_get
,
61
(objobjargproc)
ekg_session_set
62
};
63
64
static
PyTypeObject
ekg_session_type
= {
65
PyObject_HEAD_INIT(
NULL
)
66
0,
67
"session"
,
68
sizeof
(
ekg_sessionObj
),
69
0,
70
(destructor)
ekg_session_dealloc
,
71
0,
72
(getattrfunc)
ekg_session_get_attr
,
73
0,
74
0,
75
(reprfunc)
ekg_session_repr
,
76
0,
77
0,
78
&
ekg_session_mapping
,
79
0,
/*tp_hash */
80
0,
/*tp_call*/
81
(reprfunc)
ekg_session_str
,
/*tp_str*/
82
0,
/*tp_getattro*/
83
0,
/*tp_setattro*/
84
0,
/*tp_as_buffer*/
85
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
/*tp_flags*/
86
"Session object"
,
/* tp_doc */
87
0,
/* tp_traverse */
88
0,
/* tp_clear */
89
0,
/* tp_richcompare */
90
0,
/* tp_weaklistoffset */
91
0,
/* tp_iter */
92
0,
/* tp_iternext */
93
ekg_session_methods
,
/* tp_methods */
94
0,
/* tp_members */
95
0,
/* tp_getset */
96
0,
/* tp_base */
97
0,
/* tp_dict */
98
0,
/* tp_descr_get */
99
0,
/* tp_descr_set */
100
0,
/* tp_dictoffset */
101
(initproc)
ekg_session_init
,
/* tp_init */
102
0,
/* tp_alloc */
103
0,
/* tp_new */
104
};
105
106
#endif
107
108
/*
109
* Local Variables:
110
* mode: c
111
* c-file-style: "k&r"
112
* c-basic-offset: 8
113
* indent-tabs-mode: t
114
* End:
115
* vim: sts=8 sw=8
116
*/
Wygenerowano N, 7 lip 2013 09:24:28 dla ekg2 programem
1.8.4