Skip to content

kaan-yalcinkaya/MBString

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Multibyte String Manipulation Library

This library provides a set of functions for manipulating multibyte strings in C. It includes functions for calculating string lengths, comparing strings, copying and concatenating strings, and searching for characters within strings.

Table of Contents

Installation

  1. git clone https://github.com/kaan-yalcinkaya/MBString
  2. cd MBString
  3. cmake -B build -D CMAKE_BUILD_TYPE=Release
  4. cmake --build build

Usage

Include the multibyte_string.h header file in your source code:
#include "multibyte_string.h"
You can then use the provided functions to manipulate multibyte strings in your application.

Functions

size_t mbslen(const char* mbs)
Calculates the length of a multibyte string.

size_t mbsnlen(const char* mbs, size_t n)
Calculates the length of a multibyte string up to a specified limit.

int mbsncmp(char* mbs1, char* mbs2, size_t n)
Compares two multibyte strings up to a specified number of characters.

char* mbsncpy(char* dest, size_t cbDest, const char* src, size_t n)
Copies up to a specified number of characters from one multibyte string to another.

char* mbsncat(char* dest, size_t cbDest, const char* src, size_t n)
Concatenates up to a specified number of characters from one multibyte string to another.

char* mbschr16(char* mbs, char16_t c)
Locates the first occurrence of a 16-bit character in a multibyte string.

char* mbschr32(char* mbs, char32_t c)
Locates the first occurrence of a 32-bit character in a multibyte string.

char* mbsrchr16(char* mbs, char16_t c)
Locates the last occurrence of a 16-bit character in a multibyte string.

char* mbsrchr32(char* mbs, char32_t c)
Locates the last occurrence of a 32-bit character in a multibyte string.

char* mbspbrk(char* mbs1, char* mbs2)
Locates the first occurrence in a multibyte string of any of the characters in another string.

size_t mbsspn(char* mbs1, char* mbs2)
Calculates the length of the initial segment of a multibyte string consisting of characters not in another string.

About

MBString is a multibyte string library written in C.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published