| 1 |
#ifndef CARYLL_cff_SUBR_H |
| 2 |
#define CARYLL_cff_SUBR_H |
| 3 |
|
| 4 |
#include "libcff.h" |
| 5 |
#include "charstring-il.h" |
| 6 |
|
| 7 |
typedef struct __cff_SubrRule cff_SubrRule; |
| 8 |
typedef struct __cff_SubrNode cff_SubrNode; |
| 9 |
|
| 10 |
struct __cff_SubrNode { |
| 11 |
cff_SubrNode *prev; |
| 12 |
cff_SubrRule *rule; |
| 13 |
OWNING cff_SubrNode *next; |
| 14 |
OWNING caryll_Buffer *terminal; |
| 15 |
bool hard; |
| 16 |
bool guard; |
| 17 |
bool last; |
| 18 |
}; |
| 19 |
|
| 20 |
struct __cff_SubrRule { |
| 21 |
bool printed; |
| 22 |
bool numbered; |
| 23 |
uint32_t number; |
| 24 |
uint32_t height; |
| 25 |
uint32_t uniqueIndex; |
| 26 |
uint16_t cffIndex; |
| 27 |
uint32_t refcount; |
| 28 |
uint32_t effectiveLength; |
| 29 |
OWNING cff_SubrNode *guard; |
| 30 |
OWNING cff_SubrRule *next; |
| 31 |
}; |
| 32 |
|
| 33 |
typedef struct { |
| 34 |
uint8_t arity; |
| 35 |
uint8_t *key; |
| 36 |
cff_SubrNode *start; |
| 37 |
UT_hash_handle hh; |
| 38 |
} cff_SubrDiagramIndex; |
| 39 |
|
| 40 |
typedef struct { |
| 41 |
OWNING cff_SubrRule *root; |
| 42 |
cff_SubrRule *last; |
| 43 |
cff_SubrDiagramIndex *diagramIndex; |
| 44 |
uint32_t totalRules; |
| 45 |
uint32_t totalCharStrings; |
| 46 |
bool doSubroutinize; |
| 47 |
} cff_SubrGraph; |
| 48 |
|
| 49 |
extern caryll_RefElementInterface(cff_SubrGraph) cff_iSubrGraph; |
| 50 |
|
| 51 |
void cff_insertILToGraph(cff_SubrGraph *g, cff_CharstringIL *il); |
| 52 |
void cff_ilGraphToBuffers(cff_SubrGraph *g, caryll_Buffer **s, caryll_Buffer **gs, caryll_Buffer **ls, |
| 53 |
const otfcc_Options *options); |
| 54 |
|
| 55 |
#endif |