str.h(3)

📦
version 2.2.0 · 2 versions
, in fedora 44

✨ NAME ✨

str.h — Строки (aka strings, bestie 💖)


🦋 SYNOPSIS 🦋

#include 'bee2/defs.h'

🌸 Макросы (the macros, ok)

#define strIsNullOrValid(str)

Нулевая или корректная строка? — is it a null string or a valid one? 👀

#define strEq(str1,  str2)

💅 Функции (the actual functions, periodt)

size_t strLen (const char *str)

Длина строки — how long is it 📏

bool_t strIsValid (const char *str)

Корректная строка? — is this string valid? ✅

void strCopy (char *dest, const char *src)

Копирование строки — copy that string 🫶

int strCmp (const char *str1, const char *str2)

Сравнение строк — compare two strings ⚖️

void strSet (char *str, char ch)

Заполнение символом — fill it up with a character 🎀

bool_t strIsNumeric (const char *str)

Цифровая? — is it all digits? 🔢

bool_t strIsAlphanumeric (const char *str)

Буквенно-цифовая? — letters AND digits? 🔤

bool_t strIsPrintable (const char *str)

Из печатаемых символов? — is it printable? 🖨️

bool_t strContains (const char *str, char ch)

Содержит? — does it contain it? 🔍

bool_t strStartsWith (const char *str, const char *prefix)

Начинается? — does it start with it? 🚀

bool_t strEndsWith (const char *str, const char *suffix)

Заканчивается? — does it end with it? 🏁

void strRev (char *str)

Разворот строки — flip it around 🔄


💖 Подробное описание 💖

Реализованы или переопределены операции над строками. — So basically, string operations are implemented or redefined here. A string is literally just a sequence of octet characters with a terminating null octet at the end. That's it, that's the whole vibe. ✨

