diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/benoit.hh | 51 | ||||
-rw-r--r-- | include/benoit/archstr.hh | 6 | ||||
-rw-r--r-- | include/benoit/arghandl.hh | 4 | ||||
-rw-r--r-- | include/benoit/crtcfg.hh | 4 | ||||
-rw-r--r-- | include/benoit/dat.hh | 5 | ||||
-rw-r--r-- | include/benoit/exit.hh | 6 | ||||
-rw-r--r-- | include/benoit/helpscrn.hh | 4 | ||||
-rw-r--r-- | include/benoit/kernelstr.hh | 6 | ||||
-rw-r--r-- | include/benoit/loadcfg.hh | 4 | ||||
-rw-r--r-- | include/benoit/log.hh | 6 | ||||
-rw-r--r-- | include/benoit/logfunc.hh | 5 | ||||
-rw-r--r-- | include/benoit/logfuncret.hh | 5 | ||||
-rw-r--r-- | include/benoit/main.hh | 4 | ||||
-rw-r--r-- | include/benoit/plotmandelbrot.hh | 6 | ||||
-rw-r--r-- | include/benoit/print.hh | 6 | ||||
-rw-r--r-- | include/benoit/t/arch.hh | 12 | ||||
-rw-r--r-- | include/benoit/t/dat.hh | 65 | ||||
-rw-r--r-- | include/benoit/t/imgfmt.hh | 10 | ||||
-rw-r--r-- | include/benoit/t/kernel.hh | 16 | ||||
-rw-r--r-- | include/benoit/t/pos.hh | 13 | ||||
-rw-r--r-- | include/benoit/t/thrddat.hh | 15 |
21 files changed, 202 insertions, 51 deletions
diff --git a/include/benoit.hh b/include/benoit.hh deleted file mode 100644 index 906b42f..0000000 --- a/include/benoit.hh +++ /dev/null @@ -1,51 +0,0 @@ -# if !defined(BENOIT__HEADER) -# define BENOIT__HEADER -# include <boost/multiprecision/mpfr.hpp> -# include <cstddef> -# include <cstdint> -# include <string> -# include <vector> -static_assert(((sizeof(short) < 0x10) && (sizeof(int) < 0x20) && (sizeof(long) < 0x20) && (sizeof(long long) < 0x40) && (sizeof(void *) < 0x40)),"Benoit expects at least an LLP64 data model."); -using namespace std::literals::string_literals; -class benoit { -public: - [[noreturn]] benoit(int const argc,char const * * argv) noexcept; - [[noreturn]] ~benoit() noexcept; -private: - class t { - public: - enum class imgfmt { - png, - ppm, - webp, - }; - class pos { - public: - boost::multiprecision::mpfr_float x = 0x0; - boost::multiprecision::mpfr_float y = 0x0; - pos(boost::multiprecision::mpfr_float x = 0x0,boost::multiprecision::mpfr_float y = 0x0); - }; - }; - benoit::t::imgfmt imgfmt = benoit::t::imgfmt::ppm; - benoit::t::pos pos; - bool constexpr static debug = -# if defined(NDEBUG) - false; -# else - true; -# endif - std::string outimg = "image"; - unsigned short resx = 0x2000u; - unsigned short resy = 0x2000u; - unsigned short numthreads = 0x16u; - long double zoom = 0x1p0; - long long ver = 0x5ll; - unsigned long long maxiter = 0x400ull; - std::vector<std::uint8_t> plotmandelbrot(); - void arghandl(int const & argc,char const * * & argv); - [[noreturn]] void exit(int code,std::string msg = ""s) noexcept; - void notiffunc(std::string const callfuncname); - void print(char const * msg,bool stderr = false); - void print(std::string msg,bool stderr = false); -}; -# endif diff --git a/include/benoit/archstr.hh b/include/benoit/archstr.hh new file mode 100644 index 0000000..3403d6a --- /dev/null +++ b/include/benoit/archstr.hh @@ -0,0 +1,6 @@ +# pragma once +# include <benoit/t/arch.hh> +# include <string> +namespace benoit { + std::string archstr(benoit::t::arch arch) noexcept; +} diff --git a/include/benoit/arghandl.hh b/include/benoit/arghandl.hh new file mode 100644 index 0000000..4060149 --- /dev/null +++ b/include/benoit/arghandl.hh @@ -0,0 +1,4 @@ +# pragma once +namespace benoit { + void arghandl(int const & argc,char const * * & argv); +} diff --git a/include/benoit/crtcfg.hh b/include/benoit/crtcfg.hh new file mode 100644 index 0000000..957399e --- /dev/null +++ b/include/benoit/crtcfg.hh @@ -0,0 +1,4 @@ +# pragma once +namespace benoit { + void crtcfg(); +} diff --git a/include/benoit/dat.hh b/include/benoit/dat.hh new file mode 100644 index 0000000..7c4e7cf --- /dev/null +++ b/include/benoit/dat.hh @@ -0,0 +1,5 @@ +# pragma once +# include <benoit/t/dat.hh> +namespace benoit { + benoit::t::dat extern dat; +} diff --git a/include/benoit/exit.hh b/include/benoit/exit.hh new file mode 100644 index 0000000..bcf487d --- /dev/null +++ b/include/benoit/exit.hh @@ -0,0 +1,6 @@ +# pragma once +# include <string> +using namespace std::string_literals; +namespace benoit { + [[noreturn]] void exit(int code,std::string msg = ""s) noexcept; +} diff --git a/include/benoit/helpscrn.hh b/include/benoit/helpscrn.hh new file mode 100644 index 0000000..66eea36 --- /dev/null +++ b/include/benoit/helpscrn.hh @@ -0,0 +1,4 @@ +# pragma once +namespace benoit { + [[noreturn]] void helpscrn() noexcept; +} diff --git a/include/benoit/kernelstr.hh b/include/benoit/kernelstr.hh new file mode 100644 index 0000000..9ad0746 --- /dev/null +++ b/include/benoit/kernelstr.hh @@ -0,0 +1,6 @@ +# pragma once +# include <benoit/t/kernel.hh> +# include <string> +namespace benoit { + std::string kernelstr(benoit::t::kernel kernel) noexcept; +} diff --git a/include/benoit/loadcfg.hh b/include/benoit/loadcfg.hh new file mode 100644 index 0000000..10273b0 --- /dev/null +++ b/include/benoit/loadcfg.hh @@ -0,0 +1,4 @@ +# pragma once +namespace benoit { + void loadcfg(); +} diff --git a/include/benoit/log.hh b/include/benoit/log.hh new file mode 100644 index 0000000..6c04e76 --- /dev/null +++ b/include/benoit/log.hh @@ -0,0 +1,6 @@ +# pragma once +# include <string> +namespace benoit { + void log(std::string msg); + void log(std::string const func,std::string msg); +} diff --git a/include/benoit/logfunc.hh b/include/benoit/logfunc.hh new file mode 100644 index 0000000..35daec8 --- /dev/null +++ b/include/benoit/logfunc.hh @@ -0,0 +1,5 @@ +# pragma once +# include <string> +namespace benoit { + void logfunc(std::string const func); +} diff --git a/include/benoit/logfuncret.hh b/include/benoit/logfuncret.hh new file mode 100644 index 0000000..1db2e41 --- /dev/null +++ b/include/benoit/logfuncret.hh @@ -0,0 +1,5 @@ +# pragma once +# include <string> +namespace benoit { + void logfuncret(std::string const func); +} diff --git a/include/benoit/main.hh b/include/benoit/main.hh new file mode 100644 index 0000000..72e7051 --- /dev/null +++ b/include/benoit/main.hh @@ -0,0 +1,4 @@ +# pragma once +namespace benoit { + [[noreturn]] void main(int const argc,char const * * argv) noexcept; +} diff --git a/include/benoit/plotmandelbrot.hh b/include/benoit/plotmandelbrot.hh new file mode 100644 index 0000000..3d8b57a --- /dev/null +++ b/include/benoit/plotmandelbrot.hh @@ -0,0 +1,6 @@ +# pragma once +# include <cstdint> +# include <vector> +namespace benoit { + std::vector<std::uint8_t> plotmandelbrot(); +} diff --git a/include/benoit/print.hh b/include/benoit/print.hh new file mode 100644 index 0000000..64ad638 --- /dev/null +++ b/include/benoit/print.hh @@ -0,0 +1,6 @@ +# pragma once +# include <string> +namespace benoit { + void print(char const * msg,bool stderr = false); + void print(std::string msg,bool stderr = false); +} diff --git a/include/benoit/t/arch.hh b/include/benoit/t/arch.hh new file mode 100644 index 0000000..622e70d --- /dev/null +++ b/include/benoit/t/arch.hh @@ -0,0 +1,12 @@ +# pragma once +namespace benoit { + namespace t { + enum class arch { + aarch64, + amd64, + ia64, + ppc64, + unknown, + }; + } +} diff --git a/include/benoit/t/dat.hh b/include/benoit/t/dat.hh new file mode 100644 index 0000000..c43784b --- /dev/null +++ b/include/benoit/t/dat.hh @@ -0,0 +1,65 @@ +# pragma once +# include <benoit/t/arch.hh> +# include <benoit/t/imgfmt.hh> +# include <benoit/t/kernel.hh> +# include <benoit/t/pos.hh> +# include <string> +# include <vector> +using namespace std::literals::string_literals; +namespace benoit { + namespace t { + class dat { + public: + benoit::t::arch constexpr static arch = +# if defined(__aarch64__) + benoit::t::arch::aarch64; +# elif (defined(_M_AMD64) || defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(x86_64__)) + benoit::t::arch::amd64; +# elif (defined(_IA64) defined(_M_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__itanium__)) + benoit::t::arch::ia64; +# elif (defined(_ARCH_PPC64) || defined(__powerpc64__) || defined(__PPC64__) || defined(__ppc64__)) + benoit::t::arch::ppc64; +# else + benoit::t::arch::unknown; +# endif + benoit::t::imgfmt imgfmt = benoit::t::imgfmt::ppm; + benoit::t::kernel constexpr static kernel = +# if (defined(Macintosh) || defined(macintosh) || defined(__APPLE__) || defined(__MACH__)) + benoit::t::kernel::darwinos; +# elif defined(__DragonFly__) + benoit::t::kernel::dragonflybsd; +# elif defined(__FreeBSD__) + benoit::t::kernel::freebsd; +# elif (defined(__GNU__) || defined(__gnu_hurd__)) + benoit::t::kernel::hurd; +# elif defined(__linux__) + benoit::t::kernel::linux; +# elif defined(__minix) + benoit::t::kernel::minix; +# elif defined(__NetBSD__) + benoit::t::kernel::netbsd; +# elif defined(__OpenBSD__) + benoit::t::kernel::openbsd; +# else + benoit::t::kernel::unknown; +# endif + benoit::t::pos pos; + bool dobt = false; + bool printdolog = true; + bool debug = +# if defined(NDEBUG) + false; +# else + true; +# endif + long long ver = 0x5; + std::string cfg = "benoit.xml"s; + std::string outimg = "image"s; + std::vector<std::string> thelog = {}; + unsigned long long maxiter = 0x100ull; + unsigned numthrds = 0x1u; + unsigned resx = 0x100u; + unsigned resy = 0x100u; + }; + } +} diff --git a/include/benoit/t/imgfmt.hh b/include/benoit/t/imgfmt.hh new file mode 100644 index 0000000..ffd6367 --- /dev/null +++ b/include/benoit/t/imgfmt.hh @@ -0,0 +1,10 @@ +# pragma once +namespace benoit { + namespace t { + enum class imgfmt { + png, + ppm, + webp, + }; + } +} diff --git a/include/benoit/t/kernel.hh b/include/benoit/t/kernel.hh new file mode 100644 index 0000000..099dd60 --- /dev/null +++ b/include/benoit/t/kernel.hh @@ -0,0 +1,16 @@ +# pragma once +namespace benoit { + namespace t { + enum class kernel { + darwinos, + dragonflybsd, + freebsd, + hurd, + linux, + minix, + netbsd, + openbsd, + unknown, + }; + } +} diff --git a/include/benoit/t/pos.hh b/include/benoit/t/pos.hh new file mode 100644 index 0000000..4725bb6 --- /dev/null +++ b/include/benoit/t/pos.hh @@ -0,0 +1,13 @@ +# pragma once +# include <boost/multiprecision/mpfr.hpp> +namespace benoit { + namespace t { + class pos { + public: + pos(boost::multiprecision::mpfr_float x = 0x0,boost::multiprecision::mpfr_float y = 0x0); + boost::multiprecision::mpfr_float x = 0x0; + boost::multiprecision::mpfr_float y = 0x0; + boost::multiprecision::mpfr_float zoom = 0x0; + }; + } +} diff --git a/include/benoit/t/thrddat.hh b/include/benoit/t/thrddat.hh new file mode 100644 index 0000000..75c8a05 --- /dev/null +++ b/include/benoit/t/thrddat.hh @@ -0,0 +1,15 @@ +# pragma once +# include <cstdint> +# include <pthread.h> +# include <vector> +namespace benoit { + namespace t { + class thrddat { + public: + pthread_t * thrd = nullptr; + std::vector<std::uint8_t> * img = nullptr; + unsigned * rows = nullptr; + unsigned * id = nullptr; + }; + } +} |