*/
/* This file is ALSO:
+ * Copyright 2022 René Ferdinand Rivera Morell
* Copyright 2001-2004 David Abrahams.
* Distributed under the Boost Software License, Version 1.0.
- * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+ * (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
*/
/*
* LIST - list of strings
*/
-typedef struct _list {
+struct LIST {
union {
- int size;
- struct _list * next;
+ int32_t size;
+ struct LIST * next;
OBJECT * align;
} impl;
-} LIST;
+ LIST()
+ {
+ this->impl.next = nullptr;
+ }
+};
+
+typedef LIST * list_ptr;
typedef OBJECT * * LISTITER;
/*
#define LOL_MAX 19
typedef struct _lol {
- int count;
+ int32_t count;
LIST * list[ LOL_MAX ];
} LOL;
void list_free( LIST * head );
LIST * list_push_back( LIST * head, OBJECT * value );
void list_print( LIST * );
-int list_length( LIST * );
-LIST * list_sublist( LIST *, int start, int count );
+int32_t list_length( LIST * );
+LIST * list_sublist( LIST *, int32_t start, int32_t count );
LIST * list_pop_front( LIST * );
LIST * list_sort( LIST * );
LIST * list_unique( LIST * sorted_list );
-int list_in( LIST *, OBJECT * value );
+int32_t list_in( LIST *, OBJECT * value );
LIST * list_reverse( LIST * );
-int list_cmp( LIST * lhs, LIST * rhs );
-int list_is_sublist( LIST * sub, LIST * l );
+int32_t list_cmp( LIST * lhs, LIST * rhs );
+int32_t list_is_sublist( LIST * sub, LIST * l );
void list_done();
LISTITER list_begin( LIST * );
inline iterator begin() { return iterator(list_begin(list_obj)); }
inline iterator end() { return iterator(list_end(list_obj)); }
inline bool empty() const { return list_empty(list_obj) || length() == 0; }
- inline int length() const { return list_length(list_obj); }
+ inline int32_t length() const { return list_length(list_obj); }
inline list &append(const list &other)
{
list_obj = list_append(list_obj, list_copy(other.list_obj));