/*
* Copyright (C) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
- * Copyright (C) 2004-2006 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2004-2008 Kay Sievers <kay.sievers@vrfy.org>
*
- * This program is free software; you can redistribute it and/or modify it
- * 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.
+ * This program is free software: you can redistribute it and/or modify
+ * 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/>.
*/
#ifndef UDEV_RULES_H
#define UDEV_RULES_H
#include "udev.h"
-#include "list.h"
#define PAIRS_MAX 5
struct key wait_for;
struct key label;
struct key goto_label;
+ size_t goto_rule_off;
struct key name;
struct key symlink;
};
struct udev_rules {
+ struct udev *udev;
char *buf;
size_t bufsize;
- size_t current;
int resolve_names;
};
-extern int udev_rules_init(struct udev_rules *rules, int resolve_names);
+struct udev_rules_iter {
+ struct udev_rules *rules;
+ size_t current;
+};
+
+extern int udev_rules_init(struct udev *udev, struct udev_rules *rules, int resolve_names);
extern void udev_rules_cleanup(struct udev_rules *rules);
-extern void udev_rules_iter_init(struct udev_rules *rules);
-extern struct udev_rule *udev_rules_iter_next(struct udev_rules *rules);
-extern struct udev_rule *udev_rules_iter_label(struct udev_rules *rules, const char *label);
+extern void udev_rules_iter_init(struct udev_rules_iter *iter, struct udev_rules *rules);
+extern struct udev_rule *udev_rules_iter_next(struct udev_rules_iter *iter);
+extern struct udev_rule *udev_rules_iter_goto(struct udev_rules_iter *iter, size_t rule_off);
extern int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev);
extern int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev);