Simple Operating System
string.h File Reference

Simple string handling. More...

#include "types.h"
Include dependency graph for string.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool strcmp (int str1, int str2)
 Compares two string until \0 appears. More...
 
size_t strlen (const char *str)
 Returns length of string. More...
 
const char * strchr (const char *str, int character)
 Find first appearance of character. More...
 
int stoi (const char *str)
 Convert string to int. More...
 
int memset (int ptr, int value, size_t count)
 Set count Bytes of *ptr to value. More...
 
char * strcpy (char *destination, const char *source)
 Copy from source to destination until \0 appears. More...
 
int strncpy (int destination, int source, size_t num)
 Copy num Bytes from source to destination until \0 appears. More...
 

Variables

const uint32_t pows [] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000}
 

Detailed Description

Simple string handling.

Definition in file string.h.

Function Documentation

◆ memset()

int memset ( int  ptr,
int  value,
size_t  count 
)

Set count Bytes of *ptr to value.

Parameters
ptr
value
count
Returns
*ptr

Definition at line 97 of file string.h.

◆ stoi()

int stoi ( const char *  str)

Convert string to int.

Parameters
str
Returns
int

Definition at line 80 of file string.h.

◆ strchr()

const char* strchr ( const char *  str,
int  character 
)

Find first appearance of character.

Parameters
str
character
Returns
pointer to first appearance or NULL if not found

Definition at line 64 of file string.h.

◆ strcmp()

bool strcmp ( int  str1,
int  str2 
)

Compares two string until \0 appears.

Parameters
str1
str2
Returns
true if are same
false if not

Definition at line 20 of file string.h.

◆ strcpy()

char* strcpy ( char *  destination,
const char *  source 
)

Copy from source to destination until \0 appears.

Parameters
destination
source
Returns
*destination

Definition at line 113 of file string.h.

◆ strlen()

size_t strlen ( const char *  str)

Returns length of string.

Parameters
str
Returns
size_t

Definition at line 44 of file string.h.

◆ strncpy()

int strncpy ( int  destination,
int  source,
size_t  num 
)

Copy num Bytes from source to destination until \0 appears.

Parameters
destination
source
num
Returns
*destination

Definition at line 131 of file string.h.