libudev-list.c revision 48a9b173e88738ff4eefb3519f1d27711b417c8d
/*
* libudev - interface to udev device information
*
* Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include "libudev.h"
#include "libudev-private.h"
struct udev_list_entry {
struct udev_list_node node;
struct udev_list_node *list;
char *name;
char *value;
int flag;
};
/* list head point to itself if empty */
{
}
{
}
struct udev_list_node *prev,
struct udev_list_node *next)
{
}
{
}
{
}
/* return list entry which embeds this node */
{
char *list;
return (struct udev_list_entry *)list;
}
/* insert entry into a list as the last element */
{
/* inserting before the list head make the node the last node in the list */
}
/* remove entry from a list */
{
}
/* insert entry into a list, before a given existing entry */
{
}
{
struct udev_list_entry *entry_new;
if (unique)
return entry_loop;
}
return NULL;
return entry_loop;
}
}
if (sort)
break;
}
return NULL;
return NULL;
}
return NULL;
}
}
if (entry_loop != NULL)
else
return entry_new;
}
{
}
{
struct udev_list_entry *entry_loop;
struct udev_list_entry *entry_tmp;
}
{
if (udev_list_is_empty(list))
return NULL;
}
{
struct udev_list_node *next;
if (list_entry == NULL)
return NULL;
/* empty list or no more entries */
return NULL;
return list_node_to_entry(next);
}
struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name)
{
struct udev_list_entry *entry;
return entry;
}
}
return NULL;
}
{
if (list_entry == NULL)
return NULL;
return list_entry->name;
}
{
if (list_entry == NULL)
return NULL;
return list_entry->value;
}
{
if (list_entry == NULL)
return -EINVAL;
return list_entry->flag;
}
{
if (list_entry == NULL)
return;
}