Imported Upstream version 0.2.0
[debian/lxdm.git] / src / lxdm.h
1 /*
2 * lxdm.h - interface of lxdm
3 *
4 * Copyright 2009 dgod <dgod.osa@gmail.com>
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 as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 */
21
22 #ifndef _LXDM_H_
23 #define _LXDM_H_
24
25 #include <glib.h>
26 #include <pwd.h>
27
28 G_BEGIN_DECLS
29
30 extern GKeyFile *config;
31
32 void log_print(char *fmt,...);
33 int lxdm_auth_user(char *user,char *pass,struct passwd **ppw);
34 void lxdm_do_login(struct passwd *pw,char *session,char *lang);
35 void lxdm_do_reboot(void);
36 void lxdm_do_shutdown(void);
37 int lxdm_cur_session(void);
38
39 enum AuthResult
40 {
41 AUTH_SUCCESS,
42 AUTH_BAD_USER,
43 AUTH_FAIL,
44 AUTH_PRIV,
45 AUTH_ERROR
46 };
47
48 void ui_drop(void);
49 int ui_main(void);
50 void ui_prepare(void);
51 int ui_do_login(void);
52 void ui_clean(void);
53
54 typedef struct{
55 char *name;
56 char *exec;
57 char* desktop_file;
58 }Session;
59
60 GSList *do_scan_xsessions(void);
61 void free_xsessions(GSList *);
62
63 G_END_DECLS
64
65 #endif/*_LXDM_H_*/