WKern
Loading...
Searching...
No Matches
util.h File Reference
#include <types/nums.h>

Go to the source code of this file.

Functions

int Kstrcmp (const char *a, const char *b)
 Compare Strings - Similar to standard libc strcmp.
void Kshcmp ()
 Interactive string comparison.
char * Kstrchr (const char *str, int c)
 Search for character in string.
int Ktolower (int c)
 Convert character to lowercase.
int Kisdigit (int c)
int Kisspace (int c)
 Check if character is whitespace.
int Kisxdigit (int c)
 Checks if input is a Hexadecimal Diget.
size_t Kstrlen (const char *str)
 Get string length.
int Split (char *input, char **argv, int max_args)
 Split into ARGC.
void ZZZ (int ms)
 Sleeps for 10ms.
int Katoi (const char *str)
 Converts ASCII - Integer.
int KatoiAuto (const char *str)
void Kitoa (unsigned int num, char *buf)
 Convert Integer to ASCII Text.
void DrawSmile ()
u32 Kmstrlen (const char *str)
 Get string length.

Function Documentation

◆ DrawSmile()

void DrawSmile ( )

◆ Katoi()

int Katoi ( const char * str)

Converts ASCII - Integer.

Parameters
str- ASCII Text
Returns
Integer from ASCII Input

Definition at line 23 of file numtools.c.

◆ KatoiAuto()

int KatoiAuto ( const char * str)

◆ Kisdigit()

int Kisdigit ( int c)

Definition at line 100 of file strings.c.

◆ Kisspace()

int Kisspace ( int c)

Check if character is whitespace.

Parameters
c- Character to check
Returns
1 if whitespace, 0 if not

Definition at line 107 of file strings.c.

◆ Kisxdigit()

int Kisxdigit ( int c)

Checks if input is a Hexadecimal Diget.

Parameters
Characterto check
Returns
1 if is hex digit, 0 if not

Definition at line 134 of file strings.c.

◆ Kitoa()

void Kitoa ( unsigned int num,
char * buf )

Convert Integer to ASCII Text.

Parameters
num- Number to convert to ASCII Text
buf- Buffer which ASCII Text will be stored at

Definition at line 73 of file numtools.c.

◆ Kmstrlen()

u32 Kmstrlen ( const char * str)

Get string length.

Parameters
str- String to check length
Returns
uint32_t (u32) - Length of passed string

Definition at line 60 of file strings.c.

◆ Kshcmp()

void Kshcmp ( )

Interactive string comparison.

Definition at line 38 of file strings.c.

◆ Kstrchr()

char * Kstrchr ( const char * str,
int c )

Search for character in string.

Parameters
Stringto search
Characterto find
Returns
Pointer to character if found, if not found NULL

Definition at line 74 of file strings.c.

◆ Kstrcmp()

int Kstrcmp ( const char * a,
const char * b )

Compare Strings - Similar to standard libc strcmp.

Parameters
a- First string to compare
b- Second string to compare
Returns
Integer - 0 if match

Definition at line 27 of file strings.c.

◆ Kstrlen()

size_t Kstrlen ( const char * str)

Get string length.

Parameters
str- String to check length
Returns
uint32_t (u32) - Length of passed string

Definition at line 121 of file strings.c.

◆ Ktolower()

int Ktolower ( int c)

Convert character to lowercase.

Parameters
Characterto convert
Returns
Lowercase character

Definition at line 92 of file strings.c.

◆ Split()

int Split ( char * input,
char ** argv,
int max_args )

Split into ARGC.

Parameters
char*- Input String
char**- Argv Buffer
-Max args
Returns
Arguement number (argc)

Definition at line 146 of file strings.c.

◆ ZZZ()

void ZZZ ( int ms)

Sleeps for 10ms.

Parameters
ms- Number of 10ms to sleep

Definition at line 25 of file ksleep.c.