-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.h
More file actions
33 lines (28 loc) · 959 Bytes
/
utils.h
File metadata and controls
33 lines (28 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2025 ShivankSharma. All Rights Reserved.
#pragma once
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
extern struct sigaction sa;
typedef struct command command_t;
typedef struct fdPair fdpair_t;
typedef struct file file_t;
void sigint_handler(int signal);
char *get_input();
void printcommand(command_t **tokens);
command_t **parseInputToCommands(char *input);
char **parseCommandIntoTokens(char *str, char *seperator);
void setReadPipe(int *readPipe);
void setWritePipe(int *writePipe);
int command_execute(char **command, fdpair_t *fdpair);
void resolve_env(char **command);
int run_commands(command_t **commands);
int runPipedCommands(char **command);
int handleSubShell(command_t *command);
char *extractOneWord(char *str);
void pushfdpair(fdpair_t *arr, int a, int b);
void printfdpair(fdpair_t *arr);
fdpair_t *newfdpair(int initialCapacity);
int handleRedirection(command_t *command);
void loop();