udev_config.c revision 726687ad48bdececed1e7e44387c50e009e28208
/*
* Copyright (C) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2004-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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 "udev.h"
/* global variables */
char udev_config_filename[PATH_SIZE];
char udev_rules_dir[PATH_SIZE];
int udev_log_priority;
int udev_run;
{
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++;
/* eat the whitespace */
bufline++;
count--;
}
if (count == 0)
continue;
/* see if this is a comment */
if (bufline[0] == COMMENT_CHARACTER)
continue;
continue;
}
if (retval != 0) {
continue;
}
continue;
}
continue;
}
continue;
}
}
return retval;
}
void udev_config_init(void)
{
const char *env;
udev_rules_dir[0] = '\0';
udev_run = 1;
/* disable RUN key execution */
udev_run = 0;
if (env) {
}
if (env) {
}
if (env)
}