Minishell
Loading...
Searching...
No Matches
main.h File Reference
#include <stdbool.h>
#include <time.h>
#include <unistd.h>
#include "mini_printf.h"
#include "arguments.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "epifetch.h"
Include dependency graph for main.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  history_s
 
struct  env_node
 
struct  run_command_s
 
struct  alias_s
 
struct  data
 

Macros

#define RESET   "\033[0m"
 
#define WHITE   "\033[0;37m"
 
#define RED   "\033[0;31m"
 
#define GREEN   "\033[0;32m"
 
#define BLUE   "\033[0;34m"
 
#define LOGO_PATH   "logos/spyro.txt"
 

Typedefs

typedef struct history_s history_t
 
typedef enum redirection_s redirection_t
 
typedef struct env_node env_node_t
 
typedef struct run_command_s run_command_t
 
typedef struct alias_s alias_t
 
typedef struct data data_t
 

Enumerations

enum  redirection_s {
  NONE , PIPE , SEMICOLON , L_REDIRECT_OW ,
  L_REDIRECT_AP , R_REDIRECT_OW , R_REDIRECT_AP , DOUBLE_AMPERSAND ,
  DOUBLE_PIPE
}
 

Functions

void wait_child (int cpid, data_t *data)
 
env_node_tfind_name_in_path (data_t *data, char *name)
 
void expand_aliases (data_t *data)
 
void create_config (data_t *data)
 
alias_tcreate_alias_node (const char *name, char **value)
 
void alias_rc (data_t *data)
 

Macro Definition Documentation

◆ BLUE

#define BLUE   "\033[0;34m"

◆ GREEN

#define GREEN   "\033[0;32m"

◆ LOGO_PATH

#define LOGO_PATH   "logos/spyro.txt"

◆ RED

#define RED   "\033[0;31m"

◆ RESET

#define RESET   "\033[0m"

◆ WHITE

#define WHITE   "\033[0;37m"

Typedef Documentation

◆ alias_t

typedef struct alias_s alias_t

◆ data_t

typedef struct data data_t

env contains a linked list of the env env_array is the same an env but instead of a linked list is an array home contains the home directory of user status contains the exit code of the last command

◆ env_node_t

typedef struct env_node env_node_t

◆ history_t

typedef struct history_s history_t

◆ redirection_t

◆ run_command_t

typedef struct run_command_s run_command_t

Enumeration Type Documentation

◆ redirection_s

Enumerator
NONE 
PIPE 
SEMICOLON 
L_REDIRECT_OW 
L_REDIRECT_AP 
R_REDIRECT_OW 
R_REDIRECT_AP 
DOUBLE_AMPERSAND 
DOUBLE_PIPE 

Function Documentation

◆ alias_rc()

void alias_rc ( data_t * data)

◆ create_alias_node()

alias_t * create_alias_node ( const char * name,
char ** value )

◆ create_config()

void create_config ( data_t * data)
Here is the call graph for this function:

◆ expand_aliases()

void expand_aliases ( data_t * data)

◆ find_name_in_path()

env_node_t * find_name_in_path ( data_t * data,
char * name )

◆ wait_child()

void wait_child ( int cpid,
data_t * data )

This function waits for the executed command to finish and prints any error that could have happened also it will save its exit status code on data->status

Parameters
cpidChild process id
dataGlobal data structure
Here is the call graph for this function: