udev_config.c revision 2b41e68a08548ce44b4d145900dab2bb04cd34f7
/*
*
* 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.
*
*/
/* define this to enable parsing debugging */
/* #define DEBUG_PARSER */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include "libsysfs/sysfs/libsysfs.h"
#include "udev.h"
#include "udev_lib.h"
#include "udev_version.h"
#include "logging.h"
#include "namedev.h"
/* global variables */
char sysfs_path[SYSFS_PATH_MAX];
char default_mode_str[MODE_SIZE];
char default_owner_str[OWNER_SIZE];
char default_group_str[GROUP_SIZE];
int udev_log;
int udev_dev_d;
static int string_is_true(char *str)
{
return 1;
return 1;
return 1;
return 0;
}
static void init_variables(void)
{
char *env;
/* fill up the defaults.
* If any config values are specified, they will
* override these values. */
udev_dev_d = 1;
udev_dev_d = 0;
}
{
char *temp;
char *string = *orig_string;
if (!string)
return -ENODEV;
/* eat any whitespace */
++string;
/* split based on '=' */
if (!string)
return -ENODEV;
/* take the right side and strip off the '"' */
++string;
if (*string == '"')
++string;
else
return -ENODEV;
return -ENODEV;
*orig_string = string;
return 0;
}
static int parse_config_file(void)
{
char *bufline;
char *temp;
char *variable;
char *value;
char *buf;
int lineno;
int retval = 0;
} else {
return -ENODEV;
}
/* loop through the whole file */
lineno = 0;
cur = 0;
lineno++;
info("line too long, conf line skipped %s, line %d",
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)
info("%s:%d:%Zd: error parsing '%s'",
continue;
}
continue;
}
continue;
}
continue;
}
continue;
}
continue;
}
continue;
}
continue;
}
info("%s:%d:%Zd: unknown key '%s'",
}
return retval;
}
static void get_dirs(void)
{
char *temp;
int retval;
if (retval)
dbg("sysfs_get_mnt_path failed");
/* see if we should try to override any of the default values */
}
}
}
void udev_init_config(void)
{
get_dirs();
}