PatchworkOS  3984a1d
A non-POSIX operating system.
Loading...
Searching...
No Matches
builtin.c File Reference
#include "builtin.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/defs.h>
#include <sys/io.h>
#include <sys/proc.h>
Include dependency graph for builtin.c:

Go to the source code of this file.

Functions

static uint64_t builtin_cd (uint64_t argc, const char **argv)
 
static uint64_t builtin_help (uint64_t argc, const char **argv)
 
static uint64_t builtin_clear (uint64_t argc, const char **argv)
 
bool builtin_exists (const char *name)
 
uint64_t builtin_execute (uint64_t argc, const char **argv)
 

Variables

static builtin_t builtins []
 

Function Documentation

◆ builtin_cd()

static uint64_t builtin_cd ( uint64_t  argc,
const char **  argv 
)
static

Definition at line 36 of file builtin.c.

Here is the call graph for this function:

◆ builtin_help()

static uint64_t builtin_help ( uint64_t  argc,
const char **  argv 
)
static

Definition at line 53 of file builtin.c.

Here is the call graph for this function:

◆ builtin_clear()

static uint64_t builtin_clear ( uint64_t  argc,
const char **  argv 
)
static

Definition at line 79 of file builtin.c.

Here is the call graph for this function:

◆ builtin_exists()

bool builtin_exists ( const char name)

Definition at line 88 of file builtin.c.

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

◆ builtin_execute()

uint64_t builtin_execute ( uint64_t  argc,
const char **  argv 
)

Definition at line 101 of file builtin.c.

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

Variable Documentation

◆ builtins

builtin_t builtins[]
static
Initial value:
= {
{
.name = "cd",
.callback = builtin_cd,
.description = "Change the current working directory.",
.usage = "cd [directory]",
},
{
.name = "help",
.callback = builtin_help,
.description = "Show this help message.",
.usage = "help",
},
{
.name = "clear",
.callback = builtin_clear,
.description = "Clear the terminal screen.",
.usage = "clear",
},
}
static uint64_t builtin_help(uint64_t argc, const char **argv)
Definition builtin.c:53
static uint64_t builtin_clear(uint64_t argc, const char **argv)
Definition builtin.c:79
static uint64_t builtin_cd(uint64_t argc, const char **argv)
Definition builtin.c:36

Definition at line 15 of file builtin.c.