X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..5ea0322b6ab2af986e4c764284141380031dd014:/icuSources/tools/genrb/read.c diff --git a/icuSources/tools/genrb/read.c b/icuSources/tools/genrb/read.c index 22cbfd65..358c6835 100644 --- a/icuSources/tools/genrb/read.c +++ b/icuSources/tools/genrb/read.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 1998-2008, International Business Machines +* Copyright (C) 1998-2012, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -19,6 +19,7 @@ #include "read.h" #include "errmsg.h" #include "unicode/ustring.h" +#include "unicode/utf16.h" #define OPENBRACE 0x007B #define CLOSEBRACE 0x007D @@ -47,7 +48,7 @@ static void seekUntilEndOfComment (UCHARBUF *buf, struct UString *token, UErr static UBool isWhitespace (UChar32 c); static UBool isNewline (UChar32 c); -void resetLineNumber() { +U_CFUNC void resetLineNumber() { lineCount = 1; } @@ -59,11 +60,12 @@ void resetLineNumber() { never return eString twice in a row; instead, multiple adjacent string tokens will be merged into one, with no intervening space. */ -enum ETokenType getNextToken(UCHARBUF* buf, - struct UString *token, - uint32_t *linenumber, /* out: linenumber of token */ - struct UString *comment, - UErrorCode *status) { +U_CFUNC enum ETokenType +getNextToken(UCHARBUF* buf, + struct UString *token, + uint32_t *linenumber, /* out: linenumber of token */ + struct UString *comment, + UErrorCode *status) { enum ETokenType result; UChar32 c; @@ -351,13 +353,13 @@ static UChar32 getNextChar(UCHARBUF* buf, seekUntilNewline(buf, NULL, status); break; - case ASTERISK: /* "/*" */ - c2 = ucbuf_getc(buf, status); /* "/*c" */ - if(c2 == ASTERISK){ /* "/**" */ + case ASTERISK: /* " / * " */ + c2 = ucbuf_getc(buf, status); /* "/ * c" */ + if(c2 == ASTERISK){ /* "/ * *" */ /* parse multi-line comment and store it in token*/ seekUntilEndOfComment(buf, token, status); } else { - ucbuf_ungetc(c2, buf); /* c2 is the non-asterisk following "/*". Include c2 back in buffer. */ + ucbuf_ungetc(c2, buf); /* c2 is the non-asterisk following "/ *". Include c2 back in buffer. */ seekUntilEndOfComment(buf, NULL, status); } break; @@ -428,8 +430,7 @@ static void seekUntilEndOfComment(UCHARBUF *buf, } } -UChar32 unescape(UCHARBUF *buf, - UErrorCode *status) { +U_CFUNC UChar32 unescape(UCHARBUF *buf, UErrorCode *status) { if (U_FAILURE(*status)) { return U_EOF; }