mirror of
https://github.com/troglobit/finit.git
synced 2026-10-18 10:59:34 +00:00
echo(): refactor and rename helper function -> fnwrite()
More often than not, the file to write to in sysfs changes rather than the value. This patch changes echo() into a fnwrite(), flipping what is vsnprintf()'ed, and adds a stupid str() function that converts any value (float/int/double/uint64_t) to a static string buffer. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
74d715243c
commit
6e24f2ff13
3 files changed
+41
-30
No files matched your search
+4
-1
@@ -45,7 +45,10 @@ extern char *prognm;
|
||||
#include <lite/conio.h>
|
||||
|
||||
char *progname (char *arg0);
|
||||
int echo (char *file, int append, char *fmt, ...);
|
||||
|
||||
char *str (char *fmt, ...);
|
||||
int fnwrite (char *value, char *fmt, ...);
|
||||
|
||||
int has_utmp (void);
|
||||
int strtobytes (char *arg);
|
||||
void do_sleep (unsigned int sec);
|
||||
|
||||
Reference in new issue
Block a user