commit 5d12a5ecf2d45f43b77ca5512b1d632518cd6b7f Author: Max Wash Date: Mon Mar 30 20:04:17 2020 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0691038 --- /dev/null +++ b/.gitignore @@ -0,0 +1,148 @@ +# Created by https://www.gitignore.io/api/c,vim,cmake,linux,windows,visualstudiocode +# Edit at https://www.gitignore.io/?templates=c,vim,cmake,linux,windows,visualstudiocode + +### C ### +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +### CMake ### +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps + +### CMake Patch ### +# External projects +*-prefix/ + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.gitignore.io/api/c,vim,cmake,linux,windows,visualstudiocode + +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9f490d8 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.5) +project(photon) + +file(GLOB_RECURSE photon_sources + ${CMAKE_SOURCE_DIR}/photon/*.c + ${CMAKE_SOURCE_DIR}/photon/*.h) +message(STATUS "Sources: " ${photon_sources}) + +add_library(photon_obj OBJECT ${photon_sources}) + +add_library(photon SHARED $) +add_library(photon_s STATIC $) + +set_property(TARGET photon_obj PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a4ec06e --- /dev/null +++ b/LICENSE @@ -0,0 +1,32 @@ +The Clear BSD License + +Copyright (c) 2020 Doorstuck Technologies Group +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted (subject to the limitations in the disclaimer +below) provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY +THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..101feff --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) + +
+
+ + Logo + + + +

+ A standard C library designed for Magenta +
+ Explore the docs » +
+
+ Report Bug + · + Request Feature +

+
+ + + + +## Table of Contents + +* [About the Project](#about-the-project) +* [Getting Started](#getting-started) + * [Prerequisites](#prerequisites) + * [Installation](#installation) +* [Usage](#usage) +* [Roadmap](#roadmap) +* [Contributing](#contributing) +* [License](#license) +* [Contact](#contact) + + +## About The Project +Photon is a standard C library for Magenta-based systems. Photon is designed to abstract +different Magenta-specific designs, such as handles and IPC-based file operations, into a +standard interface compatible with regular C programs. + + +## Getting Started + +To build photon, follow these steps. + +### Prerequisites + +There's some software you'll need to install before you can compile photon. +* CMake 3.5 + + +## Usage + +With GCC, a program can be compiled with `-ffreestanding -nostdlib` to disable linking to the system's C runtime. +From there, you can link with photon to use it as your C library instead. + + +## Roadmap + +See the [open issues](https://gitlab.com/doorstuck/magenta/photon/issues) for a list of proposed features (and known issues). + + + +## Contributing +If you feel like contributing to this project, here's how to do so. + +1. Fork the Project +2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) +3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) +4. Push to the Branch (`git push origin feature/AmazingFeature`) +5. Open a Pull Request + + + +## License + +Distributed under the BSD 3-Clause License. See `LICENSE` for more information. + + + +## Contact + +Max Wash - [@waash](https://gitlab.com/waash) - max@doorstuck.net + +Project Link: [https://gitlab.com/doorstuck/magenta/photon.git]() + diff --git a/doc/logo.png b/doc/logo.png new file mode 100755 index 0000000..bf6b0d9 Binary files /dev/null and b/doc/logo.png differ diff --git a/photon/temp.c b/photon/temp.c new file mode 100644 index 0000000..3bdd236 --- /dev/null +++ b/photon/temp.c @@ -0,0 +1,3 @@ +int temp_2() { + return 1; +}