aboutsummaryrefslogtreecommitdiffstats
path: root/com32/chain/partiter.h
diff options
context:
space:
mode:
authorMichal Soltys <soltys@ziu.info>2010-09-12 21:33:05 +0200
committerMichal Soltys <soltys@ziu.info>2010-09-28 09:32:53 +0200
commit503409bba24d025b9832211a2ea648f4fb649ae0 (patch)
tree45401bd5c69aeb364796962099c99edf00b92e1c /com32/chain/partiter.h
parent63c8b04a33a452cfe181e1e590a6955a69527a6f (diff)
downloadsyslinux-503409bba24d025b9832211a2ea648f4fb649ae0.tar.gz
syslinux-503409bba24d025b9832211a2ea648f4fb649ae0.tar.xz
syslinux-503409bba24d025b9832211a2ea648f4fb649ae0.zip
com32/chain/partiter: make iterators not autofree after fin/err
This patch changes iterator behaviour to not free themselves automatically after finished iteration or error. This allows us to be able to always: - check their status through ->status field - access last valid data It will allow simplification of pentry_mangle() function in further commits. Signed-off-by: Michal Soltys <soltys@ziu.info>
Diffstat (limited to 'com32/chain/partiter.h')
-rw-r--r--com32/chain/partiter.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/com32/chain/partiter.h b/com32/chain/partiter.h
index 22397bd4..5e17a9a4 100644
--- a/com32/chain/partiter.h
+++ b/com32/chain/partiter.h
@@ -39,6 +39,11 @@
#include <stdint.h>
#include <syslinux/disk.h>
+#define PI_ERRLOAD 3
+#define PI_INSANE 2
+#define PI_DONE 1
+#define PI_OK 0
+
struct itertype;
struct part_iter;
@@ -59,6 +64,7 @@ struct part_iter {
int rawindex;
struct disk_info di;
int stepall;
+ int status;
/* internal */
int index0;
union _sub {
@@ -90,8 +96,8 @@ extern const struct itertype * const typeraw;
struct part_iter *pi_begin(const struct disk_info *, int stepall);
struct part_iter *pi_new(const struct itertype *, ...);
-void *pi_del(struct part_iter **);
-struct part_iter *pi_next(struct part_iter **);
+void pi_del(struct part_iter **);
+int pi_next(struct part_iter **);
#endif