mirror of
https://github.com/MiSTer-devel/Linux-Kernel_MiSTer.git
synced 2026-04-19 03:04:24 +00:00
v5.14
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#ifndef _LINUX_STRING_HELPERS_H_
|
||||
#define _LINUX_STRING_HELPERS_H_
|
||||
|
||||
#include <linux/bits.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -18,13 +19,15 @@ enum string_size_units {
|
||||
void string_get_size(u64 size, u64 blk_size, enum string_size_units units,
|
||||
char *buf, int len);
|
||||
|
||||
#define UNESCAPE_SPACE 0x01
|
||||
#define UNESCAPE_OCTAL 0x02
|
||||
#define UNESCAPE_HEX 0x04
|
||||
#define UNESCAPE_SPECIAL 0x08
|
||||
#define UNESCAPE_SPACE BIT(0)
|
||||
#define UNESCAPE_OCTAL BIT(1)
|
||||
#define UNESCAPE_HEX BIT(2)
|
||||
#define UNESCAPE_SPECIAL BIT(3)
|
||||
#define UNESCAPE_ANY \
|
||||
(UNESCAPE_SPACE | UNESCAPE_OCTAL | UNESCAPE_HEX | UNESCAPE_SPECIAL)
|
||||
|
||||
#define UNESCAPE_ALL_MASK GENMASK(3, 0)
|
||||
|
||||
int string_unescape(char *src, char *dst, size_t size, unsigned int flags);
|
||||
|
||||
static inline int string_unescape_inplace(char *buf, unsigned int flags)
|
||||
@@ -42,22 +45,24 @@ static inline int string_unescape_any_inplace(char *buf)
|
||||
return string_unescape_any(buf, buf, 0);
|
||||
}
|
||||
|
||||
#define ESCAPE_SPACE 0x01
|
||||
#define ESCAPE_SPECIAL 0x02
|
||||
#define ESCAPE_NULL 0x04
|
||||
#define ESCAPE_OCTAL 0x08
|
||||
#define ESCAPE_SPACE BIT(0)
|
||||
#define ESCAPE_SPECIAL BIT(1)
|
||||
#define ESCAPE_NULL BIT(2)
|
||||
#define ESCAPE_OCTAL BIT(3)
|
||||
#define ESCAPE_ANY \
|
||||
(ESCAPE_SPACE | ESCAPE_OCTAL | ESCAPE_SPECIAL | ESCAPE_NULL)
|
||||
#define ESCAPE_NP 0x10
|
||||
#define ESCAPE_NP BIT(4)
|
||||
#define ESCAPE_ANY_NP (ESCAPE_ANY | ESCAPE_NP)
|
||||
#define ESCAPE_HEX 0x20
|
||||
#define ESCAPE_HEX BIT(5)
|
||||
#define ESCAPE_NA BIT(6)
|
||||
#define ESCAPE_NAP BIT(7)
|
||||
#define ESCAPE_APPEND BIT(8)
|
||||
|
||||
#define ESCAPE_ALL_MASK GENMASK(8, 0)
|
||||
|
||||
int string_escape_mem(const char *src, size_t isz, char *dst, size_t osz,
|
||||
unsigned int flags, const char *only);
|
||||
|
||||
int string_escape_mem_ascii(const char *src, size_t isz, char *dst,
|
||||
size_t osz);
|
||||
|
||||
static inline int string_escape_mem_any_np(const char *src, size_t isz,
|
||||
char *dst, size_t osz, const char *only)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user