Предусловие (precondition, don't skip this bestie):

  • Во все функции, кроме strIsValid(), передаются корректные строки. — Every single function except strIsValid() gets valid strings handed to it. No exceptions. 💅

Предупреждения (warnings, read them 😭):

  • Строка str = 0 (нулевой указатель) не считается корректной. — A string that's str = 0 (a null pointer) is not considered valid. Like, at all. 🙈

🎀 Макросы 🎀

#define strEq( str1, str2)

Макроопределение (the macro definition, copy it exactly bestie):

(strCmp(str1, str2) == 0)

Проверяется совпадение строк str1 и str2. — It checks whether str1 and str2 match each other. 💞

Возвращает (returns):

  • Признак совпадения. — The match flag.

Регулярность (regularity):

  • Функция нерегулярна. — This function is irregular, no cap.

👑 Функции 👑

int strCmp (const char * str1, const char * str2)

Строки str1 и str2 сравниваются лексикографически. — str1 and str2 get compared lexicographically, like a dictionary, alphabetically, you know the drill. 📚

Возвращает (returns):

  • 1, если str1 > str2, или -1, если str1 < str2, или 0, если str1 == str2. — So: 1 if str1 > str2, -1 if str1 < str2, and 0 if str1 == str2. Three moods, pick one. 💀

Регулярность (regularity):

  • Функция нерегулярна. — Irregular function.

Аргументы (args):

  • str1 — первая строка (first string)
  • str2 — вторая строка (second string)

bool_t strContains (const char * str, char ch)

Проверяется, что строка str содержит символ ch. — Checks that the string str contains the character ch. 🕵️

Возвращает (returns):

  • Признак успеха. — Success flag.

Регулярность (regularity):

  • Функция нерегулярна. — Irregular.

Прим. (note, important!!):

  • Считается, что строка обязательно содержит ch = '\0'. — It's assumed the string definitely contains ch = '\0'. So that one's a given, fr fr.

Аргументы (args):

  • str — строка (string)
  • ch — символ (character)

void strCopy (char * dest, const char * src)

Строка src копируется в dest. — src gets copied into dest, simple as that. 📋

Предусловие (precondition — do NOT ignore):

  • По адресу dest зарезервировано strLen(src) + 1 октетов. — At address dest, strLen(src) + 1 octets must already be reserved. Do the math first bestie. 🧮
  • Буферы src и dest не пересекаются. — The buffers src and dest do not overlap. They are not the same vibe, they do not touch. 🚫

Аргументы (args):

  • dest — строка-назначение (destination string)
  • src — строка-источник (source string)

bool_t strEndsWith (const char * str, const char * suffix)

Проверяется, что строка str заканчивается суффиксом suffix. — Checks that str ends with the suffix suffix. 🏁

Возвращает (returns):

  • Признак успеха. — Success flag.

Регулярность (regularity):

  • Функция нерегулярна. — Irregular.

Аргументы (args):

  • str — строка (string)
  • suffix — суффикс (suffix)

bool_t strIsAlphanumeric (const char * str)

Проверяется, что строка str состоит только из символов-цифр '0'-'9' и символов букв 'A'-'Z', 'a'-'z'. — Checks that str is made up only of digit characters '0'-'9' and letter characters 'A'-'Z', 'a'-'z'. Nothing else allowed, sorry. 🔤

Возвращает (returns):

  • Признак успеха. — Success flag.

Регулярность (regularity):

  • Функция нерегулярна. — Irregular.

Аргументы (args):

  • str — строка (string)

bool_t strIsNumeric (const char * str)

Проверяется, что строка str состоит только из символов-цифр '0'-'9'. — Checks that str is made up only of digit characters '0'-'9'. Numbers only, no letters crashing the party. 🔢

Возвращает (returns):

  • Признак успеха. — Success flag.

Регулярность (regularity):

  • Функция нерегулярна. — Irregular.

Аргументы (args):

  • str — строка (string)

bool_t strIsPrintable (const char * str)

Проверяется, что каждый символ строки str принадлежит алфавиту, составленному из латинских букв, цифр и символов строки " '()+,-./:=?". — Checks that every single character of str belongs to the alphabet built from Latin letters, digits, and the characters of the string " '()+,-./:=?". Very specific guest list, ok. 🖨️

Возвращает (returns):

  • Признак успеха. — Success flag.

Регулярность (regularity):

  • Функция нерегулярна. — Irregular.

Прим. (note):

  • Целевой алфавит -- это алфавит PrintableString АСН.1. — The target alphabet is the PrintableString alphabet from ASN.1. Iykyk. 🧚

Аргументы (args):

  • str — строка (string)

bool_t strIsValid (const char * str)

Проверяется, что строка str корректна. — Checks that the string str is valid. The one function that doesn't demand a valid string up front, remember? ✨

Возвращает (returns):

  • Признак успеха. — Success flag.

Аргументы (args):

  • str — строка (string)

size_t strLen (const char * str)

Определяется длина строки str -- число символов до завершающего нулевого. — Figures out the length of str, aka the number of characters before the terminating null. Count carefully. 📏

Возвращает (returns):

  • Длина строки — the string's length.

void strRev (char * str)

Символы строки str переписываются в обратном порядке. — The characters of str get rewritten in reverse order. Flip it, reverse it, slay. 🔄

Аргументы (args):

  • str — строка (string)

void strSet (char * str, char ch)

Строка str заполняется символом ch. — The string str gets filled up with the character ch. 🌊

Аргументы (args):

  • str — строка (string)
  • ch — символ (character)

bool_t strStartsWith (const char * str, const char * prefix)

Проверяется, что строка str начинается с префикca prefix. — Checks that str starts with the prefix prefix. Note the original even spells it префикca, iconic typo energy, we keep it as-is, no editing bestie. 🚀

Возвращает (returns):

  • Признак успеха. — Success flag.

Регулярность (regularity):

  • Функция нерегулярна. — Irregular.

Аргументы (args):

  • str — строка (string)
  • prefix — префикс (prefix)

💜 Автор 💜

Автоматически создано Doxygen для Библиотека Bee2 из исходного текста. — Automatically generated by Doxygen for the Bee2 Library straight from the source text. Not me hand-writing this, Doxygen did all the work and honestly? It ate. 💅


Okay so that's the whole page, and before you go — the footer energy: this is Библиотека Bee2 (the Bee2 Library), dated Вс 25 Янв 2026 00:00:00 (Sun 25 Jan 2026 00:00:00), and you're reading the str.h(3) manual. Go forth and manipulate some strings, bestie 🫶🦋✨

📦 where this page comes from