-
Notifications
You must be signed in to change notification settings - Fork 0
Shellv1 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Shellv1 #1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* _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).
…into shellv1 Update README.md file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merge version 1 of the shell into the main branch.