2015-05-20 13:26:53 -05:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-11-19 15:38:48 -06:00
|
|
|
struct ByteSlice {
|
|
|
|
uint8_t *data;
|
|
|
|
size_t len;
|
|
|
|
};
|
|
|
|
|
|
|
|
size_t slice_len(struct ByteSlice bs) {
|
|
|
|
return bs.len;
|
2015-05-20 13:26:53 -05:00
|
|
|
}
|
|
|
|
|
2017-11-19 15:38:48 -06:00
|
|
|
uint8_t slice_elem(struct ByteSlice bs, size_t idx) {
|
|
|
|
return bs.data[idx];
|
2015-05-20 13:26:53 -05:00
|
|
|
}
|