summaryrefslogtreecommitdiff
path: root/old
diff options
context:
space:
mode:
Diffstat (limited to 'old')
-rw-r--r--old/include/luma/main.hh87
-rw-r--r--old/src/luma/app_t/app_t.cc95
-rw-r--r--old/src/luma/app_t/archstr.cc22
-rw-r--r--old/src/luma/app_t/arghandl.cc12
-rw-r--r--old/src/luma/app_t/dbgmsgf.cc6
-rw-r--r--old/src/luma/app_t/exit.cc5
-rw-r--r--old/src/luma/app_t/getenv.cc13
-rw-r--r--old/src/luma/app_t/kernelstr.cc34
-rw-r--r--old/src/luma/app_t/msgf.cc8
-rw-r--r--old/src/luma/app_t/msgferr.cc4
-rw-r--r--old/src/luma/app_t/msgfout.cc4
-rw-r--r--old/src/luma/app_t/strcmp.cc11
-rw-r--r--old/src/luma/app_t/strcut.cc25
-rw-r--r--old/src/luma/app_t/strlen.cc8
-rw-r--r--old/src/main.cc6
15 files changed, 0 insertions, 340 deletions
diff --git a/old/include/luma/main.hh b/old/include/luma/main.hh
deleted file mode 100644
index 1061e10..0000000
--- a/old/include/luma/main.hh
+++ /dev/null
@@ -1,87 +0,0 @@
-# if !defined(LUMA__HEADER__MAIN)
-# define LUMA__HEADER__MAIN
-# include <cstddef>
-// constexpr -> const -> normal
-// typedef -> enum class -> class -> operator -> variable -> function
-namespace luma {
- typedef decltype(nullptr) nullptr_t; // Official way to define nullptr_t
- enum class arch_t {
- aarch64,
- amd64,
- ia64,
- ppc64,
- unknown,
- };
- enum class kernel_t {
- darwinos,
- dragonflybsd,
- freebsd,
- hurd,
- linux,
- minix,
- netbsd,
- openbsd,
- unknown,
- };
- class app_t {
- public:
- app_t(int const argc, char const * * argv);
- ~app_t();
- private:
- bool constexpr static debug =
-# if defined(NDEBUG)
- false;
-# else
- true;
-# endif
- luma::arch_t constexpr static arch = luma::arch_t::
-# if defined(__aarch64__)
- aarch64;
-# elif (defined(_M_AMD64) || defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(x86_64__))
- amd64;
-# elif (defined(_IA64) defined(_M_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__itanium__))
- ia64;
-# elif (defined(_ARCH_PPC64) || defined(__powerpc64__) || defined(__PPC64__) || defined(__ppc64__))
- ppc64;
-# else
- unknown;
-# endif
- luma::kernel_t constexpr static kernel = luma::kernel_t::
-# if defined(__APPLE__)
- darwinos;
-# elif defined(__DragonFly__)
- dragonflybsd;
-# elif defined(__FreeBSD__)
- freebsd;
-# elif (defined(__GNU__) || defined(__gnu_hurd__))
- hurd;
-# elif defined(__linux__)
- linux;
-# elif defined(__minix)
- minix;
-# elif defined(__NetBSD__)
- netbsd;
-# elif defined(__OpenBSD__)
- openbsd;
-# else
- unknown;
-# endif
- int stderr = 0x0;
- int stdout = 0x0;
- char const * archstr(luma::arch_t arch) noexcept;
- char const * getenv(char const * envvar);
- char const * kernelstr(luma::kernel_t kernel) noexcept;
- char const * strcut(char const * str,int pos,int len);
- int strcmp(char const * lstr,char const * rstr) noexcept;
- int strlen(char const * str) noexcept;
- void arghandl(char const * arg);
- void dbgmsgf(char const * msg);
- [[noreturn]] void exit() noexcept;
- //template<typename T,typename ... Args>
- //void msgf(char const * msg, Args const & ... args);
- void msgf(int pipe,char const * buf,std::size_t count);
- void msgferr(char const * buf);
- void msgfout(char const * buf);
- };
-}
-# endif
diff --git a/old/src/luma/app_t/app_t.cc b/old/src/luma/app_t/app_t.cc
deleted file mode 100644
index c650071..0000000
--- a/old/src/luma/app_t/app_t.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-# include <fcntl.h>
-# include <iostream>
-# include <luma/main.hh>
-# include <unistd.h>
-luma::app_t::app_t(int const argc,char const * * argv) {
- this->stderr = ::open("/dev/stderr",O_WRONLY);
- this->stdout = ::open("/dev/stdout",O_WRONLY);
- if(argc < 0x2) {
- this->msgferr("Missing argument \"file\".\n");
- this->msgferr("Use \"--help\" for help.\n");
- this->exit();
- }
- //else {
- // for(int i = 0x0;i < argc;++i) {
- // this->arghandl(argv[i]);
- // }
- //}
- this->msgfout(this->archstr(this->arch));
- this->msgfout(this->kernelstr(this->kernel));
- if(!::access(argv[0x1],R_OK)) {
- int lumafile = ::open(argv[0x1],O_RDONLY);
- for(int line = 0x0,pos = 0x0;;++pos) {
- char * tok;
- ::read(lumafile,&tok,0x1);
- this->msgfout("Here?\n");
- std::cout << line << ":" << pos << "=" << "\u000A";
- int pipe = ::open("/dev/stdout",O_WRONLY);
- this->msgf(pipe,tok,0x4);
- if(this->strcmp(tok,"\u000A") == 0x0) {
- ++line;
- }
- else if(this->strcmp(tok,"\u0061") == 0x0) {
- this->msgfout("\'a\' detected!");
- }
- }
- /*
- char const * toks[] = {
- "\u0009", // Horizontal Tabulation
- "\u000A", // New Line (Nl)
- "\u0020", // Space
- "\u0023", // Number Sign
- "\u0028", // Left Parenthesis
- "\u0029", // Right Parenthesis
- "\u002B", // Plus Sign
- "\u003C", // Less-Than Sign
- "\u003D", // Equals Sign
- "\u003E", // Greater-Than Sign
- "\u0061", // Latin Small Letter a
- "\u0062", // Latin Small Letter b
- "\u0063", // Latin Small Letter c
- "\u0064", // Latin Small Letter d
- "\u0065", // Latin Small Letter e
- "\u0066", // Latin Small Letter f
- "\u0067", // Latin Small Letter g
- "\u0068", // Latin Small Letter h
- "\u0069", // Latin Small Letter i
- "\u006a", // Latin Small Letter j
- "\u006B", // Latin Small Letter k
- "\u006C", // Latin Small Letter l
- "\u006D", // Latin Small Letter m
- "\u006E", // Latin Small Letter n
- "\u006F", // Latin Small Letter o
- "\u0070", // Latin Small Letter p
- "\u0071", // Latin Small Letter q
- "\u0072", // Latin Small Letter r
- "\u0073", // Latin Small Letter s
- "\u0074", // Latin Small Letter t
- "\u0075", // Latin Small Letter u
- "\u0076", // Latin Small Letter v
- "\u0077", // Latin Small Letter w
- "\u0078", // Latin Small Letter x
- "\u0079", // Latin Small Letter y
- "\u007A", // Latin Small Letter z
- "\u00D7", // Multiplication Sign
- "\u00F7", // Division Sign
- "\u201C", // Left Double Quotation Mark
- "\u201D", // Right Double Quotation Mark
- "\u218A", // Turned Digit Two
- "\u218B", // Turned Digit Three
- "\u2212", // Minus Sign
- "\u2217", // Asterisk Operator
- "\u2260", // Not Equal To
- "\u2264", // Less-Than or Equal To
- "\u2265", // Greater-Than or Equal To
- };
- */
- }
- else {
- this->msgferr("The file doesn\'t exist.\n");
- this->exit();
- }
-}
-luma::app_t::~app_t() {
- this->exit();
-}
diff --git a/old/src/luma/app_t/archstr.cc b/old/src/luma/app_t/archstr.cc
deleted file mode 100644
index 57b32dc..0000000
--- a/old/src/luma/app_t/archstr.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-# include <luma/main.hh>
-char const * luma::app_t::archstr(luma::arch_t arch) noexcept {
- char const * str = "";
- switch(arch) {
- default:
- str = "Unknown";
- break;
- case luma::arch_t::aarch64:
- str = "ARM64/AArch64";
- break;
- case luma::arch_t::amd64:
- str = "AMD64/x86-64";
- break;
- case luma::arch_t::ia64:
- str = "IA-64";
- break;
- case luma::arch_t::ppc64:
- str = "PPC64";
- break;
- }
- return str;
-}
diff --git a/old/src/luma/app_t/arghandl.cc b/old/src/luma/app_t/arghandl.cc
deleted file mode 100644
index 74a63ed..0000000
--- a/old/src/luma/app_t/arghandl.cc
+++ /dev/null
@@ -1,12 +0,0 @@
-# include <luma/main.hh>
-void luma::app_t::arghandl(char const * arg) {
- char const * appinf = "Luma ()";
- if(this->strcmp(arg,"--help")) {
- this->msgfout("\n");
- this->exit();
- }
- else if(this->strcmp(arg,"--version")) {
- this->msgfout("\n");
- this->exit();
- }
-}
diff --git a/old/src/luma/app_t/dbgmsgf.cc b/old/src/luma/app_t/dbgmsgf.cc
deleted file mode 100644
index fe0631c..0000000
--- a/old/src/luma/app_t/dbgmsgf.cc
+++ /dev/null
@@ -1,6 +0,0 @@
-# include <luma/main.hh>
-void luma::app_t::dbgmsgf(char const * msg) {
- if constexpr(debug) {
- this->msgferr(msg);
- }
-}
diff --git a/old/src/luma/app_t/exit.cc b/old/src/luma/app_t/exit.cc
deleted file mode 100644
index 8a975e6..0000000
--- a/old/src/luma/app_t/exit.cc
+++ /dev/null
@@ -1,5 +0,0 @@
-# include <luma/main.hh>
-# include <unistd.h>
-[[noreturn]] void luma::app_t::exit() noexcept {
- ::_exit(0x0);
-}
diff --git a/old/src/luma/app_t/getenv.cc b/old/src/luma/app_t/getenv.cc
deleted file mode 100644
index 2c1b3f4..0000000
--- a/old/src/luma/app_t/getenv.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-# include <luma/main.hh>
-# include <unistd.h>
-char const * luma::app_t::getenv(char const * envvar) {
- /*
- strlen = this->strlen(envvar);
- for(char const * var : ::environ) {
- if(this->strcmp(this->strcut(envvar,0x0,this->strlen(envvar),envvar) == 0x0) {
-
- }
- }
- */
- return "wayland";
-}
diff --git a/old/src/luma/app_t/kernelstr.cc b/old/src/luma/app_t/kernelstr.cc
deleted file mode 100644
index 9b326bd..0000000
--- a/old/src/luma/app_t/kernelstr.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-# include <luma/main.hh>
-char const * luma::app_t::kernelstr(luma::kernel_t kernel) noexcept {
- char const * str = "";
- switch(kernel) {
- default:
- str = "Unknown";
- break;
- case luma::kernel_t::darwinos:
- str = "Dawin OS";
- break;
- case luma::kernel_t::dragonflybsd:
- str = "DragonFly BSD";
- break;
- case luma::kernel_t::freebsd:
- str = "FreeBSD";
- break;
- case luma::kernel_t::hurd:
- str = "Hurd";
- break;
- case luma::kernel_t::linux:
- str = "Linux";
- break;
- case luma::kernel_t::minix:
- str = "MINIX";
- break;
- case luma::kernel_t::netbsd:
- str = "NetBSD";
- break;
- case luma::kernel_t::openbsd:
- str = "OpenBSD";
- break;
- }
- return str;
-}
diff --git a/old/src/luma/app_t/msgf.cc b/old/src/luma/app_t/msgf.cc
deleted file mode 100644
index cf61c98..0000000
--- a/old/src/luma/app_t/msgf.cc
+++ /dev/null
@@ -1,8 +0,0 @@
-# include <cstddef>
-# include <luma/main.hh>
-# include <unistd.h>
-void luma::app_t::msgf(int pipe,char const * msg,std::size_t count) {
- if(::write(pipe,msg,count) < 0x0) {
- // ???
- }
-}
diff --git a/old/src/luma/app_t/msgferr.cc b/old/src/luma/app_t/msgferr.cc
deleted file mode 100644
index f5bf60c..0000000
--- a/old/src/luma/app_t/msgferr.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-# include <luma/main.hh>
-void luma::app_t::msgferr(char const * msg) {
- this->msgf(this->stderr,msg,this->strlen(msg));
-}
diff --git a/old/src/luma/app_t/msgfout.cc b/old/src/luma/app_t/msgfout.cc
deleted file mode 100644
index 3373d51..0000000
--- a/old/src/luma/app_t/msgfout.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-# include <luma/main.hh>
-void luma::app_t::msgfout(char const * msg) {
- this->msgf(this->stdout,msg,this->strlen(msg));
-}
diff --git a/old/src/luma/app_t/strcmp.cc b/old/src/luma/app_t/strcmp.cc
deleted file mode 100644
index ce8e082..0000000
--- a/old/src/luma/app_t/strcmp.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-# include <luma/main.hh>
-int luma::app_t::strcmp(char const * lstr,char const * rstr) noexcept {
- for(int i = 0x0;;++i) {
- if(lstr[i] != rstr[i]) {
- return lstr[i] < rstr[i] ? -0x1 : 0x1;
- }
- if(lstr[i] == '\0') {
- return 0x0;
- }
- }
-}
diff --git a/old/src/luma/app_t/strcut.cc b/old/src/luma/app_t/strcut.cc
deleted file mode 100644
index 233c47f..0000000
--- a/old/src/luma/app_t/strcut.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-# include <luma/main.hh>
-char const * luma::app_t::strcut(char const * str,int pos,int len) {
- /*
- if((this->strlen(str) - pos - len - 0x1) < 0x0) { // 0x1 counts null as well
- // string too short
- this->msgerr("String too short!\n");
- return nullptr;
- }
- else {
- char * outstr = nullptr;
- int outstrpos = 0x0;
- this->msg("boys");
- for(int pos = 0x0;(pos < len);++pos) {
- this->msg("diers");
- char chr = str[pos];
- this->msg("hallo");
- outstr[outstrpos] = chr;
- ++outstrpos;
- }
- outstr[++outstrpos] = '\0';
- return outstr;
- }
- */
- return nullptr;
-}
diff --git a/old/src/luma/app_t/strlen.cc b/old/src/luma/app_t/strlen.cc
deleted file mode 100644
index a4c9ba6..0000000
--- a/old/src/luma/app_t/strlen.cc
+++ /dev/null
@@ -1,8 +0,0 @@
-# include <luma/main.hh>
-int luma::app_t::strlen(char const * str) noexcept {
- int len = 0x0;
- while(str[len] != '\0') {
- ++len;
- }
- return len;
-}
diff --git a/old/src/main.cc b/old/src/main.cc
deleted file mode 100644
index 7bca331..0000000
--- a/old/src/main.cc
+++ /dev/null
@@ -1,6 +0,0 @@
-# include <fcntl.h>
-# include <luma/main.hh>
-# include <unistd.h>
-int main(int const argc,char const * * argv) {
- luma::app_t app(argc,argv);
-}