Initial commit

This commit is contained in:
Jozef Nagy 2023-08-03 13:57:08 +02:00
commit c3fab1f164
7 changed files with 2967 additions and 0 deletions

84
.clang-format Normal file
View File

@ -0,0 +1,84 @@
# Modified version of Linux's .clang-format
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakStringLiterals: false
ColumnLimit: 80
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatementsExceptForEachMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Always
...

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
.vscode/
docs/
.DS_Store
*.o
psh

2771
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
Copyright (c) 2023 Jozef Nagy
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

63
Makefile Normal file
View File

@ -0,0 +1,63 @@
#
# Copyright (c) 2023 Jozef Nagy
#
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
#
#
CC := gcc
LD := $(CC)
INTERNAL_CFLAGS := -O2 -g3 -Wall -Wextra -Werror -pedantic -std=c99
INTERNAL_LDFLAGS :=
CFLAGS += $(INTERNAL_CFLAGS)
LDFLAGS += $(INTERNAL_LDFLAGS)
CFILES := $(shell find src -name "*.c")
OBJ := $(CFILES:.c=.o)
DEST := /usr/local/bin
PROGRAM := psh
.PHONY: all
all: $(PROGRAM)
$(PROGRAM): $(OBJ)
@printf " LD $@\n"
@$(LD) $(LDFLAGS) $(OBJ) -o $@
%.o: %.c
@printf " CC $^\n"
@$(CC) $(CFLAGS) -c $< -o $@
.PHONY: format
format:
@clang-format -i $(CFILES)
.PHONY: docs
docs:
@printf " DOXY docs/html\n"
@mkdir -p docs
@doxygen
@printf " DOXY docs/latex\n"
@make -C docs/latex 1>/dev/null
@mv docs/latex/refman.pdf docs
.PHONY: install
install: $(PROGRAM)
@printf " INSTALL\n"
@sudo install -m 755 $(PROGRAM) $(DEST)
.PHONY: uninstall
uninstall:
@printf " UNINSTALL\n"
@sudo rm $(DEST)/$(PROGRAM)
.PHONY: clean
clean:
@printf " CLEAN\n"
@rm -rf $(OBJ) $(PROGRAM) docs/

12
README.md Normal file
View File

@ -0,0 +1,12 @@
# Pretty SHell
Pretty SHell is a UNIX shell aiming for a stable and lightweight shell.
## Contributing
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change
## License
Sailfish is licensed under the MIT license, which you can find [here](LICENSE).

11
src/psh.c Normal file
View File

@ -0,0 +1,11 @@
/**
* @file: src/psh.c
* @author: Jozef Nagy <schkwve@gmail.com>
* @copyright: MIT (See LICENSE.md)
* @brief: This file contains the main entry point.
*/
int main()
{
return 0;
}