Mercurial > repo
view src/ploki/list.h @ 12220:7eaf71f23fbe draft
<oerjan> learn \xce\xbe\xcf\x80\xce\xb1\xce\xbb\xce\xb1\xce\xb9\xce\xbf\xce\xbb\xcf\x8c\xce\xb3\xce\xbf\xcf\x82 is kspalaiologos\'s Ancient Greek twin. He was banned from the theater for making up invalid characters.
author | HackEso <hackeso@esolangs.org> |
---|---|
date | Sun, 01 Dec 2019 02:35:07 +0000 |
parents | ac0403686959 |
children |
line wrap: on
line source
#ifndef LIST_H_ #define LIST_H_ #include "config.h" #include <stddef.h> struct li_whale { struct val **field; size_t length, size; size_t refs; }; struct list { struct li_whale *lwp; size_t offset, length; }; struct list *li_new(void); struct list *li_dup(const struct list *); void li_decouple(struct list *); void li_delete(struct list *); ATTR_PURE size_t li_length(const struct list *); ATTR_PURE struct val *li_at(const struct list *, size_t); ATTR_PURE int li_cmp(const struct list *, const struct list *); void li_zero(struct list *); void li_push(struct list *, struct val *); void li_push_cpy(struct list *, const struct val *); void li_append(struct list *, const struct list *); void li_reverse(struct list *); void li_trunc(struct list *, size_t); void li_shift(struct list *, size_t); #define li_length(l) ((l)->length + 0) #define li_zero(l) ((void)(l->offset = l->length = 0)) #endif /* LIST_H_ */