Skip to content

add biseqblk, biseqcaselessblk, binsertblk, bjoinblk#143

Open
rdmark wants to merge 4 commits intomainfrom
biseqblk-etc
Open

add biseqblk, biseqcaselessblk, binsertblk, bjoinblk#143
rdmark wants to merge 4 commits intomainfrom
biseqblk-etc

Conversation

@rdmark
Copy link
Collaborator

@rdmark rdmark commented Feb 25, 2026

Port four block-oriented function variants from the parent project. These accept raw (void *, int len) pairs instead of bstring arguments, enabling use with non-bstring data and string literals via the new static convenience macros.

New functions:

  • biseqblk: compare bstring with a memory block for equality
  • biseqcaselessblk: case-insensitive variant of biseqblk
  • binsertblk: insert a memory block into a bstring at a position
  • bjoinblk: join a bstrList with a memory block separator

binsert and bjoin are refactored as thin wrappers around their blk counterparts. biseqcaseless is similarly refactored to delegate to biseqcaselessblk.

New Static macros added to bstrlib.h:

  • bcatStatic, bfromStatic, bassignStatic
  • binsertStatic, bjoinStatic
  • biseqStatic, bisstemeqStatic
  • biseqcaselessStatic, bisstemeqcaselessStatic

Novel unit tests added for all four new functions (core_047 through core_050). The rest of the changeset is adapted from code by Paul Hsieh.

@rdmark rdmark requested a review from msteinert as a code owner February 25, 2026 22:13
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

File Coverage Lines Branches
All files 69% 74% 63%
bstring/bstraux.c 55% 64% 46%
bstring/bstrlib.c 74% 78% 71%
bstring/buniutil.c 80% 86% 73%
bstring/utf8util.c 60% 71% 50%

Minimum allowed coverage is 50%

Generated by 🐒 cobertura-action against c04d64c

Port four block-oriented function variants from the parent project.
These accept raw (void *, int len) pairs instead of bstring arguments,
enabling use with non-bstring data and string literals via the new
static convenience macros.

New functions:
- biseqblk: compare bstring with a memory block for equality
- biseqcaselessblk: case-insensitive variant of biseqblk
- binsertblk: insert a memory block into a bstring at a position
- bjoinblk: join a bstrList with a memory block separator

binsert and bjoin are refactored as thin wrappers around their blk
counterparts. biseqcaseless is similarly refactored to delegate to
biseqcaselessblk.

New Static macros added to bstrlib.h:
- bcatStatic, bfromStatic, bassignStatic
- binsertStatic, bjoinStatic
- biseqStatic, bisstemeqStatic
- biseqcaselessStatic, bisstemeqcaselessStatic

Novel unit tests added for all four new functions (core_047 through
core_050). The rest of the changeset is adapted from code by Paul Hsieh.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant