mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
proc_tools: add helper member to put values w/o length; ...
align included headers to c++
Origin commit data
------------------
Branch: ni/coolstream
Commit: d9ef1aadfb
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-11-13 (Mon, 13 Nov 2017)
Origin message was:
------------------
- proc_tools: add helper member to put values w/o length; ...
align included headers to c++
------------------
This commit was generated by Migit
This commit is contained in:
@@ -10,8 +10,9 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ctype.h> /* isspace */
|
#include <cctype> /* isspace */
|
||||||
#include <stdio.h> /* sscanf */
|
#include <cstdio> /* sscanf */
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include "proc_tools.h"
|
#include "proc_tools.h"
|
||||||
|
|
||||||
@@ -28,6 +29,11 @@ int proc_put(const char *path, const char *value, const int len)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int proc_put(const char *path, const char *value)
|
||||||
|
{
|
||||||
|
return proc_put(path, value, strlen(value));
|
||||||
|
}
|
||||||
|
|
||||||
int proc_put(const char *path, bool state)
|
int proc_put(const char *path, bool state)
|
||||||
{
|
{
|
||||||
return proc_put(path, state ? "1" : "0", 1);
|
return proc_put(path, state ? "1" : "0", 1);
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
#ifndef __PROC_TOOLS_H__
|
#ifndef __PROC_TOOLS_H__
|
||||||
#define __PROC_TOOLS_H__
|
#define __PROC_TOOLS_H__
|
||||||
int proc_put(const char *path, const char *value, const int len);
|
int proc_put(const char *path, const char *value, const int len);
|
||||||
|
int proc_put(const char *path, const char *value);
|
||||||
int proc_put(const char *path, bool state);
|
int proc_put(const char *path, bool state);
|
||||||
int proc_get(const char *path, char *value, const int len);
|
int proc_get(const char *path, char *value, const int len);
|
||||||
unsigned int proc_get_hex(const char *path);
|
unsigned int proc_get_hex(const char *path);
|
||||||
|
Reference in New Issue
Block a user