summaryrefslogtreecommitdiff
path: root/py/obj.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/obj.h')
-rw-r--r--py/obj.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/py/obj.h b/py/obj.h
index 611873d2e..6bcebcf6e 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -563,8 +563,16 @@ typedef struct _mp_obj_static_class_method_t {
const mp_obj_t *mp_obj_property_get(mp_obj_t self_in);
// sequence helpers
+
+// slice indexes resolved to particular sequence
+typedef struct {
+ machine_uint_t start;
+ machine_uint_t stop;
+ machine_int_t step;
+} mp_bound_slice_t;
+
void mp_seq_multiply(const void *items, uint item_sz, uint len, uint times, void *dest);
-bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_uint_t *begin, machine_uint_t *end);
+bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, mp_bound_slice_t *indexes);
#define mp_seq_copy(dest, src, len, item_t) memcpy(dest, src, len * sizeof(item_t))
#define mp_seq_cat(dest, src1, len1, src2, len2, item_t) { memcpy(dest, src1, (len1) * sizeof(item_t)); memcpy(dest + (len1), src2, (len2) * sizeof(item_t)); }
bool mp_seq_cmp_bytes(int op, const byte *data1, uint len1, const byte *data2, uint len2);