Add support for multiple charmaps

This adds two new directives: newcharmap and setcharmap.
newcharmap creates a new charmap and switches to it.
setcharmap switches to an existing charmap.
This commit is contained in:
dbrotz
2019-08-29 21:54:06 -07:00
parent 12d82eb768
commit e05199ca1e
17 changed files with 395 additions and 33 deletions

View File

@@ -25,13 +25,16 @@ struct Charnode {
};
struct Charmap {
char name[MAXSYMLEN + 1];
int32_t charCount; /* user-side count. */
int32_t nodeCount; /* node-side count. */
struct Charnode nodes[MAXCHARNODES]; /* first node is reserved for the root node in charmap. */
struct Charmap *next; /* next charmap in hash table bucket */
};
int32_t readUTF8Char(char *destination, char *source);
void charmap_InitMain(void);
struct Charmap *charmap_New(const char *name, const char *baseName);
void charmap_Set(const char *name);
int32_t charmap_Add(char *input, uint8_t output);
int32_t charmap_Convert(char **input);