udev_config.c revision 18614ab25d4208749a3d85ced33acc6679c60fce
/*
*
* Userspace devfs
*
* Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
*
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*
* 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.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <syslog.h>
#include "libsysfs/sysfs/libsysfs.h"
#include "udev_libc_wrapper.h"
#include "udev.h"
#include "udev_utils.h"
#include "udev_version.h"
#include "logging.h"
/* global variables */
char sysfs_path[PATH_SIZE];
char udev_db_path[PATH_SIZE];
char udev_config_filename[PATH_SIZE];
char udev_rules_filename[PATH_SIZE];
int udev_log_priority;
int udev_dev_d;
int udev_hotplug_d;
static int string_is_true(const char *str)
{
return 1;
return 1;
return 1;
return 0;
}
static int log_priority(const char *priority)
{
char *endptr;
int prio;
if (endptr[0] == '\0')
return prio;
return LOG_ERR;
return LOG_INFO;
return LOG_DEBUG;
if (string_is_true(priority))
return LOG_ERR;
return 0;
}
{
char *linepos;
char *temp;
if (!linepos)
return -1;
/* skip whitespace */
linepos++;
/* get the key */
while (1) {
linepos++;
if (linepos[0] == '\0')
return -1;
break;
if (linepos[0] == '=')
break;
}
/* terminate key */
linepos[0] = '\0';
linepos++;
/* skip whitespace */
linepos++;
/* get the value*/
if (linepos[0] == '"')
linepos++;
else
return -1;
if (!temp)
return -1;
temp[0] = '\0';
return 0;
}
static int parse_config_file(void)
{
char *bufline;
char *linepos;
char *variable;
char *value;
char *buf;
int lineno;
int retval = 0;
return -ENODEV;
}
/* loop through the whole file */
lineno = 0;
cur = 0;
lineno++;
continue;
}
/* eat the whitespace */
bufline++;
count--;
}
if (count == 0)
continue;
/* see if this is a comment */
if (bufline[0] == COMMENT_CHARACTER)
continue;
if (retval != 0) {
continue;
}
continue;
}
continue;
}
continue;
}
continue;
}
}
return retval;
}
void udev_init_config(void)
{
const char *env;
udev_dev_d = 1;
udev_hotplug_d = 1;
udev_dev_d = 0;
udev_hotplug_d = 0;
if (env) {
}
if (env)
}