LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
variables.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "variables.h"
+ Include dependency graph for variables.c:

Go to the source code of this file.

Functions

void shell_variable_add (shell_variable *var)
 
static int shell_variable_find (char *name)
 
char * shell_variable_get (char *name)
 
int assign_variable (char *user_input)
 

Variables

shell_variable ** shell_variable_array = 0
 
int svar_arr_offset = 0
 

Function Documentation

◆ assign_variable()

int assign_variable ( char *  user_input)

Definition at line 70 of file variables.c.

References free(), malloc(), memcpy(), memset(), name, shell_variable::name, SHELL_MAX_VARIABLE_ITEM_LENGTH, SHELL_MAX_VARIABLE_NAME_LENGTH, shell_variable_add(), shell_variable_array, shell_variable_find(), strlen(), and shell_variable::value.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shell_variable_add()

void shell_variable_add ( shell_variable var)

Definition at line 19 of file variables.c.

References malloc(), realloc(), shell_variable_array, size, and svar_arr_offset.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shell_variable_find()

static int shell_variable_find ( char *  name)
static

Definition at line 38 of file variables.c.

References name, shell_variable_array, strcmp(), and svar_arr_offset.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shell_variable_get()

char * shell_variable_get ( char *  name)

Definition at line 54 of file variables.c.

References malloc(), memset(), name, shell_variable_array, and shell_variable_find().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ shell_variable_array

shell_variable** shell_variable_array = 0

Definition at line 14 of file variables.c.

◆ svar_arr_offset

int svar_arr_offset = 0

Definition at line 15 of file variables.c.