main.c File Reference

#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 []


Detailed Description

Copyright (C) 2004 Nokia Corporation. All rights reserved.

Author:
Janne Ylälehto <janne.ylalehto@nokia.com>
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.


Function Documentation

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 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 decode_switches(), destroy_dbus_handlers(), get_we_device_name(), init_dbus_handler(), init_dbus_handlers(), mode_change(), monitor_wi(), pid_cleanup(), set_wlan_state(), and signal_exit().

Here is the call graph for this function:

static void pid_cleanup ( void   )  [static]

Clean PID

Definition at line 133 of file main.c.

Referenced by main().

static void signal_exit ( int  sig  )  [static]

Exit signal handler

Definition at line 125 of file main.c.

Referenced by main().

static void usage ( int  status  )  [static]

Print usage information and exit with status

Definition at line 63 of file main.c.

Referenced by decode_switches().


Variable Documentation

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.


Generated on Thu Jun 25 11:44:28 2009 for WLAN Connection Daemon by  doxygen 1.5.6