namedev_parse.c revision 882af735ec18cb4e6ba6f59ca60f8266cc96c330
/*
*
* Userspace devfs
*
* Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2003-2005 Kay Sievers <kay.sievers@vrfy.org>
*
*
* 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.
*
*/
#ifdef DEBUG
/* define this to enable parsing debugging also */
/* #define DEBUG_PARSER */
#endif
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <errno.h>
#include "udev_libc_wrapper.h"
#include "udev.h"
#include "udev_utils.h"
#include "logging.h"
#include "namedev.h"
{
struct config_device *tmp_dev;
return -ENOMEM;
//dump_config_dev(tmp_dev);
return 0;
}
{
dbg_parse("name='%s', symlink='%s', bus='%s', id='%s', "
"sysfs_file[0]='%s', sysfs_value[0]='%s', "
"kernel='%s', program='%s', result='%s'"
"owner='%s', group='%s', mode=%#o",
}
void dump_config_dev_list(void)
{
struct config_device *dev;
}
/* extract possible KEY{attr} */
static char *get_key_attribute(char *str)
{
char *pos;
char *attr;
attr++;
dbg("missing closing brace for format");
return NULL;
}
pos[0] = '\0';
return attr;
}
return NULL;
}
{
char *bufline;
int lineno;
char *temp;
char *temp2;
char *temp3;
char *attr;
char *buf;
int program_given = 0;
int valid;
int retval = 0;
struct config_device dev;
} else {
return -1;
}
/* loop through the whole file */
cur = 0;
lineno = 0;
unsigned int i, j;
lineno++;
continue;
}
/* eat the whitespace */
bufline++;
count--;
}
if (count == 0)
continue;
/* see if this is a comment */
if (bufline[0] == COMMENT_CHARACTER)
continue;
/* skip backslash and newline from multi line rules */
for (i = j = 0; i < count; i++) {
continue;
}
line[j] = '\0';
/* get all known keys */
valid = 0;
while (1) {
if (retval)
break;
valid = 1;
continue;
}
valid = 1;
continue;
}
valid = 1;
continue;
}
valid = 1;
continue;
}
int sysfs_pair_num = 0;
/* find first unused pair */
if (sysfs_pair_num >= MAX_SYSFS_PAIRS) {
break;
}
++pair;
}
if (pair) {
continue;
}
valid = 1;
}
continue;
}
valid = 1;
continue;
}
program_given = 1;
valid = 1;
continue;
}
valid = 1;
continue;
}
/* FIXME: remove old style options and make OPTIONS= mandatory */
dbg_parse("creation of partition nodes requested");
}
dbg_parse("remove event should be ignored");
}
}
if (temp3[0] != '\0')
else
valid = 1;
continue;
}
valid = 1;
continue;
}
valid = 1;
continue;
}
valid = 1;
continue;
}
valid = 1;
continue;
}
dbg_parse("device should be ignored");
}
dbg_parse("remove event should be ignored");
}
dbg_parse("creation of partition nodes requested");
}
valid = 1;
continue;
}
goto error;
}
/* skip line if not any valid key was found */
if (!valid)
goto error;
/* simple plausibility checks for given keys */
goto error;
}
FIELD_PROGRAM " is called in any rule before");
goto error;
}
if (retval) {
continue;
info("parse error %s, line %d:%d, rule skipped",
}
}
return retval;
}
int namedev_init(void)
{
int retval;
return -1;
else
return retval;
}
void namedev_close(void)
{
struct config_device *dev;
struct config_device *temp_dev;
}
}