Skip to content

Commit

Permalink
Change namespace from gd100 to katerm
Browse files Browse the repository at this point in the history
  • Loading branch information
dextercd committed Aug 29, 2021
1 parent 4e4cb2a commit cab3444
Show file tree
Hide file tree
Showing 19 changed files with 80 additions and 80 deletions.
6 changes: 3 additions & 3 deletions fuzzing/fuzztest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ extern "C" int LLVMFuzzerTestOneInput(
std::uint8_t const* const bytes,
std::size_t const size)
{
gd100::decoder decoder;
gd100::terminal term{{132, 80}};
gd100::terminal_instructee instructee{&term};
katerm::decoder decoder;
katerm::terminal term{{132, 80}};
katerm::terminal_instructee instructee{&term};
decoder.decode(
reinterpret_cast<const char*>(bytes),
size,
Expand Down
4 changes: 2 additions & 2 deletions include/katerm/bit_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <type_traits>

namespace gd100 {
namespace katerm {

template<class bit_type>
class bit_container
Expand Down Expand Up @@ -44,6 +44,6 @@ class bit_container
}
};

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/colours.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "glyph.hpp"

namespace gd100 {
namespace katerm {

constexpr colour sgr_colours[16]{
{30, 30, 30}, // black
Expand Down Expand Up @@ -53,6 +53,6 @@ constexpr colour eight_bit_lookup(int index)
return {0, 0, 0};
}

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/glyph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "bit_container.hpp"
#include "position.hpp"

namespace gd100 {
namespace katerm {

enum class glyph_attr_bit {
text_wraps = 1 << 0,
Expand Down Expand Up @@ -55,6 +55,6 @@ struct glyph {
code_point code;
};

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/position.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <iosfwd>

namespace gd100 {
namespace katerm {

struct position {
int x;
Expand All @@ -22,6 +22,6 @@ struct position {

std::ostream& operator<<(std::ostream&, position);

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

#include <cstdint>

namespace gd100 {
namespace katerm {

class program {
public:
virtual void handle_bytes(char const*, std::size_t, bool more_data_coming) = 0;
virtual ~program() = default;
};

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/program_terminal_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "program.hpp"

namespace gd100 {
namespace katerm {

class program_terminal_manager {
public:
Expand Down Expand Up @@ -39,6 +39,6 @@ class program_terminal_manager {
std::unique_ptr<char[]> read_buffer;
};

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/terminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "terminal_data.hpp"
#include "terminal_decoder.hpp"

namespace gd100 {
namespace katerm {

class terminal {
friend struct terminal_instructee;
Expand Down Expand Up @@ -102,6 +102,6 @@ struct terminal_instructee : decoder_instructee {
};


} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/terminal_data.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef GDTERM_TERMINAL_DATA_HPP
#define GDTERM_TERMINAL_DATA_HPP

namespace gd100 {
namespace katerm {

enum cursor_state_bit {
wrap_next = 1 << 0,
Expand Down Expand Up @@ -42,6 +42,6 @@ enum class charset {
graphic0,
};

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/terminal_decoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "position.hpp"
#include "terminal_data.hpp"

namespace gd100 {
namespace katerm {

enum class direction {
up, down, forward, back
Expand Down Expand Up @@ -59,6 +59,6 @@ class decoder {
void decode(char const* bytes, int count, decoder_instructee& t);
};

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions include/katerm/terminal_screen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "glyph.hpp"

namespace gd100 {
namespace katerm {

struct line {
glyph* glyphs;
Expand Down Expand Up @@ -48,6 +48,6 @@ class terminal_screen {
void set_scroll(int scroll);
};

} // gd100::
} // katerm::

#endif // header guard
4 changes: 2 additions & 2 deletions src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include <katerm/position.hpp>

namespace gd100 {
namespace katerm {

std::ostream& operator<<(std::ostream& os, position const p)
{
return os << '(' << p.x << "; " << p.y << ')';
}

} // gd100::
} // katerm::
4 changes: 2 additions & 2 deletions src/terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <katerm/terminal_decoder.hpp>
#include <cw/character_width.hpp>

namespace gd100 {
namespace katerm {

static_assert(std::is_copy_assignable_v<terminal>);

Expand Down Expand Up @@ -306,4 +306,4 @@ void terminal::reset_style()
cursor.style = default_style;
}

} // gd100::
} // katerm::
4 changes: 2 additions & 2 deletions src/terminal_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <katerm/terminal_decoder.hpp>
#include <katerm/colours.hpp>

namespace gd100 {
namespace katerm {

namespace {

Expand Down Expand Up @@ -675,4 +675,4 @@ void decoder::decode(
};


} // gd100::
} // katerm::
4 changes: 2 additions & 2 deletions src/terminal_instructee.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <katerm/terminal.hpp>
#include <iostream>

namespace gd100 {
namespace katerm {

void terminal_instructee::tab()
{
Expand Down Expand Up @@ -239,4 +239,4 @@ void terminal_instructee::set_bracketed_paste(bool set)
term->mode.unset(terminal_mode_bit::bracketed_paste);
}

} // gd100::
} // katerm::
4 changes: 2 additions & 2 deletions src/terminal_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <katerm/terminal_screen.hpp>

namespace gd100 {
namespace katerm {

static_assert(std::is_copy_assignable_v<terminal_screen>);

Expand Down Expand Up @@ -82,4 +82,4 @@ void terminal_screen::set_scroll(int const scroll)
m_scroll = height + bounded;
}

} // gd100::
} // katerm::
6 changes: 3 additions & 3 deletions tests/decoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

TEST_CASE("utf-8", "[utf-8]") {
auto decode_utf8 = [](auto const& utf8) {
auto t = gd100::terminal{{10, 10}};
auto d = gd100::decoder{};
auto instructee = gd100::terminal_instructee{&t};
auto t = katerm::terminal{{10, 10}};
auto d = katerm::decoder{};
auto instructee = katerm::terminal_instructee{&t};

d.decode(utf8, sizeof(utf8) - 1, instructee);

Expand Down
6 changes: 3 additions & 3 deletions tests/regressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
template<std::size_t N>
void run(unsigned char (&crash_case)[N])
{
gd100::decoder decoder;
gd100::terminal term{{132, 80}};
gd100::terminal_instructee instructee{&term};
katerm::decoder decoder;
katerm::terminal term{{132, 80}};
katerm::terminal_instructee instructee{&term};
decoder.decode(
reinterpret_cast<const char*>(crash_case),
N, instructee);
Expand Down
Loading

0 comments on commit cab3444

Please sign in to comment.