#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <string.h>#include <getopt.h>#include <signal.h>#include <glib.h>#include <glib-object.h>#include <unistd.h>#include <wlancond-dbus.h>#include "dbus-helper.h"#include "daemon.h"#include "common.h"#include "dbus.h"#include "dbus-handler.h"#include "log.h"Include dependency graph for main.c:

Go to the source code of this file.
Defines | |
| #define | PIDFILE "/var/run/wlancond.pid" |
Functions | |
| static void | usage (int status) __attribute__((noreturn)) |
| static int | decode_switches (int argc, char *argv[]) |
| static void | clean_data (void) |
| static void | signal_exit (int sig) |
| static void | pid_cleanup (void) |
| int | main (int argc, char *argv[]) |
Variables | |
| static char * | program_name |
| static gboolean | daemon_mode = FALSE |
| static GMainLoop * | event_loop = NULL |
| static struct option const | long_options [] |
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Definition in file main.c.
| static int decode_switches | ( | int | argc, | |
| char * | argv[] | |||
| ) | [static] |
Process commandline options. Returns index of first non-option argument
Definition at line 88 of file main.c.
References daemon_mode, long_options, and usage().
Referenced by main().
Here is the call graph for this function:

| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Main function for this program. Initializes D-BUS and Wireless extensions
Definition at line 141 of file main.c.
References clean_data(), daemon_mode, decode_switches(), destroy_dbus_handlers(), DISCONNECTED_SIGNAL, event_loop, get_we_device_name(), init_dbus_handler(), init_dbus_handlers(), mode_change(), monitor_wi(), pid_cleanup(), PIDFILE, program_name, set_wlan_state(), and signal_exit().
Here is the call graph for this function:

| static void pid_cleanup | ( | void | ) | [static] |
| static void signal_exit | ( | int | sig | ) | [static] |
Exit signal handler
Definition at line 125 of file main.c.
References event_loop.
Referenced by main().
| static void usage | ( | int | status | ) | [static] |
Print usage information and exit with status
Definition at line 63 of file main.c.
References program_name.
Referenced by decode_switches().
struct option const long_options[] [static] |
Initial value:
{
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
{"daemon", no_argument, 0, 'd'},
{NULL, 0, NULL, 0}
}
Definition at line 53 of file main.c.
Referenced by decode_switches().
1.5.1