Home › Data Types › H-Lib Native Containers PBXB64 Compiler Help

H-Lib Native Containers

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.

Chapter: H-Lib Native Containers | Certification: [CERTIFIED TESTED]

Description

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]

Three ways to use them:
· PB syntax: q.Push 5, n = q.Count (method-dispatch)
· PB subscript: a[1] = 100, n = h["key"] (subscript access)
· C frontend: c_hlib_lnarr_add(q, 5) via pbxb64/hlib.h

Supported Container Families (alphabetical, 23 total)

FamilyPB TypeDescriptionHelp page
2D ArrayLN2D (+ 12 variants)Two-dimensional dynamic array with rows, columns, and rectangular operations.2D methods
ArrayLNARR (+ 12 variants)Dynamic array with push, pop, insert, delete, sort, indexed access, and UDT payload.Arr methods
Bloom FilterLNBLOOMProbabilistic LONG membership test with no false negatives and tunable false-positive rate.cmd_hlib_bloom
B+ TreeLNBPTREEDisk-friendly ordered set with high branching factor, range queries, and bulk operations.cmd_hlib_bptree
DequeLNDEQUEDouble-ended queue. Push and pop from either end in O(1) time.cmd_hlib_deque
Double TreeWSWSDTREWide-string to wide-string double-ended tree. Bidirectional ordered key-value tree.DTre methods
GraphLNGRAPHUndirected graph with LONG node IDs, adjacency queries, neighbor enumeration.cmd_hlib_graph
Hash TableLNLNHSH (+ 12 variants)Key-value store with O(1) hash lookup, insertion, deletion, enumeration.Hsh methods
HeapLNHEAPBinary min-heap / priority queue. O(log n) push and pop.cmd_hlib_heap
Linked ListLNLST (+ 12 variants)Doubly-linked list with node traversal, insert before/after, removal by node.Lst methods
LRU CacheLNLRUBounded LONG-key/LONG-value cache with least-recently-used eviction.cmd_hlib_lru
MultisetLNMULTISETBag of LONG keys with multiplicity counts. Allows duplicates with count tracking.cmd_hlib_multiset
QuadtreeLNQUADSpatial index for LONG bounding boxes. Efficient 2D range and point queries.cmd_hlib_quadtree
QueueLNQUE (+ 12 variants)FIFO queue with push, pop, peek, front, and back operations.Que methods
RingLNRINGFixed-capacity circular buffer. Overwrites oldest elements when full.cmd_hlib_ring
SafeLNSAFEThread-safe LONG stack wrapper with mutex-protected push and pop.cmd_hlib_safe
SetLNSETSorted unique set backed by AVL tree. O(log n) add, remove, and contains.cmd_hlib_set
SkipListLNSKIPLISTProbabilistic ordered set with O(log n) average-case operations.cmd_hlib_skiplist
StackLNSTK (+ 12 variants)LIFO stack with push, pop, and peek operations.Stk methods
String BuilderSSSTR, WSSTRMutable string builder with append, insert, delete, replace, character access.Str methods
TreeLNLNTRE (+ 12 variants)Self-balancing AVL tree with ordered key-value storage, min/max, range traversal.Tre methods
TrieSSSSTRIPrefix tree (trie) mapping ANSI strings to ANSI strings. Fast prefix lookup.Tri methods
Union-FindLNUNIONFINDDisjoint-set / union-find structure. Near-constant-time union and find.cmd_hlib_unionfind

Type Variants (13 per family where applicable)

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.

SuffixPB TypeSizeSuffixPB TypeSize
BtBYTE1 byteSnSINGLE4 bytes
InINTEGER (WORD)2 bytesDbDOUBLE8 bytes
WdWORD (DWORD)2 bytesCuCURRENCY8 bytes
DwDWORD4 bytesCxCURRENCYX16 bytes
LnLONG4 bytesExEXTENDED10 bytes
QdQUAD8 bytesSsSTRING (ANSI)pointer-sized
WsWSTRING (Unicode)pointer-sized

Exact typed variants

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.

Common Conventions

UDT Payload Containers

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

See also