proclib/ktkProgram.h

33 lines
1.5 KiB
C

#ifndef KTK_PROGRAM_H
#define KTK_PROGRAM_H
#include "ktkStructure.h"
#include "ktkMap.h"
/* ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
ktkProgram
Programs are little more than a nice container for Structures and their names. Structure definition files are read into Program(s) and actual Structures building is accomplished through Program(s) as well.
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` */
struct ktkProgram {
struct ktkStructure *structures; // contained structures
char **structure_name; // names for contained Structures
size_t structure_count; // count of contained structures
}; extern const struct ktkProgram ktk_PROGRAM_DEFAULT;
int ktk_freeProgram(struct ktkProgram *program);
int ktk_runProgram(struct ktkProgram *program, struct ktkMap *map);
#define ktk_LIMIT_DEPTH 16
extern int ktk_current_depth;
/* ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
ktk_buildStructure
params: ktkProgram*, const char *structure, ktkMap *map
returns: *map
This function finds the structure name in the given program and builds it into map. If the passed map is NULL, a new ktkMap is generated and returned.
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` */
struct ktkMap *ktk_buildStructure(struct ktkProgram *program, struct ktkLive *live, struct ktkStructure *structure, struct ktkMap *orig_map);
int ktk_linkStructures(struct ktkProgram *program, struct ktkLive *live_parent, struct ktkMap *orig_map);
struct ktkStructure *ktk_getStructure(struct ktkProgram *program, const char *structure_name);
#endif