udev_db.c revision 1cec1c241600fc11121f9504bc9e95836c03bd9c
/*
*
* Userspace devfs
*
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2004 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.
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include "libsysfs/sysfs/libsysfs.h"
#include "udev.h"
#include "udev_utils.h"
#include "logging.h"
#include "udev_db.h"
#define PATH_TO_NAME_CHAR '@'
{
char devpath[SYSFS_PATH_MAX];
char *pos;
/* replace '/' to transform path into a filename */
while (pos) {
pos[0] = PATH_TO_NAME_CHAR;
}
return 0;
}
{
char filename[SYSFS_PATH_MAX];
FILE *f;
return 0;
if (f == NULL) {
return -1;
}
fclose(f);
return 0;
}
{
char *bufline;
char *buf;
return -1;
}
cur = 0;
switch(bufline[0]) {
case 'P':
if (count > DEVPATH_SIZE)
break;
case 'N':
break;
case 'M':
break;
case 'S':
break;
case 'A':
break;
case 'R':
break;
}
}
return -1;
return 0;
}
{
char filename[SYSFS_PATH_MAX];
}
{
char filename[SYSFS_PATH_MAX];
return 0;
}
{
return -1;
}
while (1) {
break;
continue;
char *pos;
unsigned int len;
goto found;
}
continue;
goto found;
}
}
}
return -1;
return 0;
}