labwc/include/xbm/tokenize.h

35 lines
557 B
C
Raw Permalink Normal View History

2021-11-13 21:56:53 +00:00
/* SPDX-License-Identifier: GPL-2.0-only */
2020-06-29 19:27:59 +01:00
/*
* XBM file tokenizer
*
* Copyright Johan Malm 2020
*/
2020-06-22 19:03:02 +01:00
2020-08-03 20:56:38 +01:00
#ifndef __LABWC_TOKENIZE_H
#define __LABWC_TOKENIZE_H
2020-06-22 19:03:02 +01:00
enum token_type {
TOKEN_NONE = 0,
TOKEN_IDENT,
TOKEN_INT,
TOKEN_SPECIAL,
TOKEN_OTHER,
};
#define MAX_TOKEN_SIZE (256)
struct token {
char name[MAX_TOKEN_SIZE];
int value;
2020-06-22 19:03:02 +01:00
size_t pos;
enum token_type type;
};
/**
* tokenize - tokenize xbm file
* @buffer: buffer containing xbm file
2020-06-23 07:17:07 +01:00
* return token vector
*/
2020-08-06 15:09:13 +01:00
struct token *tokenize_xbm(char *buffer);
2020-06-22 19:03:02 +01:00
2020-08-03 20:56:38 +01:00
#endif /* __LABWC_TOKENIZE_H */