From 48aac8801df86e743f5890a3cdc4882d0af89a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 25 Jul 2021 15:16:22 +0200 Subject: Convert remaining function definitions --- src/lex.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src/lex.c') diff --git a/src/lex.c b/src/lex.c index 257c2d3..97d6301 100644 --- a/src/lex.c +++ b/src/lex.c @@ -96,7 +96,9 @@ static TokenType LookupType(const char *name, TokenNode *np); /***************************************************************************** *****************************************************************************/ -TokenNode *Tokenize(const char *line, const char *fileName) { +TokenNode * +Tokenize(const char *line, const char *fileName) +{ TokenNode *np; AttributeNode *ap; @@ -386,7 +388,9 @@ IsSpace(char ch, int *lineNumber) /***************************************************************************** *****************************************************************************/ -char *ReadElementName(const char *line) { +char * +ReadElementName(const char *line) +{ char *buffer; int len, max; int x; @@ -409,7 +413,9 @@ char *ReadElementName(const char *line) { /***************************************************************************** *****************************************************************************/ -char *ReadElementValue(const char *line, const char *file, int *lineNumber) { +char * +ReadElementValue(const char *line, const char *file, int *lineNumber) +{ char *buffer; char ch; int len, max; @@ -513,7 +519,9 @@ LookupType(const char *name, TokenNode *np) /***************************************************************************** *****************************************************************************/ -const char *GetTokenName(const TokenNode *tp) { +const char * +GetTokenName(const TokenNode *tp) +{ if(tp->invalidName) { return tp->invalidName; } else if(tp->type >= sizeof(TOKEN_MAP) / sizeof(const char*)) { @@ -525,13 +533,17 @@ const char *GetTokenName(const TokenNode *tp) { /***************************************************************************** *****************************************************************************/ -const char *GetTokenTypeName(TokenType type) { +const char * +GetTokenTypeName(TokenType type) +{ return TOKEN_MAP[type]; } /***************************************************************************** *****************************************************************************/ -TokenNode *CreateNode(TokenNode *parent, const char *file, int line) { +TokenNode * +CreateNode(TokenNode *parent, const char *file, int line) +{ TokenNode *np; np = Allocate(sizeof(TokenNode)); @@ -568,7 +580,9 @@ TokenNode *CreateNode(TokenNode *parent, const char *file, int line) { /***************************************************************************** *****************************************************************************/ -AttributeNode *CreateAttribute(TokenNode *np) { +AttributeNode * +CreateAttribute(TokenNode *np) +{ AttributeNode *ap; ap = Allocate(sizeof(AttributeNode)); -- cgit v1.2.3