[wiki] [sites] [slstatus][kanji]: removed c file and updated patch || Madison Lynch
commit 1424a5afe815328daef2f69966617b9abce67a44
Author: Madison Lynch <madi_AT_mxdi.xyz>
Date: Wed Dec 7 19:08:51 2022 -0800
[slstatus][kanji]: removed c file and updated patch
diff --git a/tools.suckless.org/slstatus/patches/kanji/index.md b/tools.suckless.org/slstatus/patches/kanji/index.md
index ad2c96d9..99a79909 100644
--- a/tools.suckless.org/slstatus/patches/kanji/index.md
+++ b/tools.suckless.org/slstatus/patches/kanji/index.md
_AT_@ -5,12 +5,9 @@ Description
-----------
This patch implements functionality to display the Japanese Kanji character corresponding with the current day of the week.
-Move `kanji.c` into the `components/` directory. Give make the `clean` argument when compiling.
-
Download
--------
* [slstatus-kanji.diff](slstatus-kanji.diff)
-* [kanji.c](kanji.c)
Author
------
diff --git a/tools.suckless.org/slstatus/patches/kanji/kanji.c b/tools.suckless.org/slstatus/patches/kanji/kanji.c
deleted file mode 100644
index 9397e336..00000000
--- a/tools.suckless.org/slstatus/patches/kanji/kanji.c
+++ /dev/null
_AT_@ -1,27 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include <time.h>
-
-const char *
-kanji() {
- time_t t=time(NULL);
- struct tm tm=*localtime(&t);
- static int map[]={0,3,2,5,0,3,5,1,4,6,2,4};
- int m=tm.tm_mon+1,y=tm.tm_year+1900;
- y-=m<3;
- int weekDay=(y+y/4-y/100+y/400+map[m-1]+tm.tm_mday)%7;
- if(weekDay==1) {
- return "月";
- } else if(weekDay==2) {
- return "火";
- } else if(weekDay==3) {
- return "水";
- } else if(weekDay==4) {
- return "木";
- } else if(weekDay==5) {
- return "金";
- } else if(weekDay ==6) {
- return "土";
- } else {
- return "日";
- }
-}
diff --git a/tools.suckless.org/slstatus/patches/kanji/slstatus-kanji.diff b/tools.suckless.org/slstatus/patches/kanji/slstatus-kanji.diff
index 435c57a0..225add6f 100644
--- a/tools.suckless.org/slstatus/patches/kanji/slstatus-kanji.diff
+++ b/tools.suckless.org/slstatus/patches/kanji/slstatus-kanji.diff
_AT_@ -1,6 +1,6 @@
--- b/config.def.h
+++ a/config.def.h
-_AT_@ -30,6 +30,7 @@
+_AT_@ -31,6 +31,7 @@
* hostname hostname NULL
* ipv4 IPv4 address interface name (eth0)
* ipv6 IPv6 address interface name (eth0)
_AT_@ -8,6 +8,23 @@
* kernel_release `uname -r` NULL
* keyboard_indicators caps/num lock indicators format string (c?n?)
* see keyboard_indicators.c
+--- a/components/kanji.c
++++ b/components/kanji.c
+_AT_@ -0,0 +1,14 @@
++/* See LICENSE file for copyright and license details. */
++#include <time.h>
++
++const char *
++kanji(const char *unused) {
++ char *kanji[]={"月","火","水","木","金","土","日"};
++ int map[]={0,3,2,5,0,3,5,1,4,6,2,4};
++ time_t t=time(NULL);
++ struct tm tm=*localtime(&t);
++ int m=tm.tm_mon+1,y=tm.tm_year+1900;
++ y-=m<3;
++ int wd=(y+y/4-y/100+y/400+map[m-1]+tm.tm_mday)%7;
++ return kanji[wd-1];
++}
--- a/Makefile
+++ b/Makefile
_AT_@ -14,6 +14,7 @@
Received on Thu Dec 08 2022 - 04:09:19 CET
This archive was generated by hypermail 2.3.0
: Thu Dec 08 2022 - 04:12:41 CET