shortcode/shortcodes.h

28 lines
489 B
C
Raw Normal View History

2023-07-12 19:09:17 +00:00
#ifndef SHORTCODES_H
#define SHORTCODES_H
2023-07-12 23:37:55 +00:00
// A chunk is a reference to a piece of string
// from "start" relative to its start
// and goes on for len characters.
2023-07-12 19:22:54 +00:00
struct chunk
{
int start, len;
};
typedef struct chunk chunk;
2023-07-12 23:37:55 +00:00
// Describes a parsed shortcode
2023-07-12 19:22:54 +00:00
struct shortcode
{
2023-07-12 20:10:55 +00:00
chunk whole;
2023-07-12 19:22:54 +00:00
chunk name;
chunk data;
char matching;
chunk argnames[100];
chunk argvals[100];
int argcount;
};
typedef struct shortcode shortcode;
shortcode *parse(char *);
2023-07-12 19:09:17 +00:00
#endif