libudev-list.c revision 1e78dcbe51419124846e1f35e540cb0253362231
/*
* libudev - interface to udev device information
*
* Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#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;
}