Skip to content

Conversation

@hackerSa3edy
Copy link
Owner

Merge version 1 of the shell into the main branch.

hackerSa3edy and others added 18 commits October 17, 2023 10:48
 * _atoi - convert a string to an integer.
 *
 * @s: string to be converted.
 *
 * Return: the converted number.

 * _strcat - Concatenates two strings.
 *
 * @DesT: destination var.
 * @src: source buffer.
 *
 * Return: Pointer to the resulting string dest.

 * _strcmp - compares two strings.
 *
 * @s1: string no 1.
 * @S2: string no 2.
 *
 * Return: positive num, zero and negative num.

 * _strdup - returns a pointer to anewly allocated space in memory,
 * which contains a copy of the string given as parameter.
 *
 * @string: string to be copied.
 *
 * Return: pointer to the newly allocated space in memory, or NULL
 * in some conditions.

 * _strlen - return the length of a string.
 *
 * @s: string.
 *
 * Return: length of the string.

 * _strncmp - compares n characters of two strings .
 *
 * @s1: string no 1.
 * @S2: string no 2.
 * @n: number of characters to be compared.
 *
 * Return: positive num, zero and negative num.
 * _realloc - reallocates a memory block using malloc and free.
 *
 * @ptr: old memory location.
 * @old_size: old size of the buffer.
 * @new_size: new size of the allocated memory.
 *
 * Return: pointer to the new allocated memory.

 * free_commands - frees a Command type single list.
 *
 *  @list: Command type single list;
 *
 * Return: Nothing.

* utils.c functions
 * SIGINT_handler - handles CTRL + C signal.
 * add_node_end - adds a new node at the end of a Commands list.
 * free_2D - frees a 2 dimensional array previously created.
 * absolutePath - checks if the command is absolute path to the binary or not.
 * _getenv - gets the environment value for an env variable.
*built_in_cmd.c function
 * built_in - checks whether the command is build in command or not.
 *
 * @cmd: command.
 *
 * Return: pointer to function.

*built_in_exit.c function
 * ___exit - exits the shell.
 *
 * @command: the command that the user type.
 * @envp: array of all environment variables.
 *
 * Return: (0) always success, (EXIT_CODE) otherwise.

*built_in_env.c function
 * _env - prints the environment variables.
 *
 * @command: the command that the user type.
 * @envp: array of all environment variables.
 *
 * Return: (0) always success, (1) otherwise.
*main.c function
 * main - main shell handler.
 *
 * @ARGC: number of arguments.
 * @argv: arguments' value.
 * @envp: environment variables.
 *
 * Return: (0) always success, (EXIT_CODE) otherwise.

*parser.c functions
 * parser - make a Commands single list of commands and its logical operators.
 * safeBuffer - delete the last character '\n'.
 * tokenizedArray - make each command and arg in the buffer into array.

*execMe.c functions
 * execMe - executes commands.
 * commandExists - checks if the command exists in the PATH or not.
*built_in_exit.c
 * provide the correct argument description.

*built_in_env.c
 * edit the code style.
If the user typed the logical operator as the first command, it will be
handled as logical operator, not as a command; So, if the logical operator
is the first command, then it should be treated as a command not a
logical operator.
*exec_utils.c functions
 * commandExists - checks if the command exists in the PATH or not.
 * doExec - checks if the command should be executed or not.
 * execAbsolutePath - executes a command which the user has provided its path.
 * execCommandPath - executes a command from PATH.

*logicalOperators.c functions
 * orOperator - handles || logical operator.
 *
 * @CMDexec: Commands single list to executes its commands.
 * @lastsignal: the signal by syscall.
 * @prevOp: previous logical operator.
 * @LogicalOp: current logical operator.
 *
 * Return: (GOTO) macro, or (0).

 * andOperator - handles && logical operator.
 *
 * @CMDexec: Commands single list to executes its commands.
 * @lastsignal: the signal by syscall.
 * @prevOp: previous logical operator.
 * @LogicalOp: current logical operator.
 *
 * Return: (GOTO) macro, or (0).

 * operatorsChain - handles chain of logical operator.
 *
 * @CMDexec: Commands single list to executes its commands.
 * @lastsignal: the signal by syscall.
 * @prevOp: previous logical operator.
 * @LogicalOp: current logical operator.
 *
 * Return: (GOTO) macro, or (0).
@hackerSa3edy hackerSa3edy merged commit 551e356 into master Oct 18, 2023
@hackerSa3edy hackerSa3edy deleted the shellv1 branch October 18, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants