added mhl/types.h which defines bool enum, escape.h now using this type
Этот коммит содержится в:
родитель
8b593e8398
Коммит
6674647676
23
mhl/escape.h
23
mhl/escape.h
@ -6,13 +6,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
#endif
|
||||
#include <mhl/types.h>
|
||||
|
||||
#define mhl_shell_escape_toesc(x) \
|
||||
(((x)==' ')||((x)=='!')||((x)=='#')||((x)=='$')||((x)=='%')|| \
|
||||
@ -140,13 +134,14 @@ static inline char* mhl_shell_unescape_buf(char* text)
|
||||
return TRUE if string contain escaped chars
|
||||
otherwise return FALSE
|
||||
*/
|
||||
static inline int
|
||||
mhl_shell_is_char_escaped ( const char *in ) {
|
||||
if (in == NULL || !*in || in[0] != '\\') return FALSE;
|
||||
if (mhl_shell_escape_toesc(in[1])){
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
static inline bool
|
||||
mhl_shell_is_char_escaped ( const char *in )
|
||||
{
|
||||
if (in == NULL || !*in || in[0] != '\\')
|
||||
return false;
|
||||
if (mhl_shell_escape_toesc(in[1]))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
16
mhl/types.h
Обычный файл
16
mhl/types.h
Обычный файл
@ -0,0 +1,16 @@
|
||||
/*
|
||||
|
||||
Micro Helper Library: generic type declarations
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __MHL_TYPES_H
|
||||
#define __MHL_TYPES_H
|
||||
|
||||
typedef enum
|
||||
{
|
||||
false = 0,
|
||||
true = 1
|
||||
} bool;
|
||||
|
||||
#endif
|
Загрузка…
x
Ссылка в новой задаче
Block a user