mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-27 18:24:26 +00:00
bar: remove utf8.h, included with drwl
This commit is contained in:
parent
47258482e2
commit
7d7df32f29
@ -1,6 +1,6 @@
|
|||||||
From ba2a5fe24ff9856682bee1b93695d75d70d333e5 Mon Sep 17 00:00:00 2001
|
From c84dbb5d4fa84e37d9bf6addde065dc7d3b13ec5 Mon Sep 17 00:00:00 2001
|
||||||
From: sewn <sewn@disroot.org>
|
From: sewn <sewn@disroot.org>
|
||||||
Date: Sun, 14 Apr 2024 07:45:57 +0300
|
Date: Tue, 16 Apr 2024 23:58:41 +0300
|
||||||
Subject: [PATCH] Implement dwm bar clone
|
Subject: [PATCH] Implement dwm bar clone
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -10,12 +10,10 @@ Subject: [PATCH] Implement dwm bar clone
|
|||||||
config.def.h | 29 +++-
|
config.def.h | 29 +++-
|
||||||
drwl.h | 136 ++++++++++++++++++
|
drwl.h | 136 ++++++++++++++++++
|
||||||
dwl.c | 364 ++++++++++++++++++++++++++++++++++++++----------
|
dwl.c | 364 ++++++++++++++++++++++++++++++++++++++----------
|
||||||
utf8.h | 55 ++++++++
|
6 files changed, 497 insertions(+), 81 deletions(-)
|
||||||
7 files changed, 552 insertions(+), 81 deletions(-)
|
|
||||||
create mode 100644 LICENSE.drwl
|
create mode 100644 LICENSE.drwl
|
||||||
create mode 100644 LICENSE.utf8dec
|
create mode 100644 LICENSE.utf8dec
|
||||||
create mode 100644 drwl.h
|
create mode 100644 drwl.h
|
||||||
create mode 100644 utf8.h
|
|
||||||
|
|
||||||
diff --git a/LICENSE.drwl b/LICENSE.drwl
|
diff --git a/LICENSE.drwl b/LICENSE.drwl
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
@ -996,67 +994,6 @@ index bf763df..54273ae 100644
|
|||||||
|
|
||||||
if (c->isurgent && surface && surface->mapped)
|
if (c->isurgent && surface && surface->mapped)
|
||||||
client_set_border_color(c, urgentcolor);
|
client_set_border_color(c, urgentcolor);
|
||||||
diff --git a/utf8.h b/utf8.h
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..c7db188
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/utf8.h
|
|
||||||
@@ -0,0 +1,55 @@
|
|
||||||
+// Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
|
|
||||||
+// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
|
|
||||||
+
|
|
||||||
+// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
+// of this software and associated documentation files (the "Software"), to deal
|
|
||||||
+// in the Software without restriction, including without limitation the rights
|
|
||||||
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
+// copies of the Software, and to permit persons to whom the Software is
|
|
||||||
+// furnished to do so, subject to the following conditions:
|
|
||||||
+
|
|
||||||
+// The above copyright notice and this permission notice shall be included in
|
|
||||||
+// all copies or substantial portions of the Software.
|
|
||||||
+
|
|
||||||
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
+// SOFTWARE.
|
|
||||||
+
|
|
||||||
+#include <stdint.h>
|
|
||||||
+
|
|
||||||
+#define UTF8_ACCEPT 0
|
|
||||||
+#define UTF8_REJECT 1
|
|
||||||
+
|
|
||||||
+static const uint8_t utf8d[] = {
|
|
||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,1,1,1,1,1,3,1,3,1,1,1,1,1,1, // s5..s6
|
|
||||||
+ 1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // s7..s8
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+static inline uint32_t
|
|
||||||
+utf8decode(uint32_t *state, uint32_t *codep, uint8_t byte)
|
|
||||||
+{
|
|
||||||
+ uint32_t type = utf8d[byte];
|
|
||||||
+
|
|
||||||
+ *codep = (*state != UTF8_ACCEPT) ?
|
|
||||||
+ (byte & 0x3fu) | (*codep << 6) :
|
|
||||||
+ (0xff >> type) & (byte);
|
|
||||||
+
|
|
||||||
+ *state = utf8d[256 + *state*16 + type];
|
|
||||||
+ return *state;
|
|
||||||
+}
|
|
||||||
--
|
--
|
||||||
2.44.0
|
2.44.0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user