summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile4
-rw-r--r--changelog.html9
-rw-r--r--include/luma.hh5
-rwxr-xr-xluma.binbin0 -> 17520 bytes
-rwxr-xr-xnew.binbin0 -> 16864 bytes
-rw-r--r--src/luma/arghandl.cc10
-rw-r--r--src/luma/luma.cc3
8 files changed, 21 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 98f5968..5761abc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-*.bin
*.o
diff --git a/Makefile b/Makefile
index 70a334a..ced5519 100644
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,9 @@ SRCS_CXX = \
src/luma/arghandl.cc
SRCS=$(SRCS_CXX)
OBJS=$(SRCS:.cc=.o)
-luma.bin: $(OBJS)
+luma: $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $(OBJS)
$(OBJS): $(HDRS_CXX) $(SRCS_CXX)
.PHONY: clean
clean:
- rm $(OBJS)
+ rm luma $(OBJS)
diff --git a/changelog.html b/changelog.html
index 50acfd2..ce72472 100644
--- a/changelog.html
+++ b/changelog.html
@@ -4,6 +4,15 @@
<meta charset="utf-8">
</head>
<body>
+ <h1>14</h1>
+ <ul>
+ Compile "luma" instead of "luma.bin".
+ Get input file via arguments passed to executable.
+ </ul>
+ <h1>13</h1>
+ <ul>
+ <li>Reformat README.html to Markdown.</li>
+ </ul>
<h1>12</h1>
<ul>
<li>Add "changelog.html" to keep track of changes.</li>
diff --git a/include/luma.hh b/include/luma.hh
index 2378e82..ba7ad27 100644
--- a/include/luma.hh
+++ b/include/luma.hh
@@ -1,10 +1,13 @@
#if !defined(LUMA__HEADER)
# define LUMA__HEADER
+# include <string>
+using namespace std::literals::string_literals;
class luma {
public:
[[noreturn]] luma(int const argc,char const * * argv);
~luma();
private:
- void arghandl(int const argc, char const * * argv);
+ void arghandl(int const argc, char const * * argv);
+ std::basic_string<char> lumafile = ""s;
};
# endif
diff --git a/luma.bin b/luma.bin
new file mode 100755
index 0000000..8d3da6a
--- /dev/null
+++ b/luma.bin
Binary files differ
diff --git a/new.bin b/new.bin
new file mode 100755
index 0000000..543303c
--- /dev/null
+++ b/new.bin
Binary files differ
diff --git a/src/luma/arghandl.cc b/src/luma/arghandl.cc
index 70b9ae6..f9f08c0 100644
--- a/src/luma/arghandl.cc
+++ b/src/luma/arghandl.cc
@@ -1,14 +1,12 @@
# include <cstdio>
# include <luma.hh>
# include <string>
-# include <vector>
using namespace std::literals::string_literals;
void luma::arghandl(int const argc,char const * * argv) {
- std::vector<std::basic_string<char>> args;
for(int pos = 0x1;pos < argc; ++pos) {
- args.push_back(argv[pos]);
- }
- for(std::basic_string<char> arg : args) {
- std::printf("Got argument \"%s\".\u000A",arg.c_str());
+ std::string arg = argv[pos];
+ if(pos == 0x1) {
+ this->lumafile = arg;
+ }
}
}
diff --git a/src/luma/luma.cc b/src/luma/luma.cc
index 18fcdb7..5b72788 100644
--- a/src/luma/luma.cc
+++ b/src/luma/luma.cc
@@ -6,7 +6,8 @@
# include <unistd.h>
[[noreturn]] luma::luma(int const argc,char const * * argv) {
this->arghandl(argc,argv);
- int file = ::open("test.luma",O_RDONLY);
+ std::printf("Will open \"%s\".\u000A",this->lumafile.c_str());
+ int file = ::open(this->lumafile.c_str(),O_RDONLY);
char tok = '\0';
char word[0x1000];
int wordpos = 0x0;