diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | changelog.html | 9 | ||||
-rw-r--r-- | include/luma.hh | 5 | ||||
-rwxr-xr-x | luma.bin | bin | 0 -> 17520 bytes | |||
-rwxr-xr-x | new.bin | bin | 0 -> 16864 bytes | |||
-rw-r--r-- | src/luma/arghandl.cc | 10 | ||||
-rw-r--r-- | src/luma/luma.cc | 3 |
8 files changed, 21 insertions, 11 deletions
@@ -1,2 +1 @@ -*.bin *.o @@ -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 Binary files differBinary files differnew file mode 100755 index 0000000..8d3da6a --- /dev/null +++ b/luma.bin 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; |