source: proiecte/PPPP/gdm/gui/simple-greeter/test-sessions.c @ 134

Last change on this file since 134 was 134, checked in by (none), 14 years ago

gdm sources with the modifications for webcam

File size: 2.1 KB
Line 
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2008 Red Hat, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19
20#include "config.h"
21
22#include <stdlib.h>
23#include <libintl.h>
24#include <locale.h>
25#include <string.h>
26#include <unistd.h>
27#include <signal.h>
28#include <errno.h>
29
30#include <glib/gi18n.h>
31#include <gtk/gtk.h>
32
33#include "gdm-sessions.h"
34
35static void
36print_sessions (void)
37{
38        char **session_names;
39        int    i;
40
41        session_names = gdm_get_all_sessions ();
42
43        for (i = 0; session_names[i] != NULL; i++) {
44                gboolean res;
45                char    *name;
46                char    *comment;
47
48                res = gdm_get_details_for_session (session_names[i],
49                                                   &name,
50                                                   &comment);
51                if (! res) {
52                        continue;
53                }
54                g_print ("%s\t%s\t%s\n",
55                         session_names[i],
56                         name,
57                         comment);
58
59                g_free (name);
60                g_free (comment);
61        }
62
63        g_strfreev (session_names);
64}
65
66int
67main (int argc, char *argv[])
68{
69
70        bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
71        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
72        textdomain (GETTEXT_PACKAGE);
73
74        setlocale (LC_ALL, "");
75
76        gtk_init (&argc, &argv);
77
78        print_sessions ();
79
80        return 0;
81}
Note: See TracBrowser for help on using the repository browser.