Libc Rt Freestanding¶
| Spice | |
|---|---|
Functions¶
memcpy¶
| Spice | |
|---|---|
Copy size bytes from src to dest. The memory areas must not overlap
Parameters
| Name | Type | Description |
|---|---|---|
dest |
byte* |
Destination memory area |
src |
const byte* |
Source memory area |
size |
unsigned long |
Number of bytes |
Returns: byte* — Destination memory area
memmove¶
| Spice | |
|---|---|
Copy size bytes from src to dest. The memory areas may overlap
Parameters
| Name | Type | Description |
|---|---|---|
dest |
byte* |
Destination memory area |
src |
const byte* |
Source memory area |
size |
unsigned long |
Number of bytes |
Returns: byte* — Destination memory area
memset¶
| Spice | |
|---|---|
Fill size bytes of dest with the given value
Parameters
| Name | Type | Description |
|---|---|---|
dest |
byte* |
Destination memory area |
value |
int |
Value, of which the lowest byte is used |
size |
unsigned long |
Number of bytes |
Returns: byte* — Destination memory area
memcmp¶
| Spice | |
|---|---|
Compare size bytes of two memory areas
Parameters
| Name | Type | Description |
|---|---|---|
lhs |
const byte* |
First memory area |
rhs |
const byte* |
Second memory area |
size |
unsigned long |
Number of bytes |
Returns: int — 0 if equal, a negative value if the first differing byte is smaller in lhs, a positive value otherwise
bcmp¶
| Spice | |
|---|---|
Check if two memory areas are equal. LLVM turns memcmp calls, of which only the equality is used, into bcmp calls
Parameters
| Name | Type | Description |
|---|---|---|
lhs |
const byte* |
First memory area |
rhs |
const byte* |
Second memory area |
size |
unsigned long |
Number of bytes |
Returns: int — 0 if equal, another value otherwise
strlen¶
| Spice | |
|---|---|
Get the length of a null-terminated string
Parameters
| Name | Type | Description |
|---|---|---|
str |
string |
String |
Returns: unsigned long — Number of chars before the null terminator
strcmp¶
| Spice | |
|---|---|
Compare two null-terminated strings
Parameters
| Name | Type | Description |
|---|---|---|
lhs |
string |
First string |
rhs |
string |
Second string |
Returns: int — 0 if equal, a negative value if the first differing char is smaller in lhs, a positive value otherwise