PBXB64 includes a native C runtime container library (c_hlib) that is automatically initialized and finalized for PB variables. Container handles are stored as LONG values.
PBXB64 includes a native C runtime container library (c_hlib) that is automatically initialized and finalized for PB variables. Container handles are stored as LONG values.
Kind: Language feature | Category: H-Lib Native Containers
PBXB64 Status: AVAILABLE — 23 FAMILIES · 136 TYPE KEYWORDS
PBXB64 Certification: [CERTIFIED TESTED]
q.Push 5, n = q.Count (method-dispatch)a[1] = 100, n = h["key"] (subscript access)c_hlib_lnarr_add(q, 5) via pbxb64/hlib.h
| Family | PB Type | Description | Help page |
|---|---|---|---|
| 2D Array | LN2D (+ 12 variants) | Two-dimensional dynamic array with rows, columns, and rectangular operations. | 2D methods |
| Array | LNARR (+ 12 variants) | Dynamic array with push, pop, insert, delete, sort, indexed access, and UDT payload. | Arr methods |
| Bloom Filter | LNBLOOM | Probabilistic LONG membership test with no false negatives and tunable false-positive rate. | cmd_hlib_bloom |
| B+ Tree | LNBPTREE | Disk-friendly ordered set with high branching factor, range queries, and bulk operations. | cmd_hlib_bptree |
| Deque | LNDEQUE | Double-ended queue. Push and pop from either end in O(1) time. | cmd_hlib_deque |
| Double Tree | WSWSDTRE | Wide-string to wide-string double-ended tree. Bidirectional ordered key-value tree. | DTre methods |
| Graph | LNGRAPH | Undirected graph with LONG node IDs, adjacency queries, neighbor enumeration. | cmd_hlib_graph |
| Hash Table | LNLNHSH (+ 12 variants) | Key-value store with O(1) hash lookup, insertion, deletion, enumeration. | Hsh methods |
| Heap | LNHEAP | Binary min-heap / priority queue. O(log n) push and pop. | cmd_hlib_heap |
| Linked List | LNLST (+ 12 variants) | Doubly-linked list with node traversal, insert before/after, removal by node. | Lst methods |
| LRU Cache | LNLRU | Bounded LONG-key/LONG-value cache with least-recently-used eviction. | cmd_hlib_lru |
| Multiset | LNMULTISET | Bag of LONG keys with multiplicity counts. Allows duplicates with count tracking. | cmd_hlib_multiset |
| Quadtree | LNQUAD | Spatial index for LONG bounding boxes. Efficient 2D range and point queries. | cmd_hlib_quadtree |
| Queue | LNQUE (+ 12 variants) | FIFO queue with push, pop, peek, front, and back operations. | Que methods |
| Ring | LNRING | Fixed-capacity circular buffer. Overwrites oldest elements when full. | cmd_hlib_ring |
| Safe | LNSAFE | Thread-safe LONG stack wrapper with mutex-protected push and pop. | cmd_hlib_safe |
| Set | LNSET | Sorted unique set backed by AVL tree. O(log n) add, remove, and contains. | cmd_hlib_set |
| SkipList | LNSKIPLIST | Probabilistic ordered set with O(log n) average-case operations. | cmd_hlib_skiplist |
| Stack | LNSTK (+ 12 variants) | LIFO stack with push, pop, and peek operations. | Stk methods |
| String Builder | SSSTR, WSSTR | Mutable string builder with append, insert, delete, replace, character access. | Str methods |
| Tree | LNLNTRE (+ 12 variants) | Self-balancing AVL tree with ordered key-value storage, min/max, range traversal. | Tre methods |
| Trie | SSSSTRI | Prefix tree (trie) mapping ANSI strings to ANSI strings. Fast prefix lookup. | Tri methods |
| Union-Find | LNUNIONFIND | Disjoint-set / union-find structure. Near-constant-time union and find. | cmd_hlib_unionfind |
Typed families use the suffixes below. The complete set contains 136 recognized type keywords. EXTENDED and CURRENCYX are opaque high-precision values; they are not converted to or stored as ordinary DOUBLE values.
| Suffix | PB Type | Size | Suffix | PB Type | Size |
|---|---|---|---|---|---|
| Bt | BYTE | 1 byte | Sn | SINGLE | 4 bytes |
| In | INTEGER (WORD) | 2 bytes | Db | DOUBLE | 8 bytes |
| Wd | WORD (DWORD) | 2 bytes | Cu | CURRENCY | 8 bytes |
| Dw | DWORD | 4 bytes | Cx | CURRENCYX | 16 bytes |
| Ln | LONG | 4 bytes | Ex | EXTENDED | 10 bytes |
| Qd | QUAD | 8 bytes | Ss | STRING (ANSI) | pointer-sized |
| Ws | WSTRING (Unicode) | pointer-sized |
Arr: BTARR, INARR, WDARR, LNARR, DWARR, QDARR, SNARR, DBARR, CUARR, CXARR, EXARR, SSARR, WSARR, OJARR.
Stk: BTSTK, INSTK, WDSTK, LNSTK, DWSTK, QDSTK, SNSTK, DBSTK, CUSTK, CXSTK, EXSTK, SSSTK, WSSTK.
Que: BTQUE, INQUE, WDQUE, LNQUE, DWQUE, QDQUE, SNQUE, DBQUE, CUQUE, CXQUE, EXQUE, SSQUE, WSQUE.
Lst: BTLST, INLST, WDLST, LNLST, DWLST, QDLST, SNLST, DBLST, CULST, CXLST, EXLST, SSLST, WSLST, UTLST.
Str: SSSTR, WSSTR.
2D: BT2D, IN2D, WD2D, LN2D, DW2D, QD2D, SN2D, DB2D, CU2D, CX2D, EX2D, SS2D, WS2D.
Hsh: LNLNHSH, LNCUHSH, LNCXHSH, LNDBHSH, LNDWHSH, LNEXHSH, LNQDHSH, LNSSHSH, LNWSHSH, SSCUHSH, SSCXHSH, SSDBHSH, SSDWHSH, SSEXHSH, SSLNHSH, SSQDHSH, SSSSHSH, WSCUHSH, WSCXHSH, WSDBHSH, WSDWHSH, WSEXHSH, WSLNHSH, WSQDHSH, WSWSHSH, LNUTHSH.
Tre: LNLNTRE, LNCUTRE, LNCXTRE, LNDBTRE, LNDWTRE, LNEXTRE, LNQDTRE, LNSSTRE, LNWSTRE, SSCUTRE, SSCXTRE, SSDBTRE, SSDWTRE, SSEXTRE, SSLNTRE, SSQDTRE, SSSSTRE, WSCUTRE, WSCXTRE, WSDBTRE, WSDWTRE, WSEXTRE, WSLNTRE, WSQDTRE, WSWSTRE, LNUTTRE.
Specialized: WSWSDTRE, SSSSTRI, LNHEAP, LNDEQUE, LNSET, LNGRAPH, LNMULTISET, LNUNIONFIND, LNLRU, LNRING, LNSKIPLIST, LNBPTREE, LNQUAD, LNBLOOM, LNSAFE.
LOCAL c AS LNMULTISET.Final. Explicit New/Final calls remain available.lru.New(capacity), ring.New(capacity), bpt.New(order), quad.New(maxDepth), and bloom.New(capacity, errorRate).c.Add 5 or c.Add(5).Capacity, Trim, and Clone are available across all 23 families.LONG or QUAD; methods returning containers return a new handle.Container element type can be a user-defined PB TYPE:
TYPE Point
x AS LONG
y AS LONG
END TYPE
LOCAL a AS LNARR OF Point
LOCAL p AS Point
LOCAL q AS Point
a.New
p.x = 10 : p.y = 20
a.Push p
q = a.Get(1) ' q is a Point; PB indices are 1-based