LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
parser.h File Reference

Parses flags and values from strings. More...

#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
Include dependency graph for parser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool parse_flag (const char *flag, const char *str)
 Checks if a flag is present in a string.
bool parse_bool (const char *flag, const char *str)
 Checks if a flag is present in a string and if its set to true or false.
long parse_int (const char *flag, const char *str)
 Gets the int value of a flag.
bool parse_string (const char *flag, const char *str, char *out, size_t out_size)

Detailed Description

Parses flags and values from strings.

Author
Matheus Boscariol
Since
19/11/2026

Definition in file parser.h.

Function Documentation

◆ parse_bool()

bool parse_bool ( const char * flag,
const char * str )

Checks if a flag is present in a string and if its set to true or false.

Parameters
flagThe expected flag
strThe string to check
Returns
If the flag was found or not or if the flag is set to true or false

Definition at line 83 of file parser.c.

Here is the call graph for this function:

◆ parse_flag()

bool parse_flag ( const char * flag,
const char * str )

Checks if a flag is present in a string.

Parameters
flagThe expected flag
strThe string to check
Returns
If the flag was found or not

Definition at line 76 of file parser.c.

Here is the call graph for this function:

◆ parse_int()

long parse_int ( const char * flag,
const char * str )

Gets the int value of a flag.

Parameters
flagThe expected flag
strThe string to check
Returns
0 if the flag was not found or had an invalid value, or the number that it holds

Definition at line 133 of file parser.c.

Here is the call graph for this function:

◆ parse_string()

bool parse_string ( const char * flag,
const char * str,
char * out,
size_t out_size )

Definition at line 185 of file parser.c.