14typedef struct InkFlag InkFlag;
135 void ink_list_add(
HInkList* self,
const char* flag_name);
136 void ink_list_remove(
HInkList* self,
const char* flag_name);
137 int ink_list_contains(
const HInkList* self,
const char* flag_name);
210 typedef void (*InkExternalFunctionVoid)(
int argc,
const InkValue argv[]);
426 ink_compile_json(
const char* input_filename,
const char* output_filename,
const char** error);
Handler for a ink choice.
int ink_choice_num_tags(const HInkChoice *self)
number of tags associated with this choice
const char * ink_choice_get_tag(const HInkChoice *self, int index)
Access a tag by index.
const char * ink_choice_text(const HInkChoice *self)
Choice text.
Handle for the global variable store shared among ink runners.
int ink_globals_set(HInkGlobals *self, const char *variable_name, InkValue value)
Sets the value of a globals variable.
void(* InkObserver)(InkValue new_value, InkValue old_value)
Definition inkcpp.h:340
void ink_globals_observe(HInkGlobals *self, const char *variable_name, InkObserver observer)
assignes a observer to the variable with the corresponding name.
void ink_globals_delete(HInkGlobals *self)
Deconstructs the globals store and frees all assoziated memories.
HInkSnapshot * ink_globals_create_snapshot(const HInkGlobals *self)
Creates a snapshot for later reloading.
InkValue ink_globals_get(const HInkGlobals *self, const char *variable_name)
Gets the value of a global variable.
int ink_list_flags_from(const HInkList *self, const char *list_name, InkListIter *iter)
Creates an Iterator over all flags contained in a list assziated with a defined list.
int ink_list_flags(const HInkList *self, InkListIter *iter)
Creates an Iterator over all flags contained in a list.
A handle for an ink runner.
const HInkChoice * ink_runner_get_choice(const HInkRunner *self, int index)
Gets a choice.
void ink_runner_bind(HInkRunner *self, const char *function_name, InkExternalFunction callback, int lookaheadSafe)
Binds a external function which is called from the runtime, with a return vallue.
HInkSnapshot * ink_runner_create_snapshot(const HInkRunner *self)
Creates a snapshot, for later reloading.
InkValue(* InkExternalFunction)(int argc, const InkValue argv[])
Callback for a Ink external function which returns void.
Definition inkcpp.h:203
int ink_runner_num_tags(const HInkRunner *self)
Returns the number of tags on the current line.
const char * ink_runner_tag(const HInkRunner *self, int index)
Access a tag by index.
const char * ink_runner_knot_tag(const HInkRunner *self, int index)
void ink_runner_bind_void(HInkRunner *self, const char *function_name, InkExternalFunctionVoid callback, int lookaheadSafe)
Binds a external function which is called form the runtime, with no return value.
void ink_runner_choose(HInkRunner *self, int index)
Make a choice.
const char * ink_runner_get_line(HInkRunner *self)
Continue execution until the next newline, then allocate a c-style string with the output.
int ink_runner_num_knot_tags(const HInkRunner *self)
Get Number of knot/stitch tags.
ink_hash_t ink_runner_current_knot(const HInkRunner *self)
Get hash of current knot/stitch name.
bool ink_runner_move_to(HInkRunner *self, ink_hash_t path)
Moves the runner to the specified path.
int ink_runner_num_choices(const HInkRunner *self)
Returns the number of choices currently available.
void(* InkExternalFunctionVoid)(int argc, const InkValue argv[])
Callback for a Ink external function wihich returns a value.
Definition inkcpp.h:210
int ink_runner_num_global_tags(const HInkRunner *self)
Get Number of global tags.
int ink_runner_can_continue(const HInkRunner *self)
Can the runner continue?
const char * ink_runner_global_tag(const HInkRunner *self, int index)
void ink_runner_delete(HInkRunner *self)
Deconstructs the Runner and all frees assoziated resources.
Handler for a ink snapshot.
int ink_snapshot_num_runners(const HInkSnapshot *self)
number of runners which are stored inside this snapshot
HInkSnapshot * ink_snapshot_from_file(const char *filename)
deserialize snapshot from file.
void ink_snapshot_write_to_file(const HInkSnapshot *self, const char *filename)
serialize snapshot to file
Handle for a loaded ink story.
HInkGlobals * ink_story_new_globals_from_snapshot(HInkStory *self, const HInkSnapshot *obj)
Reconstructs globals from snapshot.
void ink_story_delete(HInkStory *self)
deletes a story and all assoziated resources
HInkRunner * ink_story_new_runner(HInkStory *self, HInkGlobals *store)
Creates a new runner.
HInkGlobals * ink_story_new_globals(HInkStory *self)
Creates a new global store.
HInkStory * ink_story_from_file(const char *filename)
Creates a new story object from a file.
HInkRunner * ink_story_new_runner_from_snapshot(HInkStory *self, const HInkSnapshot *obj, HInkGlobals *store, int runner_id)
reconstruct runner from a snapshot
void ink_compile_json(const char *input_filename, const char *output_filename, const char **error)
Compiles a .ink.json file to an inkCPP .bin file.
ink_hash_t ink_hash_string(const char *str)
Hash a string, this hash is used inside inkcpp instead of the string actual value.
unsigned int uint32_t
define basic numeric type
Definition system.h:47
Iterater used to iterate flags of a HInkList.
Definition inkcpp.h:127
const char * list_name
name of the list the flag corresponds to
Definition inkcpp.h:132
int ink_list_iter_next(InkListIter *self)
const char * flag_name
Name of the current flag.
Definition inkcpp.h:131
Repserentation of a ink variable.
Definition inkcpp.h:169
int32_t int32_v
contains value if type == ValueTypeInt32
Definition inkcpp.h:174
const char * string_v
contains value if type == ValueTypeString
Definition inkcpp.h:176
enum InkValue::Type type
indicates type contained in value
Type
indicates which type is contained in the value
Definition inkcpp.h:185
@ ValueTypeString
a string
Definition inkcpp.h:190
@ ValueTypeNone
the Value does not contain any value
Definition inkcpp.h:186
@ ValueTypeList
a ink list
Definition inkcpp.h:192
@ ValueTypeFloat
a floating point number
Definition inkcpp.h:191
@ ValueTypeBool
a boolean
Definition inkcpp.h:187
@ ValueTypeInt32
a signed integer
Definition inkcpp.h:189
@ ValueTypeUint32
a unsigned integer
Definition inkcpp.h:188
int bool_v
contains value if type == ValueTypeBool
Definition inkcpp.h:171
float float_v
contains value if type == ValueTypeFloat
Definition inkcpp.h:178
HInkList * list_v
contains value if type == ValueTypeList
Definition inkcpp.h:181
uint32_t uint32_v
contains value if type == ValueTypeUint32
Definition inkcpp.h:172