Module: libc.cstring

Source: ./libc/cstring.reef


Overview

libc.cstring - C standard library string functions (FFI)

Direct access to C's string.h functions for string manipulation. For pure Reef implementations, use core.str instead.


Functions

fn strlen(s: pointer): int

fn strcmp(s1: pointer, s2: pointer): int

fn strncmp(s1: pointer, s2: pointer, n: int): int

fn strstr(haystack: pointer, needle: pointer): pointer

fn strlen(s: string): int

Returns the length of a null-terminated string (not counting the null)

fn strcmp(s1: string, s2: string): int

Compares two strings lexicographically Returns: <0 if s1 < s2, 0 if s1 == s2, >0 if s1 > s2

fn strncmp(s1: string, s2: string, n: int): int

Compares at most n characters of two strings Returns: <0 if s1 < s2, 0 if s1 == s2, >0 if s1 > s2

fn strstr(haystack: string, needle: string): pointer

Finds first occurrence of needle in haystack Returns: pointer to first match, or null pointer if not found


Generated by reefc doc