Skip to content

Commit

Permalink
Welcome message
Browse files Browse the repository at this point in the history
Also, a release is incoming!
  • Loading branch information
josemam committed Oct 9, 2016
1 parent fc04aeb commit 69f5dd2
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 5 deletions.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
CXX = g++
VERSION = v0.1.0
CHARSET = UTF-8
PROGRAM_NAME = IV⇆\ PID
# If Windows, sets the Western Europe charset
ifdef SystemRoot
CHARSET = CP850
PROGRAM_NAME = IV-PID
endif

CXXFLAGS = -O3 -m32 -static -s -Wall -Iinclude -flto -fexec-charset=$(CHARSET)
CXXFLAGS = -O3 -m32 -static -s -Wall -Iinclude -flto
STRINGSFLAGS = -fexec-charset=$(CHARSET)
IOFLAGS = $(STRINGFLAGS) -DPROGRAM_NAME=\"$(PROGRAM_NAME)\" -DVERSION=\"$(VERSION)\"
OBJ = obj
SRC = src
.INTERMEDIATE: $(OBJ)/io.o

all: iv-pid_eng iv-pid_esp

$(OBJ):
mkdir $@

$(OBJ)/strings%.o: $(SRC)/strings%.cpp $(OBJ)
$(CXX) $(CXXFLAGS) $(STRINGSFLAGS) -c $< -o $@

$(OBJ)/io.o: $(SRC)/io.cpp $(OBJ)
$(CXX) $(CXXFLAGS) $(IOFLAGS) -c $< -o $@

$(OBJ)/%.o: $(SRC)/%.cpp $(OBJ)
$(CXX) $(CXXFLAGS) -c $< -o $@

Expand Down
2 changes: 2 additions & 0 deletions include/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ void NoPIDMsg();
void NoIVMsg();
void EndOfResults();

void WelcomeMessage();

#endif
7 changes: 5 additions & 2 deletions include/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#ifndef __STRINGS_H__
#define __STRINGS_H__

const char* BAR = "\n=============================\n";
const char* BAR = "\n=================================\n";
const char* LINK = "https://github.com/josemam/IV-PID";
extern const char* CHAINED_SHINY_METHOD;
const char* METHOD_[] = {CHAINED_SHINY_METHOD, "A-B-C-D", "A-B-D-E", "A-B-C-E", "A-B-D-F", "A-B-E-F"};
const char** METHOD = METHOD_ + 1;
Expand Down Expand Up @@ -34,6 +35,8 @@ extern const char
*NO_PID_MSG,
*IMPOSSIBLE_PID_MSG,
*END_OF_RESULTS_MSG,
*PAUSE_MSG;
*PAUSE_MSG,
*LICENSE,
*TEXT_BEFORE_GH_LINK;

#endif
5 changes: 5 additions & 0 deletions src/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,8 @@ void NoIVMsg() {
void EndOfResults() {
cout << "\n" << END_OF_RESULTS_MSG << ". ";
}

void WelcomeMessage() {
cout << BAR << "\n" << PROGRAM_NAME << " " << VERSION << " - "
<< LICENSE << " GPLv2\n" << TEXT_BEFORE_GH_LINK << ":\n" << LINK;
}
2 changes: 2 additions & 0 deletions src/iv-pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ modefunc modes[] = {
int nmodes = sizeof(modes)/sizeof(modefunc);

int main() {
WelcomeMessage();

char mode;
do {
mode = AskMode();
Expand Down
4 changes: 3 additions & 1 deletion src/strings_eng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ const char
*NO_PID_MSG = "No valid PID found",
*IMPOSSIBLE_PID_MSG = "That PID is impossible due to RNG mechanism",
*END_OF_RESULTS_MSG = "End of results",
*PAUSE_MSG = "Press any key to continue or Esc to exit...";
*PAUSE_MSG = "Press any key to continue or Esc to exit...",
*LICENSE = "License",
*TEXT_BEFORE_GH_LINK = "You can read the code, make\nsuggestions and report bugs at";
4 changes: 3 additions & 1 deletion src/strings_esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ const char
*NO_PID_MSG = "No se encontraron PID válidos",
*IMPOSSIBLE_PID_MSG = "Este PID es imposible debido a la naturaleza del RNG",
*END_OF_RESULTS_MSG = "Fin de los resultados",
*PAUSE_MSG = "Pulsa una tecla para seguir o Esc para salir...";
*PAUSE_MSG = "Pulsa una tecla para seguir o Esc para salir...",
*LICENSE = "Licencia",
*TEXT_BEFORE_GH_LINK = "Puedes ver el código, sugerir\ncambios y reportar errores en";

0 comments on commit 69f5dd2

Please sign in to comment.