Conflicts:
	src/platform.h
This commit is contained in:
Enno Rehling 2017-01-10 18:10:06 +01:00
commit 881dd9886f
11 changed files with 26 additions and 11 deletions

View File

@ -36,6 +36,7 @@ without prior permission by the authors of Eressea.
#include <tolua.h>
#include <string.h>
#include <stdbool.h>
typedef struct helpmode {
const char *name;

View File

@ -18,6 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef H_KRNL_ALLIANCE
#define H_KRNL_ALLIANCE
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -15,6 +15,7 @@
#include "keyword.h"
#include <stddef.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {

View File

@ -2,6 +2,8 @@
#define H_KEYWORD_H
#include "kernel/types.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C"
{

View File

@ -18,11 +18,14 @@
#pragma warning(disable: 4459) // declaration hides global
#endif
#define _POSIX_C_SOURCE 200809L
#ifndef MAX_PATH
# define MAX_PATH 4096
#endif
#define UNUSED_ARG(a) (void)(a)
#define TOLUA_CAST (char*)
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))

View File

@ -4,6 +4,7 @@
#include <util/log.h>
#include <util/unicode.h>
#include <stdbool.h>
#include <ctype.h>
#include <wctype.h>
@ -30,7 +31,7 @@ static int eatwhite(const char *ptr, size_t * total_size)
ret = unicode_utf8_to_ucs4(&ucs, ptr, &size);
if (ret != 0)
break;
if (!iswxspace((wint_t)ucs))
if (!iswspace((wint_t)ucs))
break;
*total_size += size;
ptr += size;
@ -52,7 +53,7 @@ static const char *getbuf_latin1(FILE * F)
if (bp == NULL)
return NULL;
while (*bp && isxspace(*(unsigned char *)bp))
while (*bp && isspace(*(unsigned char *)bp))
++bp; /* eatwhite */
comment = (bool)(comment && cont);
@ -113,15 +114,15 @@ static const char *getbuf_latin1(FILE * F)
if (iscntrl(c)) {
if (!comment && cp < fbuf + MAXLINE) {
*cp++ = isxspace(c) ? ' ' : '?';
*cp++ = isspace(c) ? ' ' : '?';
}
++bp;
continue;
}
else if (isxspace(c)) {
else if (isspace(c)) {
if (!quote) {
++bp;
while (*bp && isxspace(*(unsigned char *)bp))
while (*bp && isspace(*(unsigned char *)bp))
++bp; /* eatwhite */
if (!comment && *bp && *bp != COMMENT_CHAR && cp < fbuf + MAXLINE)
*(cp++) = ' ';
@ -136,7 +137,7 @@ static const char *getbuf_latin1(FILE * F)
}
else if (c == CONTINUE_CHAR) {
const char *end = ++bp;
while (*end && isxspace(*(unsigned char *)end))
while (*end && isspace(*(unsigned char *)end))
++end; /* eatwhite */
if (*end == '\0') {
bp = end;
@ -269,7 +270,7 @@ static const char *getbuf_utf8(FILE * F)
break;
}
if (iswxspace((wint_t)ucs)) {
if (iswspace((wint_t)ucs)) {
if (!quote) {
bp += size;
ret = eatwhite(bp, &size);

View File

@ -32,7 +32,7 @@ static int eatwhitespace_c(const char **str_p)
for (;;) {
unsigned char utf8_character = (unsigned char)*str;
if (~utf8_character & 0x80) {
if (!iswxspace(utf8_character))
if (!iswspace(utf8_character))
break;
++str;
}
@ -42,7 +42,7 @@ static int eatwhitespace_c(const char **str_p)
log_warning("illegal character sequence in UTF8 string: %s\n", str);
break;
}
if (!iswxspace((wint_t)ucs))
if (!iswspace((wint_t)ucs))
break;
str += len;
}
@ -106,7 +106,7 @@ void skip_token(void)
log_warning("illegal character sequence in UTF8 string: %s\n", states->current_token);
}
}
if (iswxspace((wint_t)ucs) && quotechar == 0) {
if (iswspace((wint_t)ucs) && quotechar == 0) {
return;
}
else {
@ -163,7 +163,7 @@ char *parse_token(const char **str, char *lbuf, size_t buflen)
copy = true;
escape = false;
}
else if (iswxspace((wint_t)ucs)) {
else if (iswspace((wint_t)ucs)) {
if (quotechar == 0)
break;
copy = true;

View File

@ -12,6 +12,7 @@
#define UTIL_PARSER_H
#include <stddef.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,5 +1,6 @@
#pragma once
#include <stdbool.h>
#define PASSWORD_PLAINTEXT 0
#define PASSWORD_DEFAULT PASSWORD_PLAINTEXT

View File

@ -1,3 +1,4 @@
#pragma once
/*
Copyright (c) 1998-2015, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de

View File

@ -21,6 +21,7 @@
/* libc includes */
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdarg.h>