labwc/include/xbm.h

42 lines
758 B
C
Raw Normal View History

2020-06-22 19:03:02 +01:00
#ifndef XBM_H
#define XBM_H
#include <cairo.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];
size_t pos;
enum token_type type;
};
2020-06-23 07:17:07 +01:00
/**
* xbm_create_bitmap - parse xbm tokens and create pixmap
* @tokens: token vector
*/
cairo_surface_t *xbm_create_bitmap(struct token *tokens);
2020-06-23 07:17:07 +01:00
2020-06-22 19:03:02 +01:00
/**
* tokenize - tokenize xbm file
* @buffer: buffer containing xbm file
2020-06-23 07:17:07 +01:00
* return token vector
*/
struct token *xbm_tokenize(char *buffer);
/**
* xbm_read_file - read file into buffer (as it's easier to tokenize that way)
* @filename: file to be read
* return allocated memory
2020-06-22 19:03:02 +01:00
*/
2020-06-23 07:17:07 +01:00
char *xbm_read_file(const char *filename);
2020-06-22 19:03:02 +01:00
#endif /* XBM_H */