File: common.h

package info (click to toggle)
libuser 1%3A0.56.9.dfsg.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,604 kB
  • ctags: 1,619
  • sloc: ansic: 15,970; sh: 10,210; xml: 2,060; python: 1,740; yacc: 782; makefile: 258; sed: 16
file content (55 lines) | stat: -rw-r--r-- 1,416 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef common_h
#define common_h

#include <Python.h>
#include "../lib/user.h"
#include "debug.h"

/* FIXME: remove this when dropping Python < 2.5 compatibility */
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
#endif

struct libuser_admin {
	PyObject_HEAD
	PyObject *prompt_data[2];
	struct lu_context *ctx;
};

struct libuser_entity {
	PyObject_HEAD
	struct lu_ent *ent;
};

struct libuser_prompt {
	PyObject_HEAD
	struct lu_prompt prompt;
};

static PyTypeObject EntityType;
static PyTypeObject AdminType;
static PyTypeObject PromptType;

static PyObject *libuser_admin_new(PyObject *self, PyObject *args,
				   PyObject *kwargs);

static gboolean libuser_admin_python_prompter(struct lu_prompt *prompts,
					      int count,
		                              gpointer callback_data,
					      struct lu_error **error);
static PyObject *libuser_admin_prompt_console(PyObject *self,
					      PyObject *args,
					      PyObject *kwargs);
static PyObject *libuser_admin_prompt_console_quiet(PyObject *self,
						    PyObject *args,
						    PyObject *kwargs);

static PyObject *convert_value_array_pylist(GValueArray *array);
static PyObject *libuser_prompt_new(PyObject *ignored_self, PyObject *ignore);

static PyObject *libuser_get_user_shells(PyObject *self, PyObject *ignored);
static PyObject *libuser_wrap_ent(struct lu_ent *ent);

void initlibuser(void);

#endif