1
1

added mhl/types.h which defines bool enum, escape.h now using this type

Этот коммит содержится в:
Enrico Weigelt, metux IT service 2009-01-27 21:53:41 +01:00
родитель 8b593e8398
Коммит 6674647676
2 изменённых файлов: 25 добавлений и 14 удалений

Просмотреть файл

@ -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 Обычный файл
Просмотреть файл

@ -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