Re: [hackers] [slstatus][PATCH] separator module

2020-11-30 Thread Aaron Marcher

Thank you very much, applied to master.

On 19-03-30 Sat, Ryan Kes wrote:

---
Makefile   |  1 +
components/separator.c | 10 ++
config.def.h   |  1 +
slstatus.h |  3 +++
4 files changed, 15 insertions(+)
create mode 100644 components/separator.c

diff --git a/Makefile b/Makefile
index 945b5e3..2f93b87 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,7 @@ COM =\
components/num_files\
components/ram\
components/run_command\
+   components/separator\
components/swap\
components/temperature\
components/uptime\
diff --git a/components/separator.c b/components/separator.c
new file mode 100644
index 000..40fec52
--- /dev/null
+++ b/components/separator.c
@@ -0,0 +1,10 @@
+/* See LICENSE file for copyright and license details. */
+#include 
+
+#include "../util.h"
+
+const char *
+separator(const char *separator)
+{
+return separator;
+}
diff --git a/config.def.h b/config.def.h
index e06be66..0895f6a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -45,6 +45,7 @@ static const char unknown_str[] = "n/a";
 * ram_total   total memory size in GB NULL
 * ram_usedused memory in GB   NULL
 * run_command custom shell commandcommand (echo foo)
+ * separator   string to echo  NULL
 * swap_free   free swap in GB NULL
 * swap_perc   swap usage in percent   NULL
 * swap_total  total swap size in GB   NULL
diff --git a/slstatus.h b/slstatus.h
index 08f610a..b0f2564 100644
--- a/slstatus.h
+++ b/slstatus.h
@@ -56,6 +56,9 @@ const char *ram_used(void);
/* run_command */
const char *run_command(const char *cmd);

+/* separator */
+const char *separator(const char *separator);
+
/* swap */
const char *swap_free(void);
const char *swap_perc(void);
--
2.21.0




--
Web: https://drkhsh.at/ or http://drkhsh5rv6pnahas.onion/
Gopher: gopher://drkhsh.at or gopher://drkhsh5rv6pnahas.onion
GPG: 0x7A65E38D55BE96FE
Fingerprint: 4688 907C 8720 3318 0D9F AFDE 7A65 E38D 55BE 96FE



[hackers] [slstatus][PATCH] separator module

2019-03-30 Thread Ryan Kes
---
 Makefile   |  1 +
 components/separator.c | 10 ++
 config.def.h   |  1 +
 slstatus.h |  3 +++
 4 files changed, 15 insertions(+)
 create mode 100644 components/separator.c

diff --git a/Makefile b/Makefile
index 945b5e3..2f93b87 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,7 @@ COM =\
components/num_files\
components/ram\
components/run_command\
+   components/separator\
components/swap\
components/temperature\
components/uptime\
diff --git a/components/separator.c b/components/separator.c
new file mode 100644
index 000..40fec52
--- /dev/null
+++ b/components/separator.c
@@ -0,0 +1,10 @@
+/* See LICENSE file for copyright and license details. */
+#include 
+
+#include "../util.h"
+
+const char *
+separator(const char *separator)
+{
+return separator;
+}
diff --git a/config.def.h b/config.def.h
index e06be66..0895f6a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -45,6 +45,7 @@ static const char unknown_str[] = "n/a";
  * ram_total   total memory size in GB NULL
  * ram_usedused memory in GB   NULL
  * run_command custom shell commandcommand (echo foo)
+ * separator   string to echo  NULL
  * swap_free   free swap in GB NULL
  * swap_perc   swap usage in percent   NULL
  * swap_total  total swap size in GB   NULL
diff --git a/slstatus.h b/slstatus.h
index 08f610a..b0f2564 100644
--- a/slstatus.h
+++ b/slstatus.h
@@ -56,6 +56,9 @@ const char *ram_used(void);
 /* run_command */
 const char *run_command(const char *cmd);
 
+/* separator */
+const char *separator(const char *separator);
+
 /* swap */
 const char *swap_free(void);
 const char *swap_perc(void);
-- 
2.21.0




Re: [hackers] [slstatus][PATCH] separator module

2019-03-30 Thread Danh Doan


>diff --git a/components/seperator.c b/components/seperator.c

>+const char *
>+seperator(char *seperator)
>+{
>+return seperator;
>+}

>+ * seperator   string to echo  NULL

>+/* seperator */
>+const char *seperator(const char *seperator);

Prototype and implementation mismatched.

It's better to use `const char*` for parameters in this case.

s/seperator/separator/g



-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



Re: [hackers] [slstatus][PATCH] separator module

2019-03-30 Thread Laslo Hunhold
On Fri, 29 Mar 2019 15:35:48 +0100
Ryan Kes  wrote:

Hey Ryan,

> +const char *
> +seperator(char *seperator)
> +{
> +return seperator;
> +}

there's a typo in this function. It's "separator", not "seperator".

With best regards

Laslo Hunhold

-- 
Laslo Hunhold 


pgpDE6Ze7iyD5.pgp
Description: PGP signature


[hackers] [slstatus][PATCH] separator module

2019-03-29 Thread Ryan Kes
---
 Makefile   |  1 +
 components/seperator.c | 10 ++
 config.def.h   |  1 +
 slstatus.h |  3 +++
 4 files changed, 15 insertions(+)
 create mode 100644 components/seperator.c

diff --git a/Makefile b/Makefile
index 945b5e3..20796b3 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,7 @@ COM =\
components/num_files\
components/ram\
components/run_command\
+   components/seperator\
components/swap\
components/temperature\
components/uptime\
diff --git a/components/seperator.c b/components/seperator.c
new file mode 100644
index 000..826a461
--- /dev/null
+++ b/components/seperator.c
@@ -0,0 +1,10 @@
+/* See LICENSE file for copyright and license details. */
+#include 
+
+#include "../util.h"
+
+const char *
+seperator(char *seperator)
+{
+return seperator;
+}
diff --git a/config.def.h b/config.def.h
index e06be66..af289e5 100644
--- a/config.def.h
+++ b/config.def.h
@@ -45,6 +45,7 @@ static const char unknown_str[] = "n/a";
  * ram_total   total memory size in GB NULL
  * ram_usedused memory in GB   NULL
  * run_command custom shell commandcommand (echo foo)
+ * seperator   string to echo  NULL
  * swap_free   free swap in GB NULL
  * swap_perc   swap usage in percent   NULL
  * swap_total  total swap size in GB   NULL
diff --git a/slstatus.h b/slstatus.h
index 08f610a..78aef21 100644
--- a/slstatus.h
+++ b/slstatus.h
@@ -56,6 +56,9 @@ const char *ram_used(void);
 /* run_command */
 const char *run_command(const char *cmd);
 
+/* seperator */
+const char *seperator(const char *seperator);
+
 /* swap */
 const char *swap_free(void);
 const char *swap_perc(void);
-- 
2.21.0