From 741a93498d96d55d0670eb000b34dffa7e892877 Mon Sep 17 00:00:00 2001 From: Alexander Sieg Date: Mon, 6 Apr 2020 22:00:32 +0200 Subject: [PATCH] tllist 1.0.0 --- devel/tllist/Makefile | 21 +++++++++++++++++++++ devel/tllist/distinfo | 3 +++ devel/tllist/pkg-descr | 24 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 devel/tllist/Makefile create mode 100644 devel/tllist/distinfo create mode 100644 devel/tllist/pkg-descr diff --git a/devel/tllist/Makefile b/devel/tllist/Makefile new file mode 100644 index 0000000..b0626b8 --- /dev/null +++ b/devel/tllist/Makefile @@ -0,0 +1,21 @@ +# $FreeBSD$ + +PORTNAME= tllist +DISTVERSION= 1.0.0 +CATEGORIES= devel +MASTER_SITES= https://codeberg.org/dnkl/tllist/archive/ +DISTNAME= ${DISTVERSION} + +MAINTAINER= ports@xanderio.de +COMMENT= C header file only implementation of a typed linked list + +LICENSE= MIT + +USES= meson + +WRKSRC= ${WRKDIR}/${PORTNAME} + +PLIST_FILES= include/tllist.h \ + libdata/pkgconfig/tllist.pc + +.include diff --git a/devel/tllist/distinfo b/devel/tllist/distinfo new file mode 100644 index 0000000..2725c50 --- /dev/null +++ b/devel/tllist/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1586201195 +SHA256 (1.0.0.tar.gz) = 115f067f6b7029959fea39e45ec64697806e901fe4ca2de67c7eb2af4b7d2ae2 +SIZE (1.0.0.tar.gz) = 6677 diff --git a/devel/tllist/pkg-descr b/devel/tllist/pkg-descr new file mode 100644 index 0000000..27d4651 --- /dev/null +++ b/devel/tllist/pkg-descr @@ -0,0 +1,24 @@ +Most C implementations of linked list are untyped. That is, their data carriers +are typically void *. This is error prone since your compiler will not be able +to help you correct your mistakes (oh, was it a pointer-to-a-pointer... I +thought it was just a pointer...). + +tllist addresses this by using pre-processor macros to implement dynamic types, +where the data carrier is typed to whatever you want; both primitive data types +are supported as well as aggregated ones such as structs, enums and unions. + +Being a double-linked list, most operations are constant in time (including +pushing and popping both to/from front and back). + +The memory overhead is fairly small; each item carries, besides its data, a +prev and next pointer (i.e. a constant 16 byte overhead per item on 64-bit +architectures). + +The list itself has two head and tail pointers, plus a length variable +(typically 8 bytes on 64-bit architectures) to make list length lookup constant +in time. + +Thus, assuming 64-bit pointers (and a 64-bit size_t type), the total overhead +is 3*8 + n*2*8 bytes. + +WWW: https://codeberg.org/dnkl/tllist -- 2.25.2