pntr
Image manipulation library
String Manipulation

Macros

#define PNTR_STRSTR   strstr
 
#define PNTR_STRCHR   strchr
 
#define PNTR_STRLEN   strlen
 
#define PNTR_STRSIZE(text)   ((PNTR_STRLEN(text) + (size_t)1))
 
#define PNTR_STRCODEPOINT   pntr_strcodepoint
 

Typedefs

typedef char pntr_codepoint_t
 

Detailed Description

Macro Definition Documentation

◆ PNTR_STRCHR

#define PNTR_STRCHR   strchr

Returns a pointer to the first occurance of a character in a string.

By default, will use string.h's strchr. When PNTR_ENABLE_UTF8 is enabled, will be utf8chr.

See also
PNTR_ENABLE_UTF8

◆ PNTR_STRCODEPOINT

#define PNTR_STRCODEPOINT   pntr_strcodepoint

Sets out_codepoint to the current utf8 codepoint in str, and returns the address of the next utf8 codepoint after the current one in str.

When PNTR_ENABLE_UTF8 is enabled, will be utf8codepoint.

See also
PNTR_ENABLE_UTF8
pntr_strcodepoint

◆ PNTR_STRLEN

#define PNTR_STRLEN   strlen

Returns the length of a string.

By default, will use string.h's strlen. When PNTR_ENABLE_UTF8 is enabled, will be utf8len.

See also
PNTR_ENABLE_UTF8

◆ PNTR_STRSIZE

#define PNTR_STRSIZE (   text)    ((PNTR_STRLEN(text) + (size_t)1))

Calculates the amount of bytes in a string, including the null character.

By default, will use string.h's strlen(text) + 1. When PNTR_ENABLE_UTF8 is enabled, this will be utf8size.

See also
PNTR_ENABLE_UTF8

◆ PNTR_STRSTR

#define PNTR_STRSTR   strstr

Returns a pointer to the first occurrence of str2 in str1, or a null pointer if str2 is not part of str1.

By default, will use string.h's strstr. When PNTR_ENABLE_UTF8 is enabled, will be utf8str.

Parameters
str1(const char*) C string to be scanned.
str2(const char*) containing the sequence of characters to match.
Returns
A pointer to the first occurrence in str1 of the entire sequence of characters specified in str2, or a null pointer if the sequence is not present in str1.
See also
PNTR_ENABLE_UTF8

Typedef Documentation

◆ pntr_codepoint_t

typedef char pntr_codepoint_t

A type representing a single character or UTF-8 codepoint.

With UTF-8, a single character can be up to 4 bytes, so having this type define that helps determine its size quickly.

See also
PNTR_ENABLE_UTF8