From e867de371ed9d38a3e4f51927c8a25a5e8261020 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 1 Aug 2018 20:26:38 +0800 Subject: *update --- build/.vs/libjin/v14/.suo | Bin 227328 -> 116224 bytes build/libjin/libjin.vcxproj | 25 +++-- build/libjin/libjin.vcxproj.filters | 82 ++++++++------- libjin/Common/Object.cpp | 32 ++++++ libjin/Common/Object.h | 49 +++++++++ libjin/Common/StringMap.hpp | 143 +++++++++++++++++++++++++++ libjin/Common/utf8.cpp | 40 ++++++++ libjin/Common/utf8.h | 31 ++++++ libjin/Core/Game.cpp | 4 +- libjin/Thread/Thread.h | 14 ++- libjin/Tools/CSV/CSV.cpp | 0 libjin/Tools/CSV/CSV.h | 1 - libjin/Tools/Component/Component.h | 30 ------ libjin/Tools/Component/GameObject.h | 40 -------- libjin/Tools/EventMsgCenter/EventMsgCenter.h | 20 ---- libjin/Tools/EventMsgCenter/Events.h | 20 ---- libjin/Tools/Json/Json.cpp | 0 libjin/Tools/Json/Json.h | 1 - libjin/Tools/XML/XML.cpp | 0 libjin/Tools/XML/XML.h | 1 - libjin/Utils/CSV/CSV.cpp | 0 libjin/Utils/CSV/CSV.h | 1 + libjin/Utils/Component/Component.h | 30 ++++++ libjin/Utils/Component/GameObject.h | 40 ++++++++ libjin/Utils/EventMsgCenter/EventMsgCenter.h | 20 ++++ libjin/Utils/EventMsgCenter/Events.h | 20 ++++ libjin/Utils/Json/Json.cpp | 0 libjin/Utils/Json/Json.h | 1 + libjin/Utils/XML/XML.cpp | 0 libjin/Utils/XML/XML.h | 1 + libjin/jin.h | 8 +- libjin/modules.h | 13 ++- test/01HelloWorld/main.cpp | 4 +- 33 files changed, 503 insertions(+), 168 deletions(-) create mode 100644 libjin/Common/Object.cpp create mode 100644 libjin/Common/Object.h create mode 100644 libjin/Common/StringMap.hpp create mode 100644 libjin/Common/utf8.cpp create mode 100644 libjin/Common/utf8.h delete mode 100644 libjin/Tools/CSV/CSV.cpp delete mode 100644 libjin/Tools/CSV/CSV.h delete mode 100644 libjin/Tools/Component/Component.h delete mode 100644 libjin/Tools/Component/GameObject.h delete mode 100644 libjin/Tools/EventMsgCenter/EventMsgCenter.h delete mode 100644 libjin/Tools/EventMsgCenter/Events.h delete mode 100644 libjin/Tools/Json/Json.cpp delete mode 100644 libjin/Tools/Json/Json.h delete mode 100644 libjin/Tools/XML/XML.cpp delete mode 100644 libjin/Tools/XML/XML.h create mode 100644 libjin/Utils/CSV/CSV.cpp create mode 100644 libjin/Utils/CSV/CSV.h create mode 100644 libjin/Utils/Component/Component.h create mode 100644 libjin/Utils/Component/GameObject.h create mode 100644 libjin/Utils/EventMsgCenter/EventMsgCenter.h create mode 100644 libjin/Utils/EventMsgCenter/Events.h create mode 100644 libjin/Utils/Json/Json.cpp create mode 100644 libjin/Utils/Json/Json.h create mode 100644 libjin/Utils/XML/XML.cpp create mode 100644 libjin/Utils/XML/XML.h diff --git a/build/.vs/libjin/v14/.suo b/build/.vs/libjin/v14/.suo index 90cd23a..50ddad7 100644 Binary files a/build/.vs/libjin/v14/.suo and b/build/.vs/libjin/v14/.suo differ diff --git a/build/libjin/libjin.vcxproj b/build/libjin/libjin.vcxproj index 32422b3..4f90bf7 100644 --- a/build/libjin/libjin.vcxproj +++ b/build/libjin/libjin.vcxproj @@ -30,6 +30,8 @@ + + @@ -49,11 +51,11 @@ - - - + + + @@ -71,8 +73,11 @@ + + + @@ -106,18 +111,18 @@ - - - - - - - + + + + + + + diff --git a/build/libjin/libjin.vcxproj.filters b/build/libjin/libjin.vcxproj.filters index c302314..da3ea05 100644 --- a/build/libjin/libjin.vcxproj.filters +++ b/build/libjin/libjin.vcxproj.filters @@ -55,9 +55,6 @@ {ea9c11c8-1d83-441b-a1aa-e7fb85abd615} - - {1819939a-8bb4-4635-938d-4b054de6da5e} - {32b0ca98-fc83-411a-8668-e65fb2ac3381} @@ -70,23 +67,23 @@ {c2b1ec18-2952-4461-92d3-79226870e1a2} - - {024367d0-1607-463c-b094-41f2c0fd1e99} - {53e06a65-a5ba-41d8-a1f6-6fb5680207ba} - - {5685d2ab-4373-4b9c-9cd1-634b1916b09c} + + {4d34f3cf-9165-41c5-9070-10442e9fed73} - - {712750f2-e78b-46a4-b837-55fd4486b3bd} + + {fc249b2b-dbab-41f0-b507-331ce4db0899} - - {0fb5fedc-24df-47f0-a90f-a20e21baa90c} + + {bd893cbe-82a4-4c49-a398-a126a312d4fb} - - {52a242f9-da0d-4c1d-a6ea-5ad17557feae} + + {5b6076d6-40ea-4ca3-a427-77def412d945} + + + {5b1e81c7-866a-414e-a976-48aebfd57225} @@ -186,14 +183,20 @@ Tilemap - - Tools\XML + + Common + + + Common + + + Utils\CSV - - Tools\Json + + Utils\Json - - Tools\CSV + + Utils\XML @@ -335,9 +338,6 @@ UI - - Tools\EventMsgCenter - Tilemap @@ -361,23 +361,35 @@ Common - - Tools\Component + + Common + + + Common + + + Common + + + Utils\Component + + + Utils\Component - - Tools\Component + + Utils\CSV - - Tools\EventMsgCenter + + Utils\EventMsgCenter - - Tools\XML + + Utils\EventMsgCenter - - Tools\Json + + Utils\Json - - Tools\CSV + + Utils\XML diff --git a/libjin/Common/Object.cpp b/libjin/Common/Object.cpp new file mode 100644 index 0000000..6c3b667 --- /dev/null +++ b/libjin/Common/Object.cpp @@ -0,0 +1,32 @@ +// LOVE +#include "Object.h" + +namespace jin +{ + + Object::Object() + : count(1) + { + } + + Object::~Object() + { + } + + int Object::getReferenceCount() const + { + return count; + } + + void Object::retain() + { + ++count; + } + + void Object::release() + { + if (--count <= 0) + delete this; + } + +} // love diff --git a/libjin/Common/Object.h b/libjin/Common/Object.h new file mode 100644 index 0000000..9ac1b5a --- /dev/null +++ b/libjin/Common/Object.h @@ -0,0 +1,49 @@ +#ifndef __JIN_COMMON_OBJECT_H +#define __JIN_COMMON_OBJECT_H + +namespace jin +{ + + class Object + { + private: + + // The reference count. + int count; + + public: + + /** + * Constructor. Sets reference count to one. + **/ + Object(); + + /** + * Destructor. + **/ + virtual ~Object() = 0; + + /** + * Gets the reference count of this Object. + * @returns The reference count. + **/ + int getReferenceCount() const; + + /** + * Retains the Object, i.e. increases the + * reference count by one. + **/ + void retain(); + + /** + * Releases one reference to the Object, i.e. decrements the + * reference count by one, and potentially deletes the Object + * if there are no more references. + **/ + void release(); + + }; // Object + +} + +#endif \ No newline at end of file diff --git a/libjin/Common/StringMap.hpp b/libjin/Common/StringMap.hpp new file mode 100644 index 0000000..bebd94d --- /dev/null +++ b/libjin/Common/StringMap.hpp @@ -0,0 +1,143 @@ +#ifndef __JIN_COMMON_SREINGMAP_H +#define __JIN_COMMON_SREINGMAP_H + +namespace jin +{ + + template + class StringMap + { + private: + + struct Record + { + const char * key; + T value; + bool set; + Record() : set(false) {} + }; + + const static unsigned MAX = SIZE * 2; + + Record records[MAX]; + const char * reverse[SIZE]; + + public: + + struct Entry + { + const char * key; + T value; + }; + + StringMap(Entry * entries, unsigned num) + { + + for (unsigned i = 0; i < SIZE; ++i) + reverse[i] = 0; + + unsigned n = num / sizeof(Entry); + + for (unsigned i = 0; i < n; ++i) + { + add(entries[i].key, entries[i].value); + } + } + + bool streq(const char * a, const char * b) + { + while (*a != 0 && *b != 0) + { + if (*a != *b) + return false; + ++a; + ++b; + } + + return (*a == 0 && *b == 0); + } + + bool find(const char * key, T & t) + { + //unsigned str_hash = djb2(key); + + for (unsigned i = 0; i < MAX; ++i) + { + //unsigned str_i = (str_hash + i) % MAX; //this isn't used, is this intentional? + + if (records[i].set && streq(records[i].key, key)) + { + t = records[i].value; + return true; + } + } + + return false; + } + + bool find(T key, const char *& str) + { + unsigned index = (unsigned)key; + + if (index >= SIZE) + return false; + + if (reverse[index] != 0) + { + str = reverse[index]; + return true; + } + else + { + return false; + } + } + + bool add(const char * key, T value) + { + unsigned str_hash = djb2(key); + bool inserted = false; + + for (unsigned i = 0; i < MAX; ++i) + { + unsigned str_i = (str_hash + i) % MAX; + + if (!records[str_i].set) + { + inserted = true; + records[str_i].set = true; + records[str_i].key = key; + records[str_i].value = value; + break; + } + } + + unsigned index = (unsigned)value; + + if (index >= SIZE) + { + printf("\nConstant %s out of bounds with %i!\n", key, index); + return false; + } + + reverse[index] = key; + + return inserted; + } + + unsigned djb2(const char * key) + { + unsigned hash = 5381; + int c; + + while ((c = *key++)) + hash = ((hash << 5) + hash) + c; + + return hash; + } + + }; // StringMap + +} + +#endif \ No newline at end of file diff --git a/libjin/Common/utf8.cpp b/libjin/Common/utf8.cpp new file mode 100644 index 0000000..3826d20 --- /dev/null +++ b/libjin/Common/utf8.cpp @@ -0,0 +1,40 @@ +#include "../modules.h" +#if JIN_OS == JIN_WINDOWS + +#include "utf8.h" + +namespace jin +{ + std::string to_utf8(LPCWSTR wstr) + { + size_t wide_len = wcslen(wstr) + 1; + + // Get size in UTF-8. + int utf8_size = WideCharToMultiByte(CP_UTF8, 0, wstr, wide_len, 0, 0, 0, 0); + + char * utf8_str = new char[utf8_size]; + + // Convert to UTF-8. + int ok = WideCharToMultiByte(CP_UTF8, 0, wstr, wide_len, utf8_str, utf8_size, 0, 0); + + if (!ok) + { + delete[] utf8_str; + } + + return ok ? std::string(utf8_str) : std::string(); + } + + void replace_char(std::string & str, char find, char replace) + { + int length = str.length(); + + for (int i = 0; i +#include + +namespace jin +{ + + /** + * Convert the wide string to a UTF-8 encoded string. + * @param wstr The wide-char string. + * @return A UTF-8 string. + **/ + std::string to_utf8(LPCWSTR wstr); + + /** + * Replace all occurences of 'find' with 'replace' in a string. + * @param str The string to modify. + * @param find The character to match. + * @param replace The character to replace matches. + **/ + void replace_char(std::string & str, char find, char replace); + +} + +#endif // JIN_OS == JIN_WINDOWS +#endif // __JIN_COMMON_UTF8_H \ No newline at end of file diff --git a/libjin/Core/Game.cpp b/libjin/Core/Game.cpp index c5dd5a5..b480b12 100644 --- a/libjin/Core/Game.cpp +++ b/libjin/Core/Game.cpp @@ -32,7 +32,7 @@ namespace core while (jin::input::pollEvent(&e)) { SAFECALL(_onEvent, &e); - if (!_running) goto stoploop; + if (!_running) goto quitloop; } SAFECALL(_onUpdate, dt); SAFECALL(_onDraw); @@ -49,7 +49,7 @@ namespace core else previous = current; } - stoploop:; + quitloop:; } bool Game::initSystem(const SettingBase* setting) diff --git a/libjin/Thread/Thread.h b/libjin/Thread/Thread.h index f736407..9d38d72 100644 --- a/libjin/Thread/Thread.h +++ b/libjin/Thread/Thread.h @@ -3,6 +3,10 @@ #include "../modules.h" #if JIN_MODULES_THREAD +#if JIN_THREAD_SDL +#include "SDL2/SDL_thread.h" +#endif // JIN_THREAD_SDL + namespace jin { namespace thread @@ -10,7 +14,15 @@ namespace thread class Thread { - + public: + void start(); + void kill(); + void wait(); + const char* getName() const; + void recerive(); + void demand(); + void peek(); + void send(); }; } diff --git a/libjin/Tools/CSV/CSV.cpp b/libjin/Tools/CSV/CSV.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/libjin/Tools/CSV/CSV.h b/libjin/Tools/CSV/CSV.h deleted file mode 100644 index 6f70f09..0000000 --- a/libjin/Tools/CSV/CSV.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/libjin/Tools/Component/Component.h b/libjin/Tools/Component/Component.h deleted file mode 100644 index 12c347a..0000000 --- a/libjin/Tools/Component/Component.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __JIN_TOOLS_COMPONENT_H -#define __JIN_TOOLS_COMPONENT_H -#include "../../modules.h" -#if JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT - -namespace jin -{ -namespace tools -{ - - class GameObject; - - class Component - { - public: - Component(GameObject* obj) - : gameObject(obj) - {} - - virtual void update(float dt) = 0; - - private: - GameObject* gameObject; - }; - -} // tools -} // jin - -#endif // JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT -#endif // __JIN_TOOLS_COMPONENT_H \ No newline at end of file diff --git a/libjin/Tools/Component/GameObject.h b/libjin/Tools/Component/GameObject.h deleted file mode 100644 index aac9e6b..0000000 --- a/libjin/Tools/Component/GameObject.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef __JIN_TOOLS_GAMEOBJECT_H -#define __JIN_TOOLS_GAMEOBJECT_H -#include "../../modules.h" -#if JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT - -#include -#include "Component.h" - -namespace jin -{ -namespace tools -{ - - class GameObject - { - public: - - GameObject() - : components() - { - } - - virtual void update(float dt) - { - for each (Component* component in components) - component->update(dt); - } - - virtual void draw() = 0; - - protected: - - std::vector components; - }; - -} // tools -} // jin - -#endif // JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT -#endif // __JIN_TOOLS_GAMEOBJECT_H \ No newline at end of file diff --git a/libjin/Tools/EventMsgCenter/EventMsgCenter.h b/libjin/Tools/EventMsgCenter/EventMsgCenter.h deleted file mode 100644 index a679f06..0000000 --- a/libjin/Tools/EventMsgCenter/EventMsgCenter.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __JIN_TOOLS_EVENTMSGCENTER_H -#define __JIN_TOOLS_EVENTMSGCENTER_H -#include "../../modules.h" -#if JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER - -namespace jin -{ -namespace tools -{ - - class EventMSGCenter - { - - }; - -} // tools -} // jin - -#endif // JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER -#endif // __JIN_TOOLS_EVENTMSGCENTER_H \ No newline at end of file diff --git a/libjin/Tools/EventMsgCenter/Events.h b/libjin/Tools/EventMsgCenter/Events.h deleted file mode 100644 index 698dfbc..0000000 --- a/libjin/Tools/EventMsgCenter/Events.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __JIN_TOOLS_EVENTS_H -#define __JIN_TOOLS_EVENTS_H -#include "../../modules.h" -#if JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER - -namespace jin -{ -namespace tools -{ - - enum Event - { - - }; - -} // tools -} // jin - -#endif // JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER -#endif // __JIN_TOOLS_EVENTS_H \ No newline at end of file diff --git a/libjin/Tools/Json/Json.cpp b/libjin/Tools/Json/Json.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/libjin/Tools/Json/Json.h b/libjin/Tools/Json/Json.h deleted file mode 100644 index 6f70f09..0000000 --- a/libjin/Tools/Json/Json.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/libjin/Tools/XML/XML.cpp b/libjin/Tools/XML/XML.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/libjin/Tools/XML/XML.h b/libjin/Tools/XML/XML.h deleted file mode 100644 index 6f70f09..0000000 --- a/libjin/Tools/XML/XML.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once diff --git a/libjin/Utils/CSV/CSV.cpp b/libjin/Utils/CSV/CSV.cpp new file mode 100644 index 0000000..e69de29 diff --git a/libjin/Utils/CSV/CSV.h b/libjin/Utils/CSV/CSV.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/libjin/Utils/CSV/CSV.h @@ -0,0 +1 @@ +#pragma once diff --git a/libjin/Utils/Component/Component.h b/libjin/Utils/Component/Component.h new file mode 100644 index 0000000..f63fb59 --- /dev/null +++ b/libjin/Utils/Component/Component.h @@ -0,0 +1,30 @@ +#ifndef __JIN_TOOLS_COMPONENT_H +#define __JIN_TOOLS_COMPONENT_H +#include "../../modules.h" +#if JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT + +namespace jin +{ +namespace utils +{ + + class GameObject; + + class Component + { + public: + Component(GameObject* obj) + : gameObject(obj) + {} + + virtual void update(float dt) = 0; + + private: + GameObject* gameObject; + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT +#endif // __JIN_TOOLS_COMPONENT_H \ No newline at end of file diff --git a/libjin/Utils/Component/GameObject.h b/libjin/Utils/Component/GameObject.h new file mode 100644 index 0000000..e4f3aa5 --- /dev/null +++ b/libjin/Utils/Component/GameObject.h @@ -0,0 +1,40 @@ +#ifndef __JIN_TOOLS_GAMEOBJECT_H +#define __JIN_TOOLS_GAMEOBJECT_H +#include "../../modules.h" +#if JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT + +#include +#include "Component.h" + +namespace jin +{ +namespace utils +{ + + class GameObject + { + public: + + GameObject() + : components() + { + } + + virtual void update(float dt) + { + for each (Component* component in components) + component->update(dt); + } + + virtual void draw() = 0; + + protected: + + std::vector components; + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT +#endif // __JIN_TOOLS_GAMEOBJECT_H \ No newline at end of file diff --git a/libjin/Utils/EventMsgCenter/EventMsgCenter.h b/libjin/Utils/EventMsgCenter/EventMsgCenter.h new file mode 100644 index 0000000..6717b83 --- /dev/null +++ b/libjin/Utils/EventMsgCenter/EventMsgCenter.h @@ -0,0 +1,20 @@ +#ifndef __JIN_TOOLS_EVENTMSGCENTER_H +#define __JIN_TOOLS_EVENTMSGCENTER_H +#include "../../modules.h" +#if JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER + +namespace jin +{ +namespace utils +{ + + class EventMSGCenter + { + + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER +#endif // __JIN_TOOLS_EVENTMSGCENTER_H \ No newline at end of file diff --git a/libjin/Utils/EventMsgCenter/Events.h b/libjin/Utils/EventMsgCenter/Events.h new file mode 100644 index 0000000..9ebc30d --- /dev/null +++ b/libjin/Utils/EventMsgCenter/Events.h @@ -0,0 +1,20 @@ +#ifndef __JIN_TOOLS_EVENTS_H +#define __JIN_TOOLS_EVENTS_H +#include "../../modules.h" +#if JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER + +namespace jin +{ +namespace utils +{ + + enum Event + { + + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER +#endif // __JIN_TOOLS_EVENTS_H \ No newline at end of file diff --git a/libjin/Utils/Json/Json.cpp b/libjin/Utils/Json/Json.cpp new file mode 100644 index 0000000..e69de29 diff --git a/libjin/Utils/Json/Json.h b/libjin/Utils/Json/Json.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/libjin/Utils/Json/Json.h @@ -0,0 +1 @@ +#pragma once diff --git a/libjin/Utils/XML/XML.cpp b/libjin/Utils/XML/XML.cpp new file mode 100644 index 0000000..e69de29 diff --git a/libjin/Utils/XML/XML.h b/libjin/Utils/XML/XML.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/libjin/Utils/XML/XML.h @@ -0,0 +1 @@ +#pragma once diff --git a/libjin/jin.h b/libjin/jin.h index d32731d..4624669 100644 --- a/libjin/jin.h +++ b/libjin/jin.h @@ -14,9 +14,9 @@ #include "Graphics/Graphics.h" #include "Time/Timer.h" -#define JIN_VERSION "Jin 0.1" -#define JIN_RELEASE "Jin 0.1.1" -#define JIN_VERSION_NUM 101 -#define JIN_AUTHOR "Chai" +const char* JIN_VERSION = "Jin 0.1"; +const char* JIN_AUTHOR = "Chai"; +const char* JIN_RELEASE = "Jin 0.1.1"; +const int JIN_VERSION_NUM = 101; #endif // __JIN_H \ No newline at end of file diff --git a/libjin/modules.h b/libjin/modules.h index 171c691..3e830b1 100644 --- a/libjin/modules.h +++ b/libjin/modules.h @@ -37,14 +37,25 @@ #define JIN_TOOLS_JSON 1 #define JIN_MODULES_THREAD 1 +#define JIN_THREAD_SDL 1 #define JIN_MODULES_TIME 1 #define JIN_TIME_SDL 1 /* -* ¿ªÆôDebug +* Open libjin debug */ #define JIN_DEBUG 1 +/* +* Operating system +*/ + +#define JIN_WINDOWS 1 +#define JIN_MACOS 2 +#define JIN_LINUX 3 + +#define JIN_OS JIN_WINDOWS + #endif \ No newline at end of file diff --git a/test/01HelloWorld/main.cpp b/test/01HelloWorld/main.cpp index a1b1a70..62c059f 100644 --- a/test/01HelloWorld/main.cpp +++ b/test/01HelloWorld/main.cpp @@ -12,14 +12,14 @@ void onEvent(jin::input::Event* e) game->stop(); } -void onUpdate(int dt) +void onUpdate(int ms) { } void onDraw() { - + } int main(int argc, char* argv[]) -- cgit v1.1-26-g67d0