diff --git a/dictionaryi.h b/dictionaryi.h index 15056f4..d13a44f 100644 --- a/dictionaryi.h +++ b/dictionaryi.h @@ -1,5 +1,7 @@ #pragma once +/*********************************************************************/ + #define IDICTIONARY_KEYRAW_MAX (120) #define IDICTIONARY_KEY_MAX (IDICTIONARY_KEYRAW_MAX - 1) #define IDICTIONARY_PATH_MAX (4096) @@ -21,447 +23,422 @@ extern "C" { /*********************************************************************/ -typedef bool (*IDictionary_ItemFilterCallback)(echandle DictionaryHandle, void *UserPtr, - echandle SourceDictionaryHandle, echandle SourceItemHandle); -typedef bool (*IDictionary_ItemRemoveCallback)(echandle DictionaryHandle, echandle ItemHandle, void *UserPtr, - const char *Path); -typedef bool (*IDictionary_ItemKeyChangeCallback)(echandle DictionaryHandle, echandle ItemHandle, void *UserPtr, - const char *Path, const char *OldKey); -typedef bool (*IDictionary_ItemValueChangeCallback)(echandle DictionaryHandle, echandle ItemHandle, void *UserPtr, - const char *Path, const char *OldValue, int32_t OldValueLength); +typedef bool (*IDictionary_ItemFilterCallback)(echandle dictionary_handle, void *user_ptr, + echandle source_dictionary_handle, echandle source_item_handle); +typedef bool (*IDictionary_ItemRemoveCallback)(echandle handle, echandle item_handle, void *user_ptr, const char *path); +typedef bool (*IDictionary_ItemKeyChangeCallback)(echandle handle, echandle item_handle, void *user_ptr, + const char *path, const char *old_key); +typedef bool (*IDictionary_ItemValueChangeCallback)(echandle handle, echandle item_handle, void *user_ptr, + const char *path, const char *old_value, int32_t old_value_length); /*********************************************************************/ typedef struct IDictionaryVtbl { - bool (*GetParent)(echandle DictionaryHandle, echandle *ParentDictionaryHandle, echandle *ParentItemHandle); - bool (*Add)(echandle DictionaryHandle, const char *Key, echandle *ItemHandle); - bool (*AddNull)(echandle DictionaryHandle, const char *Key, echandle *ItemHandle); - bool (*AddString)(echandle DictionaryHandle, const char *Key, const char *Value, echandle *ItemHandle); - bool (*AddInt)(echandle DictionaryHandle, const char *Key, int64_t Value, echandle *ItemHandle); - bool (*AddFloat)(echandle DictionaryHandle, const char *Key, float64_t Value, echandle *ItemHandle); - bool (*AddBoolean)(echandle DictionaryHandle, const char *Key, bool Value, echandle *ItemHandle); - bool (*AddList)(echandle DictionaryHandle, const char *Key, echandle *ListHandle, echandle *ItemHandle); - bool (*AddDictionary)(echandle DictionaryHandle, const char *Key, echandle *DictHandle, echandle *ItemHandle); - bool (*Insert)(echandle DictionaryHandle, echandle PrevItemHandle, const char *Key, echandle *ItemHandle); - bool (*Remove)(echandle DictionaryHandle, echandle *ItemHandle); - - bool (*ConvertFromString)(echandle DictionaryHandle, const char *Value, int32_t MaxValue, char KeyValueSeparator, - char ItemSeparator); - bool (*ConvertToString)(echandle DictionaryHandle, char *Value, int32_t MaxValue, char KeyValueSeparator, - char ItemSeparator); - - bool (*ContainsKey)(echandle DictionaryHandle, const char *Key); - bool (*EnsureIndex)(echandle DictionaryHandle, int32_t Index, echandle *ItemHandle); - bool (*EnsureListByIndex)(echandle DictionaryHandle, int32_t Index, echandle *ItemHandle, - echandle *ItemDictionaryHandle); - bool (*EnsureDictionaryByIndex)(echandle DictionaryHandle, int32_t Index, echandle *ItemHandle, - echandle *ItemDictionaryHandle); - bool (*EnsureKey)(echandle DictionaryHandle, const char *Key, echandle *ItemHandle); - bool (*EnsureList)(echandle DictionaryHandle, const char *Key, echandle *ItemHandle, - echandle *ItemDictionaryHandle); - bool (*EnsureDictionary)(echandle DictionaryHandle, const char *Key, echandle *ItemHandle, - echandle *ItemDictionaryHandle); - bool (*GetTypeByKey)(echandle DictionaryHandle, const char *Key, int32_t *Type); - bool (*SetStringByKey)(echandle DictionaryHandle, const char *Key, const char *String); - bool (*GetStringByKey)(echandle DictionaryHandle, const char *Key, char *String, int32_t MaxString); - bool (*SetStringByKeyV)(echandle DictionaryHandle, const char *Key, const char *String, va_list ArgumentList); - bool (*GetStringPtrByKey)(echandle DictionaryHandle, const char *Key, const char **StringPtr); - bool (*GetBufferPtrByKey)(echandle DictionaryHandle, const char *Key, const char **BufferPtr, - int32_t *BufferLength); - bool (*SetIntByKey)(echandle DictionaryHandle, const char *Key, int64_t Value); - bool (*GetInt32ByKey)(echandle DictionaryHandle, const char *Key, int32_t *Value); - bool (*GetInt64ByKey)(echandle DictionaryHandle, const char *Key, int64_t *Value); - bool (*SetFloatByKey)(echandle DictionaryHandle, const char *Key, float64_t Value); - bool (*GetFloatByKey)(echandle DictionaryHandle, const char *Key, float64_t *Value); - bool (*SetBooleanByKey)(echandle DictionaryHandle, const char *Key, bool Value); - bool (*GetBooleanByKey)(echandle DictionaryHandle, const char *Key, bool *Value); - bool (*GetListByIndex)(echandle DictionaryHandle, int32_t Index, echandle *ItemDictionaryHandle); - bool (*GetDictionaryByIndex)(echandle DictionaryHandle, int32_t Index, echandle *ItemDictionaryHandle); - bool (*GetListByKey)(echandle DictionaryHandle, const char *Key, echandle *ItemDictionaryHandle); - bool (*GetDictionaryByKey)(echandle DictionaryHandle, const char *Key, echandle *ItemDictionaryHandle); - bool (*RemoveByKey)(echandle DictionaryHandle, const char *Key); - - bool (*ItemGetPath)(echandle DictionaryHandle, echandle ItemHandle, echandle TopDictionaryHandle, char *Path, - int32_t MaxPath); - bool (*ItemIsContainer)(echandle DictionaryHandle, echandle ItemHandle); - bool (*ItemIsNull)(echandle DictionaryHandle, echandle ItemHandle); - bool (*ItemGetIndex)(echandle DictionaryHandle, echandle ItemHandle, int32_t *Index); - bool (*ItemSetType)(echandle DictionaryHandle, echandle ItemHandle, int32_t Type); - int32_t (*ItemGetType)(echandle DictionaryHandle, echandle ItemHandle); - bool (*ItemCompareType)(echandle DictionaryHandle, echandle ItemHandle, int32_t Type); - bool (*ItemSetKey)(echandle DictionaryHandle, echandle ItemHandle, const char *Key); - bool (*ItemSetKeyLength)(echandle DictionaryHandle, echandle ItemHandle, const char *Key, int32_t KeyLength); - bool (*ItemGetKey)(echandle DictionaryHandle, echandle ItemHandle, char *Key, int32_t MaxKey); - bool (*ItemGetKeyPtr)(echandle DictionaryHandle, echandle ItemHandle, const char **KeyPtr); - bool (*ItemSetString)(echandle DictionaryHandle, echandle ItemHandle, const char *String); - bool (*ItemSetStringV)(echandle DictionaryHandle, echandle ItemHandle, const char *String, va_list ArgumentList); - bool (*ItemGetString)(echandle DictionaryHandle, echandle ItemHandle, char *String, int32_t MaxString); - bool (*ItemGetStringPtr)(echandle DictionaryHandle, echandle ItemHandle, const char **StringPtr); - bool (*ItemSetBuffer)(echandle DictionaryHandle, echandle ItemHandle, const char *Buffer, int32_t BufferLength); - bool (*ItemGetBufferPtr)(echandle DictionaryHandle, echandle ItemHandle, const char **BufferPtr, - int32_t *BufferLength); - bool (*ItemSetFloat)(echandle DictionaryHandle, echandle ItemHandle, float64_t Value); - bool (*ItemGetFloat)(echandle DictionaryHandle, echandle ItemHandle, float64_t *Value); - bool (*ItemSetInt)(echandle DictionaryHandle, echandle ItemHandle, int64_t Value); - bool (*ItemGetInt32)(echandle DictionaryHandle, echandle ItemHandle, int32_t *Value); - bool (*ItemGetInt64)(echandle DictionaryHandle, echandle ItemHandle, int64_t *Value); - bool (*ItemSetBoolean)(echandle DictionaryHandle, echandle ItemHandle, bool Value); - bool (*ItemGetBoolean)(echandle DictionaryHandle, echandle ItemHandle, bool *Value); - bool (*ItemSetNull)(echandle DictionaryHandle, echandle ItemHandle); - bool (*ItemGetDictionaryHandle)(echandle DictionaryHandle, echandle ItemHandle, echandle *DictHandle); - bool (*ItemFindByPath)(echandle DictionaryHandle, const char *Path, echandle *ItemDictionaryHandle, - echandle *ItemHandle); - bool (*ItemFindByKey)(echandle DictionaryHandle, const char *Key, echandle StartItemHandle, echandle *ItemHandle); - bool (*ItemFindByBuffer)(echandle DictionaryHandle, const char *Buffer, int32_t BufferLength, - echandle StartItemHandle, echandle *ItemHandle); - bool (*ItemFindByIndex)(echandle DictionaryHandle, int32_t Index, echandle StartItemHandle, echandle *ItemHandle); - bool (*ItemGetNext)(echandle DictionaryHandle, echandle ItemHandle, echandle *NextItemHandle); - bool (*ItemGetPrev)(echandle DictionaryHandle, echandle ItemHandle, echandle *PrevItemHandle); - bool (*ItemGetFirst)(echandle DictionaryHandle, echandle *ItemHandle); - bool (*ItemGetLast)(echandle DictionaryHandle, echandle *ItemHandle); - int32_t (*ItemGetCount)(echandle DictionaryHandle); - - bool (*Log)(echandle DictionaryHandle, const char *Format, ...); - bool (*LogTabbed)(echandle DictionaryHandle, int32_t Depth, const char *Format, ...); - bool (*SetLogCallback)(echandle DictionaryHandle, echandle LogHandle, Generic_LogCallback Callback); - bool (*GetLogCallback)(echandle DictionaryHandle, echandle *LogHandle, Generic_LogCallback *Callback); - - bool (*Sync)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle, void *FilterUserPtr, - IDictionary_ItemFilterCallback FilterCallback); - bool (*SyncAt)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle, echandle SourceItemHandle, - void *FilterUserPtr, IDictionary_ItemFilterCallback FilterCallback); - bool (*RemoveMissing)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle); - - bool (*Merge)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle, int32_t Flags); - bool (*MergeAt)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle, echandle SourceItemHandle, - int32_t Flags); - echandle (*SkipRoot)(echandle DictionaryHandle); - bool (*Reset)(echandle DictionaryHandle); - bool (*Dump)(echandle DictionaryHandle); - - bool (*SetCaseSensitive)(echandle DictionaryHandle, bool CaseSensitive); - bool (*GetCaseSensitive)(echandle DictionaryHandle); - bool (*SetAllowDuplicates)(echandle DictionaryHandle, bool AllowDuplicates); - bool (*GetAllowDuplicates)(echandle DictionaryHandle); - - bool (*SetItemRemoveCallback)(echandle DictionaryHandle, void *UserPtr, IDictionary_ItemRemoveCallback Callback); - bool (*GetItemRemoveCallback)(echandle DictionaryHandle, void **UserPtr, IDictionary_ItemRemoveCallback *Callback); - bool (*SetItemKeyChangeCallback)(echandle DictionaryHandle, void *UserPtr, - IDictionary_ItemKeyChangeCallback Callback); - bool (*GetItemKeyChangeCallback)(echandle DictionaryHandle, void **UserPtr, - IDictionary_ItemKeyChangeCallback *Callback); - bool (*SetItemValueChangeCallback)(echandle DictionaryHandle, void *UserPtr, - IDictionary_ItemValueChangeCallback Callback); - bool (*GetItemValueChangeCallback)(echandle DictionaryHandle, void **UserPtr, - IDictionary_ItemValueChangeCallback *Callback); - - bool (*MergeItem)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle, echandle SourceItemHandle, - int32_t Flags); - bool (*SetStringByKeyPrint)(echandle DictionaryHandle, const char *Key, const char *String, ...); - bool (*ItemSetStringPrint)(echandle DictionaryHandle, echandle ItemHandle, const char *String, ...); - bool (*SetStringByPath)(echandle DictionaryHandle, const char *Path, const char *String); - bool (*GetStringByPath)(echandle DictionaryHandle, const char *Path, char *String, int32_t MaxString); - bool (*GetBufferPtrByPath)(echandle DictionaryHandle, const char *Path, const char **BufferPtr, - int32_t *BufferLength); - bool (*SetIntByPath)(echandle DictionaryHandle, const char *Path, int64_t Value); - bool (*GetInt32ByPath)(echandle DictionaryHandle, const char *Path, int32_t *Value); - bool (*GetInt64ByPath)(echandle DictionaryHandle, const char *Path, int64_t *Value); - bool (*SetFloatByPath)(echandle DictionaryHandle, const char *Path, float64_t Value); - bool (*GetFloatByPath)(echandle DictionaryHandle, const char *Path, float64_t *Value); - bool (*SetBooleanByPath)(echandle DictionaryHandle, const char *Path, bool Value); - bool (*GetBooleanByPath)(echandle DictionaryHandle, const char *Path, bool *Value); - echandle (*SkipRootContainer)(echandle DictionaryHandle); - bool (*ItemSetPrivate)(echandle DictionaryHandle, echandle ItemHandle, bool Private); - bool (*ItemIsPrivate)(echandle DictionaryHandle, echandle ItemHandle); - bool (*SetPrivateKeys)(echandle DictionaryHandle, bool PrivateKeys); - bool (*GetPrivateKeys)(echandle DictionaryHandle); - - echandle (*AddRef)(echandle DictionaryHandle); - int32_t (*Release)(echandle *DictionaryHandle); - - bool (*EnsureDictionaryByPath)(echandle DictionaryHandle, const char *Path, echandle *ItemDictionaryHandle); - bool (*ContainsPath)(echandle DictionaryHandle, const char *Path); - - bool (*GetStringPtrByPath)(echandle DictionaryHandle, const char *Path, const char **StringPtr); - bool (*ContainsString)(echandle DictionaryHandle, const char *String); - bool (*RemoveByString)(echandle DictionaryHandle, const char *String); - - bool (*GetDictionaryByPath)(echandle DictionaryHandle, const char *Path, echandle *ItemDictionaryHandle); + bool (*get_parent)(echandle handle, echandle *parent_dictionary_handle, echandle *parent_item_handle); + bool (*add)(echandle handle, const char *key, echandle *item_handle); + bool (*add_null)(echandle handle, const char *key, echandle *item_handle); + bool (*add_string)(echandle handle, const char *key, const char *value, echandle *item_handle); + bool (*add_int)(echandle handle, const char *key, int64_t value, echandle *item_handle); + bool (*add_float)(echandle handle, const char *key, float64_t value, echandle *item_handle); + bool (*add_boolean)(echandle handle, const char *key, bool value, echandle *item_handle); + bool (*add_list)(echandle handle, const char *key, echandle *list_handle, echandle *item_handle); + bool (*add_dictionary)(echandle handle, const char *key, echandle *dict_handle, echandle *item_handle); + bool (*insert)(echandle handle, echandle prev_item_handle, const char *key, echandle *item_handle); + bool (*remove)(echandle handle, echandle *item_handle); + + bool (*convert_from_string)(echandle handle, const char *value, int32_t max_value, char key_value_separator, + char item_separator); + bool (*convert_to_string)(echandle handle, char *value, int32_t max_value, char key_value_separator, + char item_separator); + + bool (*contains_key)(echandle handle, const char *key); + bool (*ensure_index)(echandle handle, int32_t index, echandle *item_handle); + bool (*ensure_list_by_index)(echandle handle, int32_t index, echandle *item_handle, + echandle *item_dictionary_handle); + bool (*ensure_dictionary_by_index)(echandle handle, int32_t index, echandle *item_handle, + echandle *item_dictionary_handle); + bool (*ensure_key)(echandle handle, const char *key, echandle *item_handle); + bool (*ensure_list)(echandle handle, const char *key, echandle *item_handle, echandle *item_dictionary_handle); + bool (*ensure_dictionary)(echandle handle, const char *key, echandle *item_handle, + echandle *item_dictionary_handle); + + bool (*get_type_by_key)(echandle handle, const char *key, int32_t *type); + bool (*set_string_by_key)(echandle handle, const char *key, const char *string); + bool (*get_string_by_key)(echandle handle, const char *key, char *string, int32_t max_string); + bool (*set_string_by_key_v)(echandle handle, const char *key, const char *string, va_list argument_list); + bool (*get_string_ptr_by_key)(echandle handle, const char *key, const char **string_ptr); + bool (*get_buffer_ptr_by_key)(echandle handle, const char *key, const char **buffer_ptr, int32_t *buffer_length); + bool (*set_int_by_key)(echandle handle, const char *key, int64_t value); + bool (*get_int32_by_key)(echandle handle, const char *key, int32_t *value); + bool (*get_int64_by_key)(echandle handle, const char *key, int64_t *value); + bool (*set_float_by_key)(echandle handle, const char *key, float64_t value); + bool (*get_float_by_key)(echandle handle, const char *key, float64_t *value); + bool (*set_boolean_by_key)(echandle handle, const char *key, bool value); + bool (*get_boolean_by_key)(echandle handle, const char *key, bool *value); + bool (*get_list_by_index)(echandle handle, int32_t index, echandle *item_dictionary_handle); + bool (*get_dictionary_by_index)(echandle handle, int32_t index, echandle *item_dictionary_handle); + bool (*get_list_by_key)(echandle handle, const char *key, echandle *item_dictionary_handle); + bool (*get_dictionary_by_key)(echandle handle, const char *key, echandle *item_dictionary_handle); + bool (*remove_by_key)(echandle handle, const char *key); + + bool (*item_get_path)(echandle handle, echandle item_handle, echandle top_dictionary_handle, char *path, + int32_t max_path); + bool (*item_is_container)(echandle handle, echandle item_handle); + bool (*item_is_null)(echandle handle, echandle item_handle); + bool (*item_get_index)(echandle handle, echandle item_handle, int32_t *index); + bool (*item_set_type)(echandle handle, echandle item_handle, int32_t type); + int32_t (*item_get_type)(echandle handle, echandle item_handle); + bool (*item_compare_type)(echandle handle, echandle item_handle, int32_t type); + bool (*item_set_key)(echandle handle, echandle item_handle, const char *key); + bool (*item_set_key_length)(echandle handle, echandle item_handle, const char *key, int32_t key_length); + bool (*item_get_key)(echandle handle, echandle item_handle, char *key, int32_t max_key); + bool (*item_get_key_ptr)(echandle handle, echandle item_handle, const char **key_ptr); + bool (*item_set_string)(echandle handle, echandle item_handle, const char *string); + bool (*item_set_string_v)(echandle handle, echandle item_handle, const char *string, va_list argument_list); + bool (*item_get_string)(echandle handle, echandle item_handle, char *string, int32_t max_string); + bool (*item_get_string_ptr)(echandle handle, echandle item_handle, const char **string_ptr); + bool (*item_set_buffer)(echandle handle, echandle item_handle, const char *buffer, int32_t buffer_length); + bool (*item_get_buffer_ptr)(echandle handle, echandle item_handle, const char **buffer_ptr, int32_t *buffer_length); + bool (*item_set_float)(echandle handle, echandle item_handle, float64_t value); + bool (*item_get_float)(echandle handle, echandle item_handle, float64_t *value); + bool (*item_set_int)(echandle handle, echandle item_handle, int64_t value); + bool (*item_get_int32)(echandle handle, echandle item_handle, int32_t *value); + bool (*item_get_int64)(echandle handle, echandle item_handle, int64_t *value); + bool (*item_set_boolean)(echandle handle, echandle item_handle, bool value); + bool (*item_get_boolean)(echandle handle, echandle item_handle, bool *value); + bool (*item_set_null)(echandle handle, echandle item_handle); + bool (*item_get_dictionary_handle)(echandle handle, echandle item_handle, echandle *dict_handle); + bool (*item_find_by_path)(echandle handle, const char *path, echandle *item_dictionary_handle, + echandle *item_handle); + bool (*item_find_by_key)(echandle handle, const char *key, echandle start_item_handle, echandle *item_handle); + bool (*item_find_by_buffer)(echandle handle, const char *buffer, int32_t buffer_length, echandle start_item_handle, + echandle *item_handle); + bool (*item_find_by_index)(echandle handle, int32_t index, echandle start_item_handle, echandle *item_handle); + bool (*item_get_next)(echandle handle, echandle item_handle, echandle *next_item_handle); + bool (*item_get_prev)(echandle handle, echandle item_handle, echandle *prev_item_handle); + bool (*item_get_first)(echandle handle, echandle *item_handle); + bool (*item_get_last)(echandle handle, echandle *item_handle); + int32_t (*item_get_count)(echandle handle); + + FORMAT(2, 3) + bool (*log)(echandle handle, const char *format, ...); + FORMAT(3, 4) + bool (*log_tabbed)(echandle handle, int32_t depth, const char *format, ...); + bool (*set_log_callback)(echandle handle, echandle log_handle, Generic_LogCallback callback); + bool (*get_log_callback)(echandle handle, echandle *log_handle, Generic_LogCallback *callback); + + bool (*sync)(echandle target_dictionary_handle, echandle source_dictionary_handle, void *filter_user_ptr, + IDictionary_ItemFilterCallback filter_callback); + bool (*sync_at)(echandle target_dictionary_handle, echandle source_dictionary_handle, echandle source_item_handle, + void *filter_user_ptr, IDictionary_ItemFilterCallback filter_callback); + bool (*remove_missing)(echandle target_dictionary_handle, echandle source_dictionary_handle); + + bool (*merge)(echandle target_dictionary_handle, echandle source_dictionary_handle, int32_t flags); + bool (*merge_at)(echandle target_dictionary_handle, echandle source_dictionary_handle, echandle source_item_handle, + int32_t flags); + echandle (*skip_root)(echandle handle); + bool (*reset)(echandle handle); + bool (*dump)(echandle handle); + + bool (*set_case_sensitive)(echandle handle, bool case_sensitive); + bool (*get_case_sensitive)(echandle handle); + bool (*set_allow_duplicates)(echandle handle, bool allow_duplicates); + bool (*get_allow_duplicates)(echandle handle); + + bool (*set_item_remove_callback)(echandle handle, void *user_ptr, IDictionary_ItemRemoveCallback callback); + bool (*get_item_remove_callback)(echandle handle, void **user_ptr, IDictionary_ItemRemoveCallback *callback); + bool (*set_item_key_change_callback)(echandle handle, void *user_ptr, IDictionary_ItemKeyChangeCallback callback); + bool (*get_item_key_change_callback)(echandle handle, void **user_ptr, IDictionary_ItemKeyChangeCallback *callback); + bool (*set_item_value_change_callback)(echandle handle, void *user_ptr, + IDictionary_ItemValueChangeCallback callback); + bool (*get_item_value_change_callback)(echandle handle, void **user_ptr, + IDictionary_ItemValueChangeCallback *callback); + + bool (*merge_item)(echandle target_dictionary_handle, echandle *target_prev_item_handle, + echandle source_dictionary_handle, echandle source_item_handle, int32_t flags); + bool (*set_string_by_key_print)(echandle handle, const char *key, const char *string, ...); + bool (*item_set_string_print)(echandle handle, echandle item_handle, const char *string, ...); + + bool (*set_string_by_path)(echandle handle, const char *path, const char *string); + bool (*get_string_by_path)(echandle handle, const char *path, char *string, int32_t max_string); + bool (*get_buffer_ptr_by_path)(echandle handle, const char *path, const char **buffer_ptr, int32_t *buffer_length); + bool (*set_int_by_path)(echandle handle, const char *path, int64_t value); + bool (*get_int32_by_path)(echandle handle, const char *path, int32_t *value); + bool (*get_int64_by_path)(echandle handle, const char *path, int64_t *value); + bool (*set_float_by_path)(echandle handle, const char *path, float64_t value); + bool (*get_float_by_path)(echandle handle, const char *path, float64_t *value); + bool (*set_boolean_by_path)(echandle handle, const char *path, bool value); + bool (*get_boolean_by_path)(echandle handle, const char *path, bool *value); + echandle (*skip_root_container)(echandle handle); + bool (*item_set_private)(echandle handle, echandle item_handle, bool enabled); + bool (*item_is_private)(echandle handle, echandle item_handle); + bool (*set_private_keys)(echandle handle, bool private_keys); + bool (*get_private_keys)(echandle handle); + + echandle (*add_ref)(echandle handle); + int32_t (*release)(echandle *dictionary_handle); + + bool (*ensure_dictionary_by_path)(echandle handle, const char *path, echandle *item_dictionary_handle); + bool (*contains_path)(echandle handle, const char *path); + + bool (*get_string_ptr_by_path)(echandle handle, const char *path, const char **string_ptr); + bool (*contains_string)(echandle handle, const char *string); + bool (*remove_by_string)(echandle handle, const char *string); + + bool (*get_dictionary_by_path)(echandle handle, const char *path, echandle *item_dictionary_handle); } IDictionaryVtbl; /*********************************************************************/ -#define IDictionary_GetParent(DictionaryHandle, ParentDictionaryHandle, ParentItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->GetParent(DictionaryHandle, ParentDictionaryHandle, ParentItemHandle) -#define IDictionary_Add(DictionaryHandle, Key, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Add(DictionaryHandle, Key, ItemHandle) -#define IDictionary_AddNull(DictionaryHandle, Key, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddNull(DictionaryHandle, Key, ItemHandle) -#define IDictionary_AddString(DictionaryHandle, Key, Value, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddString(DictionaryHandle, Key, Value, ItemHandle) -#define IDictionary_AddInt(DictionaryHandle, Key, Value, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddInt(DictionaryHandle, Key, Value, ItemHandle) -#define IDictionary_AddFloat(DictionaryHandle, Key, Value, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddFloat(DictionaryHandle, Key, Value, ItemHandle) -#define IDictionary_AddBoolean(DictionaryHandle, Key, Value, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddBoolean(DictionaryHandle, Key, Value, ItemHandle) -#define IDictionary_AddList(DictionaryHandle, Key, ListHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddList(DictionaryHandle, Key, ListHandle, ItemHandle) -#define IDictionary_AddDictionary(DictionaryHandle, Key, DictHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddDictionary(DictionaryHandle, Key, DictHandle, ItemHandle) -#define IDictionary_Insert(DictionaryHandle, PrevItemHandle, Key, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Insert(DictionaryHandle, PrevItemHandle, Key, ItemHandle) -#define IDictionary_Remove(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Remove(DictionaryHandle, ItemHandle) - -#define IDictionary_ConvertFromString(DictionaryHandle, Value, MaxValue, KeyValueSeparator, ItemSeparator) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ConvertFromString(DictionaryHandle, Value, MaxValue, KeyValueSeparator, ItemSeparator) -#define IDictionary_ConvertToString(DictionaryHandle, Value, MaxValue, KeyValueSeparator, ItemSeparator) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ConvertToString(DictionaryHandle, Value, MaxValue, KeyValueSeparator, ItemSeparator) - -#define IDictionary_ContainsKey(DictionaryHandle, Key) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ContainsKey(DictionaryHandle, Key) -#define IDictionary_ContainsString(DictionaryHandle, String) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ContainsString(DictionaryHandle, String) -#define IDictionary_ContainsPath(DictionaryHandle, Path) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ContainsPath(DictionaryHandle, Path) -#define IDictionary_EnsureIndex(DictionaryHandle, Index, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->EnsureIndex(DictionaryHandle, Index, ItemHandle) -#define IDictionary_EnsureKey(DictionaryHandle, Key, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->EnsureKey(DictionaryHandle, Key, ItemHandle) -#define IDictionary_EnsureList(DictionaryHandle, Key, ItemHandle, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->EnsureList(DictionaryHandle, Key, ItemHandle, ItemDictionaryHandle) -#define IDictionary_EnsureListByIndex(DictionaryHandle, Index, ItemHandle, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->EnsureListByIndex(DictionaryHandle, Index, ItemHandle, ItemDictionaryHandle) -#define IDictionary_EnsureDictionary(DictionaryHandle, Key, ItemHandle, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->EnsureDictionary(DictionaryHandle, Key, ItemHandle, ItemDictionaryHandle) -#define IDictionary_EnsureDictionaryByPath(DictionaryHandle, Path, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->EnsureDictionaryByPath(DictionaryHandle, Path, ItemDictionaryHandle) -#define IDictionary_EnsureDictionaryByIndex(DictionaryHandle, Index, ItemHandle, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->EnsureDictionaryByIndex(DictionaryHandle, Index, ItemHandle, ItemDictionaryHandle) -#define IDictionary_GetTypeByKey(DictionaryHandle, Key, Type) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetTypeByKey(DictionaryHandle, Key, Type) -#define IDictionary_SetStringByKey(DictionaryHandle, Key, String) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetStringByKey(DictionaryHandle, Key, String) -#define IDictionary_SetStringByKeyPrint(DictionaryHandle, Key, String, ...) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetStringByKeyPrint(DictionaryHandle, Key, String, __VA_ARGS__) -#define IDictionary_GetStringByKey(DictionaryHandle, Key, String, MaxString) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetStringByKey(DictionaryHandle, Key, String, MaxString) -#define IDictionary_SetStringByPath(DictionaryHandle, Path, String) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetStringByPath(DictionaryHandle, Path, String) -#define IDictionary_GetStringByPath(DictionaryHandle, Path, String, MaxString) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetStringByPath(DictionaryHandle, Path, String, MaxString) -#define IDictionary_SetStringByKeyV(DictionaryHandle, Key, String, ArgumentList) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetStringByKeyV(DictionaryHandle, Key, String, ArgumentList) -#define IDictionary_GetStringPtrByKey(DictionaryHandle, Key, StringPtr) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetStringPtrByKey(DictionaryHandle, Key, StringPtr) -#define IDictionary_GetStringPtrByPath(DictionaryHandle, Path, StringPtr) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetStringPtrByPath(DictionaryHandle, Path, StringPtr) -#define IDictionary_GetBufferPtrByKey(DictionaryHandle, Key, BufferPtr, BufferLength) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetBufferPtrByKey(DictionaryHandle, Key, BufferPtr, BufferLength) -#define IDictionary_GetBufferPtrByPath(DictionaryHandle, Path, BufferPtr, BufferLength) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->GetBufferPtrByPath(DictionaryHandle, Path, BufferPtr, BufferLength) -#define IDictionary_SetIntByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetIntByKey(DictionaryHandle, Key, Value) -#define IDictionary_SetIntByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetIntByPath(DictionaryHandle, Path, Value) -#define IDictionary_GetInt32ByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetInt32ByKey(DictionaryHandle, Key, Value) -#define IDictionary_GetInt32ByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetInt32ByPath(DictionaryHandle, Path, Value) -#define IDictionary_GetInt64ByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetInt64ByKey(DictionaryHandle, Key, Value) -#define IDictionary_GetInt64ByPath(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetInt64ByPath(DictionaryHandle, Path, Value) -#define IDictionary_SetFloatByKey(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetFloatByKey(DictionaryHandle, Key, Value) -#define IDictionary_SetFloatByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetFloatByPath(DictionaryHandle, Path, Value) -#define IDictionary_GetFloatByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetFloatByKey(DictionaryHandle, Key, Value) -#define IDictionary_GetFloatByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetFloatByPath(DictionaryHandle, Path, Value) -#define IDictionary_SetBooleanByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetBooleanByKey(DictionaryHandle, Key, Value) -#define IDictionary_SetBooleanByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetBooleanByPath(DictionaryHandle, Path, Value) -#define IDictionary_GetBooleanByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetBooleanByKey(DictionaryHandle, Key, Value) -#define IDictionary_GetBooleanByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetBooleanByPath(DictionaryHandle, Path, Value) -#define IDictionary_GetListByIndex(DictionaryHandle, Index, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetListByIndex(DictionaryHandle, Index, ItemDictionaryHandle) -#define IDictionary_GetListByKey(DictionaryHandle, Key, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetListByKey(DictionaryHandle, Key, ItemDictionaryHandle) -#define IDictionary_GetDictionaryByIndex(DictionaryHandle, Index, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->GetDictionaryByIndex(DictionaryHandle, Index, ItemDictionaryHandle) -#define IDictionary_GetDictionaryByKey(DictionaryHandle, Key, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetDictionaryByKey(DictionaryHandle, Key, ItemDictionaryHandle) -#define IDictionary_GetDictionaryByPath(DictionaryHandle, Path, ItemDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetDictionaryByPath(DictionaryHandle, Path, ItemDictionaryHandle) -#define IDictionary_RemoveByKey(DictionaryHandle, Key) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->RemoveByKey(DictionaryHandle, Key) -#define IDictionary_RemoveByString(DictionaryHandle, String) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->RemoveByString(DictionaryHandle, String) - -#define IDictionary_ItemGetPath(DictionaryHandle, ItemHandle, TopDictionaryHandle, Path, MaxPath) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ItemGetPath(DictionaryHandle, ItemHandle, TopDictionaryHandle, Path, MaxPath) -#define IDictionary_ItemIsContainer(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemIsContainer(DictionaryHandle, ItemHandle) -#define IDictionary_ItemIsNull(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemIsNull(DictionaryHandle, ItemHandle) -#define IDictionary_ItemGetIndex(DictionaryHandle, ItemHandle, Index) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetIndex(DictionaryHandle, ItemHandle, Index) -#define IDictionary_ItemSetType(DictionaryHandle, ItemHandle, Type) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetType(DictionaryHandle, ItemHandle, Type) -#define IDictionary_ItemGetType(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetType(DictionaryHandle, ItemHandle) -#define IDictionary_ItemCompareType(DictionaryHandle, ItemHandle, Type) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemCompareType(DictionaryHandle, ItemHandle, Type) -#define IDictionary_ItemSetKey(DictionaryHandle, ItemHandle, Key) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetKey(DictionaryHandle, ItemHandle, Key) -#define IDictionary_ItemSetKeyLength(DictionaryHandle, ItemHandle, Key, KeyLength) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetKeyLength(DictionaryHandle, ItemHandle, Key, KeyLength) -#define IDictionary_ItemGetKey(DictionaryHandle, ItemHandle, Key, MaxKey) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetKey(DictionaryHandle, ItemHandle, Key, MaxKey) -#define IDictionary_ItemGetKeyPtr(DictionaryHandle, ItemHandle, KeyPtr) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetKeyPtr(DictionaryHandle, ItemHandle, KeyPtr) -#define IDictionary_ItemSetString(DictionaryHandle, ItemHandle, String) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetString(DictionaryHandle, ItemHandle, String) -#define IDictionary_ItemSetStringPrint(DictionaryHandle, ItemHandle, String, ...) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ItemSetStringPrint(DictionaryHandle, ItemHandle, String, __VA_ARGS__) -#define IDictionary_ItemSetStringV(DictionaryHandle, ItemHandle, String, ArgumentList) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ItemSetStringV(DictionaryHandle, ItemHandle, String, ArgumentList) -#define IDictionary_ItemGetString(DictionaryHandle, ItemHandle, String, MaxString) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetString(DictionaryHandle, ItemHandle, String, MaxString) -#define IDictionary_ItemGetStringPtr(DictionaryHandle, ItemHandle, StringPtr) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetStringPtr(DictionaryHandle, ItemHandle, StringPtr) -#define IDictionary_ItemSetBuffer(DictionaryHandle, ItemHandle, Buffer, BufferLength) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetBuffer(DictionaryHandle, ItemHandle, Buffer, BufferLength) -#define IDictionary_ItemGetBufferPtr(DictionaryHandle, ItemHandle, BufferPtr, BufferLength) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ItemGetBufferPtr(DictionaryHandle, ItemHandle, BufferPtr, BufferLength) -#define IDictionary_ItemSetFloat(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetFloat(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemGetFloat(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetFloat(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemSetInt(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetInt(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemGetInt32(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetInt32(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemGetInt64(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetInt64(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemSetBoolean(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetBoolean(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemGetBoolean(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetBoolean(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemSetPrivate(DictionaryHandle, ItemHandle, Private) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetPrivate(DictionaryHandle, ItemHandle, Private) -#define IDictionary_ItemIsPrivate(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemIsPrivate(DictionaryHandle, ItemHandle) -#define IDictionary_ItemSetNull(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetNull(DictionaryHandle, ItemHandle) -#define IDictionary_ItemGetDictionaryHandle(DictionaryHandle, ItemHandle, DictHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetDictionaryHandle(DictionaryHandle, ItemHandle, DictHandle) -#define IDictionary_ItemFindByPath(DictionaryHandle, Path, ItemDictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ItemFindByPath(DictionaryHandle, Path, ItemDictionaryHandle, ItemHandle) -#define IDictionary_ItemFindByKey(DictionaryHandle, Key, StartItemHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemFindByKey(DictionaryHandle, Key, StartItemHandle, ItemHandle) -#define IDictionary_ItemFindByBuffer(DictionaryHandle, Buffer, BufferLength, StartItemHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ItemFindByBuffer(DictionaryHandle, Buffer, BufferLength, StartItemHandle, ItemHandle) -#define IDictionary_ItemFindByIndex(DictionaryHandle, Index, StartItemHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ItemFindByIndex(DictionaryHandle, Index, StartItemHandle, ItemHandle) -#define IDictionary_ItemGetNext(DictionaryHandle, ItemHandle, NextItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetNext(DictionaryHandle, ItemHandle, NextItemHandle) -#define IDictionary_ItemGetPrev(DictionaryHandle, ItemHandle, PrevItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetPrev(DictionaryHandle, ItemHandle, PrevItemHandle) -#define IDictionary_ItemGetFirst(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetFirst(DictionaryHandle, ItemHandle) -#define IDictionary_ItemGetLast(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetLast(DictionaryHandle, ItemHandle) -#define IDictionary_ItemGetCount(DictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetCount(DictionaryHandle) - -#define IDictionary_Log(DictionaryHandle, Format, ...) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Log(DictionaryHandle, Format, __VA_ARGS__) -#define IDictionary_LogTabbed(DictionaryHandle, Depth, Format, ...) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->LogTabbed(DictionaryHandle, Depth, Format, __VA_ARGS__) -#define IDictionary_SetLogCallback(DictionaryHandle, LogHandle, Callback) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetLogCallback(DictionaryHandle, LogHandle, Callback) -#define IDictionary_GetLogCallback(DictionaryHandle, LogHandle, Callback) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetLogCallback(DictionaryHandle, LogHandle, Callback) - -#define IDictionary_Sync(TargetDictionaryHandle, SourceDictionaryHandle, FilterUserPtr, FilterCallback) \ - Class_VtblCast(TargetDictionaryHandle, IDictionaryVtbl) \ - ->Sync(TargetDictionaryHandle, SourceDictionaryHandle, FilterUserPtr, FilterCallback) -#define IDictionary_SyncAt(TargetDictionaryHandle, SourceDictionaryHandle, SourceItemHandle, FilterUserPtr, \ - FilterCallback) \ - Class_VtblCast(TargetDictionaryHandle, IDictionaryVtbl) \ - ->SyncAt(TargetDictionaryHandle, SourceDictionaryHandle, SourceItemHandle, FilterUserPtr, FilterCallback) -#define IDictionary_RemoveMissing(TargetDictionaryHandle, SourceDictionaryHandle) \ - Class_VtblCast(TargetDictionaryHandle, IDictionaryVtbl) \ - ->RemoveMissing(TargetDictionaryHandle, SourceDictionaryHandle) -#define IDictionary_Merge(TargetDictionaryHandle, SourceDictionaryHandle, Flags) \ - Class_VtblCast(TargetDictionaryHandle, IDictionaryVtbl) \ - ->Merge(TargetDictionaryHandle, SourceDictionaryHandle, Flags) -#define IDictionary_MergeAt(TargetDictionaryHandle, SourceDictionaryHandle, SourceItemHandle, Flags) \ - Class_VtblCast(TargetDictionaryHandle, IDictionaryVtbl) \ - ->MergeAt(TargetDictionaryHandle, SourceDictionaryHandle, SourceItemHandle, Flags) -#define IDictionary_MergeItem(TargetDictionaryHandle, SourceDictionaryHandle, SourceItemHandle, Flags) \ - Class_VtblCast(TargetDictionaryHandle, IDictionaryVtbl) \ - ->MergeItem(TargetDictionaryHandle, SourceDictionaryHandle, SourceItemHandle, Flags) -#define IDictionary_SkipRoot(DictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SkipRoot(DictionaryHandle) -#define IDictionary_SkipRootContainer(DictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SkipRootContainer(DictionaryHandle) -#define IDictionary_Reset(DictionaryHandle) Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Reset(DictionaryHandle) -#define IDictionary_Dump(DictionaryHandle) Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Dump(DictionaryHandle) - -#define IDictionary_SetCaseSensitive(DictionaryHandle, CaseSensitive) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetCaseSensitive(DictionaryHandle, CaseSensitive) -#define IDictionary_GetCaseSensitive(DictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetCaseSensitive(DictionaryHandle) -#define IDictionary_SetPrivateKeys(DictionaryHandle, PrivateKeys) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetPrivateKeys(DictionaryHandle, PrivateKeys) -#define IDictionary_GetPrivateKeys(DictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetPrivateKeys(DictionaryHandle) -#define IDictionary_SetAllowDuplicates(DictionaryHandle, AllowDuplicates) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetAllowDuplicates(DictionaryHandle, AllowDuplicates) -#define IDictionary_GetAllowDuplicates(DictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetAllowDuplicates(DictionaryHandle) - -#define IDictionary_SetItemRemoveCallback(DictionaryHandle, UserPtr, Callback) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetItemRemoveCallback(DictionaryHandle, UserPtr, Callback) -#define IDictionary_GetItemRemoveCallback(DictionaryHandle, UserPtr, Callback) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetItemRemoveCallback(DictionaryHandle, UserPtr, Callback) -#define IDictionary_SetItemKeyChangeCallback(DictionaryHandle, UserPtr, Callback) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetItemKeyChangeCallback(DictionaryHandle, UserPtr, Callback) -#define IDictionary_GetItemKeyChangeCallback(DictionaryHandle, UserPtr, Callback) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetItemKeyChangeCallback(DictionaryHandle, UserPtr, Callback) -#define IDictionary_SetItemValueChangeCallback(DictionaryHandle, UserPtr, Callback) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetItemValueChangeCallback(DictionaryHandle, UserPtr, Callback) -#define IDictionary_GetItemValueChangeCallback(DictionaryHandle, UserPtr, Callback) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetItemValueChangeCallback(DictionaryHandle, UserPtr, Callback) - -#define IDictionary_Create() Dictionary_Create() -#define IDictionary_AddRef(DictionaryHandle) Dictionary_AddRef(DictionaryHandle) -#define IDictionary_Release(DictionaryHandle) Dictionary_Release(DictionaryHandle) +#define IDictionary_GetParent(handle, parent_dictionary_handle, parent_item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_parent(handle, parent_dictionary_handle, parent_item_handle) +#define IDictionary_Add(handle, key, item_handle) Class_VtblCast(handle, IDictionaryVtbl)->add(handle, key, item_handle) +#define IDictionary_AddNull(handle, key, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->add_null(handle, key, item_handle) +#define IDictionary_AddString(handle, key, value, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->add_string(handle, key, value, item_handle) +#define IDictionary_AddInt(handle, key, value, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->add_int(handle, key, value, item_handle) +#define IDictionary_AddFloat(handle, key, value, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->add_float(handle, key, value, item_handle) +#define IDictionary_AddBoolean(handle, key, value, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->add_boolean(handle, key, value, item_handle) +#define IDictionary_AddList(handle, key, list_handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->add_list(handle, key, list_handle, item_handle) +#define IDictionary_AddDictionary(handle, key, dict_handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->add_dictionary(handle, key, dict_handle, item_handle) +#define IDictionary_Insert(handle, prev_item_handle, key, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->insert(handle, prev_item_handle, key, item_handle) +#define IDictionary_Remove(handle, item_handle) Class_VtblCast(handle, IDictionaryVtbl)->remove(handle, item_handle) + +#define IDictionary_ConvertFromString(handle, value, max_value, key_value_separator, item_separator) \ + Class_VtblCast(handle, IDictionaryVtbl) \ + ->convert_from_string(handle, value, max_value, key_value_separator, item_separator) +#define IDictionary_ConvertToString(handle, value, max_value, key_value_separator, item_separator) \ + Class_VtblCast(handle, IDictionaryVtbl) \ + ->convert_to_string(handle, value, max_value, key_value_separator, item_separator) + +#define IDictionary_ContainsKey(handle, key) Class_VtblCast(handle, IDictionaryVtbl)->contains_key(handle, key) +#define IDictionary_ContainsString(handle, string) \ + Class_VtblCast(handle, IDictionaryVtbl)->contains_string(handle, string) +#define IDictionary_ContainsPath(handle, path) Class_VtblCast(handle, IDictionaryVtbl)->contains_path(handle, path) +#define IDictionary_EnsureIndex(handle, index, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->ensure_index(handle, index, item_handle) +#define IDictionary_EnsureKey(handle, key, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->ensure_key(handle, key, item_handle) +#define IDictionary_EnsureList(handle, key, item_handle, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->ensure_list(handle, key, item_handle, item_dictionary_handle) +#define IDictionary_EnsureListByIndex(handle, index, item_handle, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->ensure_list_by_index(handle, index, item_handle, item_dictionary_handle) +#define IDictionary_EnsureDictionary(handle, key, item_handle, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->ensure_dictionary(handle, key, item_handle, item_dictionary_handle) +#define IDictionary_EnsureDictionaryByPath(handle, path, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->ensure_dictionary_by_path(handle, path, item_dictionary_handle) +#define IDictionary_EnsureDictionaryByIndex(handle, index, item_handle, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl) \ + ->ensure_dictionary_by_index(handle, index, item_handle, item_dictionary_handle) +#define IDictionary_GetTypeByKey(handle, key, type) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_type_by_key(handle, key, type) +#define IDictionary_SetStringByKey(handle, key, string) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_string_by_key(handle, key, string) +#define IDictionary_SetStringByKeyPrint(handle, key, string, ...) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_string_by_key_print(handle, key, string, __VA_ARGS__) +#define IDictionary_GetStringByKey(handle, key, string, max_string) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_string_by_key(handle, key, string, max_string) +#define IDictionary_SetStringByPath(handle, path, string) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_string_by_path(handle, path, string) +#define IDictionary_GetStringByPath(handle, path, string, max_string) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_string_by_path(handle, path, string, max_string) +#define IDictionary_SetStringByKeyV(handle, key, string, argument_list) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_string_by_key_v(handle, key, string, argument_list) +#define IDictionary_GetStringPtrByKey(handle, key, string_ptr) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_string_ptr_by_key(handle, key, string_ptr) +#define IDictionary_GetStringPtrByPath(handle, path, string_ptr) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_string_ptr_by_path(handle, path, string_ptr) +#define IDictionary_GetBufferPtrByKey(handle, key, buffer_ptr, buffer_length) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_buffer_ptr_by_key(handle, key, buffer_ptr, buffer_length) +#define IDictionary_GetBufferPtrByPath(handle, path, buffer_ptr, buffer_length) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_buffer_ptr_by_path(handle, path, buffer_ptr, buffer_length) +#define IDictionary_SetIntByKey(handle, key, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_int_by_key(handle, key, value) +#define IDictionary_SetIntByPath(handle, path, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_int_by_path(handle, path, value) +#define IDictionary_GetInt32ByKey(handle, key, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_int32_by_key(handle, key, value) +#define IDictionary_GetInt32ByPath(handle, path, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_int32_by_path(handle, path, value) +#define IDictionary_GetInt64ByKey(handle, key, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_int64_by_key(handle, key, value) +#define IDictionary_GetInt64ByPath(handle, path, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_int64_by_path(handle, path, value) +#define IDictionary_SetFloatByKey(handle, key, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_float_by_key(handle, key, value) +#define IDictionary_SetFloatByPath(handle, path, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_float_by_path(handle, path, value) +#define IDictionary_GetFloatByKey(handle, key, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_float_by_key(handle, key, value) +#define IDictionary_GetFloatByPath(handle, path, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_float_by_path(handle, path, value) +#define IDictionary_SetBooleanByKey(handle, key, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_boolean_by_key(handle, key, value) +#define IDictionary_SetBooleanByPath(handle, path, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_boolean_by_path(handle, path, value) +#define IDictionary_GetBooleanByKey(handle, key, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_boolean_by_key(handle, key, value) +#define IDictionary_GetBooleanByPath(handle, path, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_boolean_by_path(handle, path, value) +#define IDictionary_GetListByIndex(handle, index, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_list_by_index(handle, index, item_dictionary_handle) +#define IDictionary_GetListByKey(handle, key, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_list_by_key(handle, key, item_dictionary_handle) +#define IDictionary_GetDictionaryByIndex(handle, index, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_dictionary_by_index(handle, index, item_dictionary_handle) +#define IDictionary_GetDictionaryByKey(handle, key, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_dictionary_by_key(handle, key, item_dictionary_handle) +#define IDictionary_GetDictionaryByPath(handle, path, item_dictionary_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_dictionary_by_path(handle, path, item_dictionary_handle) +#define IDictionary_RemoveByKey(handle, key) Class_VtblCast(handle, IDictionaryVtbl)->remove_by_key(handle, key) +#define IDictionary_RemoveByString(handle, string) \ + Class_VtblCast(handle, IDictionaryVtbl)->remove_by_string(handle, string) + +#define IDictionary_ItemGetPath(handle, item_handle, top_dictionary_handle, path, max_path) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_path(handle, item_handle, top_dictionary_handle, path, max_path) +#define IDictionary_ItemIsContainer(handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_is_container(handle, item_handle) +#define IDictionary_ItemIsNull(handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_is_null(handle, item_handle) +#define IDictionary_ItemIsPrivate(handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_is_private(handle, item_handle) +#define IDictionary_ItemGetIndex(handle, item_handle, index) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_index(handle, item_handle, index) +#define IDictionary_ItemSetType(handle, item_handle, type) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_type(handle, item_handle, type) +#define IDictionary_ItemGetType(handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_type(handle, item_handle) +#define IDictionary_ItemCompareType(handle, item_handle, type) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_compare_type(handle, item_handle, type) +#define IDictionary_ItemSetKey(handle, item_handle, key) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_key(handle, item_handle, key) +#define IDictionary_ItemSetKeyLength(handle, item_handle, key, key_length) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_key_length(handle, item_handle, key, key_length) +#define IDictionary_ItemGetKey(handle, item_handle, key, max_key) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_key(handle, item_handle, key, max_key) +#define IDictionary_ItemGetKeyPtr(handle, item_handle, keyPtr) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_key_ptr(handle, item_handle, keyPtr) +#define IDictionary_ItemSetString(handle, item_handle, string) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_string(handle, item_handle, string) +#define IDictionary_ItemSetStringPrint(handle, item_handle, string, ...) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_string_print(handle, item_handle, string, __VA_ARGS__) +#define IDictionary_ItemSetStringV(handle, item_handle, string, argument_list) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_string_v(handle, item_handle, string, argument_list) +#define IDictionary_ItemGetString(handle, item_handle, string, max_string) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_string(handle, item_handle, string, max_string) +#define IDictionary_ItemGetStringPtr(handle, item_handle, string_ptr) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_string_ptr(handle, item_handle, string_ptr) +#define IDictionary_ItemSetBuffer(handle, item_handle, buffer, buffer_length) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_buffer(handle, item_handle, buffer, buffer_length) +#define IDictionary_ItemGetBufferPtr(handle, item_handle, buffer_ptr, buffer_length) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_buffer_ptr(handle, item_handle, buffer_ptr, buffer_length) +#define IDictionary_ItemSetFloat(handle, item_handle, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_float(handle, item_handle, value) +#define IDictionary_ItemGetFloat(handle, item_handle, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_float(handle, item_handle, value) +#define IDictionary_ItemSetInt(handle, item_handle, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_int(handle, item_handle, value) +#define IDictionary_ItemGetInt32(handle, item_handle, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_int32(handle, item_handle, value) +#define IDictionary_ItemGetInt64(handle, item_handle, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_int64(handle, item_handle, value) +#define IDictionary_ItemSetBoolean(handle, item_handle, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_boolean(handle, item_handle, value) +#define IDictionary_ItemGetBoolean(handle, item_handle, value) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_boolean(handle, item_handle, value) +#define IDictionary_ItemSetPrivate(handle, item_handle, enabled) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_private(handle, item_handle, enabled) +#define IDictionary_ItemSetNull(handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_set_null(handle, item_handle) +#define IDictionary_ItemGetDictionaryHandle(handle, item_handle, dict_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_dictionary_handle(handle, item_handle, dict_handle) +#define IDictionary_ItemFindByPath(handle, path, item_dictionary_handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_find_by_path(handle, path, item_dictionary_handle, item_handle) +#define IDictionary_ItemFindByKey(handle, key, start_item_handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_find_by_key(handle, key, start_item_handle, item_handle) +#define IDictionary_ItemFindByBuffer(handle, buffer, buffer_length, start_item_handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl) \ + ->item_find_by_buffer(handle, buffer, buffer_length, start_item_handle, item_handle) +#define IDictionary_ItemFindByIndex(handle, index, start_item_handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_find_by_index(handle, index, start_item_handle, item_handle) +#define IDictionary_ItemGetNext(handle, item_handle, next_item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_next(handle, item_handle, next_item_handle) +#define IDictionary_ItemGetPrev(handle, item_handle, prev_item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_prev(handle, item_handle, prev_item_handle) +#define IDictionary_ItemGetFirst(handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_first(handle, item_handle) +#define IDictionary_ItemGetLast(handle, item_handle) \ + Class_VtblCast(handle, IDictionaryVtbl)->item_get_last(handle, item_handle) +#define IDictionary_ItemGetCount(handle) Class_VtblCast(handle, IDictionaryVtbl)->item_get_count(handle) + +#define IDictionary_Log(handle, format, ...) Class_VtblCast(handle, IDictionaryVtbl)->log(handle, format, __VA_ARGS__) +#define IDictionary_LogTabbed(handle, depth, format, ...) \ + Class_VtblCast(handle, IDictionaryVtbl)->log_tabbed(handle, depth, format, __VA_ARGS__) +#define IDictionary_SetLogCallback(handle, log_handle, callback) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_log_callback(handle, log_handle, callback) +#define IDictionary_GetLogCallback(handle, log_handle, callback) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_log_callback(handle, log_handle, callback) + +#define IDictionary_Sync(target_dictionary_handle, source_dictionary_handle, filter_user_ptr, filter_callback) \ + Class_VtblCast(target_dictionary_handle, IDictionaryVtbl) \ + ->sync(target_dictionary_handle, source_dictionary_handle, filter_user_ptr, filter_callback) +#define IDictionary_SyncAt(target_dictionary_handle, source_dictionary_handle, source_item_handle, filter_user_ptr, \ + filter_callback) \ + Class_VtblCast(target_dictionary_handle, IDictionaryVtbl) \ + ->sync_at(target_dictionary_handle, source_dictionary_handle, source_item_handle, filter_user_ptr, \ + filter_callback) +#define IDictionary_RemoveMissing(target_dictionary_handle, source_dictionary_handle) \ + Class_VtblCast(target_dictionary_handle, IDictionaryVtbl) \ + ->remove_missing(target_dictionary_handle, source_dictionary_handle) +#define IDictionary_Merge(target_dictionary_handle, source_dictionary_handle, flags) \ + Class_VtblCast(target_dictionary_handle, IDictionaryVtbl) \ + ->merge(target_dictionary_handle, source_dictionary_handle, flags) +#define IDictionary_MergeAt(target_dictionary_handle, source_dictionary_handle, source_item_handle, flags) \ + Class_VtblCast(target_dictionary_handle, IDictionaryVtbl) \ + ->merge_at(target_dictionary_handle, source_dictionary_handle, source_item_handle, flags) +#define IDictionary_MergeItem(target_dictionary_handle, target_prev_item_handle, source_dictionary_handle, \ + source_item_handle, flags) \ + Class_VtblCast(target_dictionary_handle, IDictionaryVtbl) \ + ->merge_item(target_dictionary_handle, target_prev_item_handle, source_dictionary_handle, source_item_handle, \ + flags) +#define IDictionary_SkipRoot(handle) Class_VtblCast(handle, IDictionaryVtbl)->skip_root(handle) +#define IDictionary_SkipRootContainer(handle) Class_VtblCast(handle, IDictionaryVtbl)->skip_root_container(handle) +#define IDictionary_Reset(handle) Class_VtblCast(handle, IDictionaryVtbl)->reset(handle) +#define IDictionary_Dump(handle) Class_VtblCast(handle, IDictionaryVtbl)->dump(handle) + +#define IDictionary_SetCaseSensitive(handle, case_sensitive) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_case_sensitive(handle, case_sensitive) +#define IDictionary_GetCaseSensitive(handle) Class_VtblCast(handle, IDictionaryVtbl)->get_case_sensitive(handle) +#define IDictionary_SetPrivateKeys(handle, private_keys) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_private_keys(handle, private_keys) +#define IDictionary_GetPrivateKeys(handle) Class_VtblCast(handle, IDictionaryVtbl)->get_private_keys(handle) +#define IDictionary_SetAllowDuplicates(handle, allow_duplicates) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_allow_duplicates(handle, allow_duplicates) +#define IDictionary_GetAllowDuplicates(handle) Class_VtblCast(handle, IDictionaryVtbl)->get_allow_duplicates(handle) + +#define IDictionary_SetItemRemoveCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_item_remove_callback(handle, user_ptr, callback) +#define IDictionary_GetItemRemoveCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_item_remove_callback(handle, user_ptr, callback) +#define IDictionary_SetItemKeyChangeCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_item_key_change_callback(handle, user_ptr, callback) +#define IDictionary_GetItemKeyChangeCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_item_key_change_callback(handle, user_ptr, callback) +#define IDictionary_SetItemValueChangeCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, IDictionaryVtbl)->set_item_value_change_callback(handle, user_ptr, callback) +#define IDictionary_GetItemValueChangeCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, IDictionaryVtbl)->get_item_value_change_callback(handle, user_ptr, callback) + +#define IDictionary_Create() Dictionary_Create() +#define IDictionary_AddRef(handle) Dictionary_AddRef(handle) +#define IDictionary_Release(handle) Dictionary_Release(handle) /*********************************************************************/ diff --git a/interoplib.c b/interoplib.c index 4435766..3ada941 100644 --- a/interoplib.c +++ b/interoplib.c @@ -92,14 +92,9 @@ bool Base64_Encode(const uint8_t *Source, int32_t SourceLength, char *Target, in return true; } -bool Base64_CalculateEncodeSize(int32_t SourceLength, int32_t *BytesRequired) { - // Round up to the nearest multiple of 4. - *BytesRequired = (SourceLength + 2) / 3 * 4; - - // Include NULL terminator - *BytesRequired += 1; - - return true; +int32_t Base64_CalculateEncodeSize(int32_t source_length) { + // Round up to the nearest multiple of 4 and include NULL terminator + return ((source_length + 2) / 3 * 4) + 1; } /*********************************************************************/ diff --git a/interoplib.h b/interoplib.h index 6c7da85..414dedf 100644 --- a/interoplib.h +++ b/interoplib.h @@ -41,48 +41,50 @@ typedef struct ClassStruct { /*********************************************************************/ -bool String_ConvertToHex(const uint8_t *Binary, int32_t BinarySize, bool Lower, char *Hex, int32_t MaxHex); +bool String_ConvertToHex(const uint8_t *binary, int32_t binary_size, bool lower, char *hex, int32_t max_hex); /*********************************************************************/ -bool Base64_Encode(const uint8_t *Source, int32_t SourceLength, char *Target, int32_t MaxTarget, int32_t *TargetLength); -bool Base64_CalculateEncodeSize(int32_t SourceLength, int32_t *BytesRequired); +bool Base64_Encode(const uint8_t *source, int32_t source_length, char *target, int32_t max_target, + int32_t *target_length); +int32_t Base64_CalculateEncodeSize(int32_t source_length); /*********************************************************************/ -typedef bool (*Generic_LogCallback)(echandle LogHandle, const char *Format, ...); +typedef bool (*Generic_LogCallback)(echandle log_handle, const char *format, ...); /*********************************************************************/ -typedef bool (*NotificationCenter_ObserverCallback)(void *UserPtr, const char *Type, const char *Notification, - const char *Sender, echandle DictionaryHandle); +typedef bool (*NotificationCenter_ObserverCallback)(void *user_ptr, const char *type, const char *notification, + const char *sender, echandle dictionary_handle); /*********************************************************************/ -void *Class_ConvertFromInstanceId(const char *InstanceId); -char *Class_ConvertToInstanceId(void *Pointer); -bool Class_TrackInstance(void *Pointer, const char *InstanceId); -bool Class_UntrackInstance(void *Pointer); +void *Class_ConvertFromInstanceId(const char *instance_id); +char *Class_ConvertToInstanceId(void *pointer); +bool Class_TrackInstance(void *pointer, const char *instance_id); +bool Class_UntrackInstance(void *pointer); echandle Dictionary_Create(void); -int32_t Dictionary_Release(echandle *DictionaryHandle); - -bool NotificationCenter_AddObserver(const char *Type, const char *Notification, void *UserPtr, - NotificationCenter_ObserverCallback Callback); -bool NotificationCenter_AddInstanceObserver(const char *Type, const char *Notification, const char *Sender, - void *UserPtr, NotificationCenter_ObserverCallback Callback); -bool NotificationCenter_RemoveObserver(const char *Type, const char *Notification, void *UserPtr, - NotificationCenter_ObserverCallback Callback); -bool NotificationCenter_RemoveInstanceObserver(const char *Type, const char *Notification, const char *Sender, - void *UserPtr, NotificationCenter_ObserverCallback Callback); -bool NotificationCenter_Fire(const char *Type, const char *Notification, const char *Sender, echandle DictionaryHandle); -bool NotificationCenter_FireWithJSON(const char *Type, const char *Notification, const char *Sender, const char *Format, +int32_t Dictionary_Release(echandle *dictionary_handle); + +bool NotificationCenter_AddObserver(const char *type, const char *notification, void *user_ptr, + NotificationCenter_ObserverCallback callback); +bool NotificationCenter_AddInstanceObserver(const char *type, const char *notification, const char *sender, + void *user_ptr, NotificationCenter_ObserverCallback callback); +bool NotificationCenter_RemoveObserver(const char *type, const char *notification, void *user_ptr, + NotificationCenter_ObserverCallback callback); +bool NotificationCenter_RemoveInstanceObserver(const char *type, const char *notification, const char *sender, + void *user_ptr, NotificationCenter_ObserverCallback callback); +bool NotificationCenter_Fire(const char *type, const char *notification, const char *sender, + echandle dictionary_handle); +bool NotificationCenter_FireWithJSON(const char *type, const char *notification, const char *sender, const char *format, ...); -bool NotificationCenter_FireAfterDelay(const char *Type, const char *Notification, const char *Sender, int32_t DelayMS, - echandle DictionaryHandle); -bool NotificationCenter_FireAfterDelayWithJSON(const char *Type, const char *Notification, const char *Sender, - int32_t DelayMS, const char *Format, ...); -bool Interop_GenerateInstanceId(char *String, int32_t MaxString); +bool NotificationCenter_FireAfterDelay(const char *type, const char *notification, const char *sender, int32_t delay_ms, + echandle dictionary_handle); +bool NotificationCenter_FireAfterDelayWithJSON(const char *type, const char *notification, const char *sender, + int32_t delay_ms, const char *format, ...); +bool Interop_GenerateInstanceId(char *string, int32_t max_string); /*********************************************************************/ diff --git a/interopstub.h b/interopstub.h index a9b90be..d55ef17 100644 --- a/interopstub.h +++ b/interopstub.h @@ -10,48 +10,48 @@ extern "C" { /*********************************************************************/ -typedef bool (*Interop_ExecuteCallback)(void *UserPtr, const char *InstanceId, echandle MethodDictionaryHandle, - echandle ReturnDictionaryHandle); -typedef int32_t (*Interop_ReleaseInstanceCallback)(void **UserPtr); -typedef bool (*Interop_InvokeInstanceCallback)(void *UserPtr, echandle MethodDictionaryHandle, - echandle ReturnDictionaryHandle); -typedef bool (*Interop_ProcessInstanceCallback)(void *UserPtr); +typedef bool (*Interop_ExecuteCallback)(void *user_ptr, const char *instance_id, const char *string); +typedef int32_t (*Interop_ReleaseInstanceCallback)(void **user_ptr); +typedef bool (*Interop_InvokeInstanceCallback)(void *user_ptr, echandle method_dictionary_handle, + echandle return_dictionary_handle); +typedef bool (*Interop_ProcessInstanceCallback)(void *user_ptr); /*********************************************************************/ /*! * Called when an instance is created - * \param TypeName type of object to be created - * \param InstanceId id of the object to be created - * \param InstanceIdLength maximum length of the InstanceId - * \param ExecuteUserPtr user pointer stored with execute callback - * \param Execute execute callback - * \param Invoke pointer to the instance invocation callback function - * \param Release pointer to the instance release/delete callback function - * \param Process pointer to the instance process callback function - * \param UserPtr pointer associated with instance id + * \param type_name type of object to be created + * \param instance_id id of the object to be created + * \param instance_id_length maximum length of the InstanceId + * \param execute_user_ptr user pointer stored with execute callback + * \param execute execute callback + * \param invoke_instance pointer to the instance invocation callback function + * \param release_instance pointer to the instance release/delete callback function + * \param process_instance pointer to the instance process callback function + * \param user_ptr pointer associated with instance id * \return true on success, false otherwise */ -bool Interop_CreateInstance(const char *TypeName, char *InstanceId, int32_t InstanceIdLength, void *ExecuteUserPtr, - Interop_ExecuteCallback Execute, Interop_InvokeInstanceCallback *Invoke, - Interop_ReleaseInstanceCallback *Release, Interop_ProcessInstanceCallback *Process, - void **UserPtr); +bool Interop_CreateInstance(const char *type_name, char *instance_id, int32_t instance_id_length, + void *execute_user_ptr, Interop_ExecuteCallback execute, + Interop_InvokeInstanceCallback *invoke_instance, + Interop_ReleaseInstanceCallback *release_instance, + Interop_ProcessInstanceCallback *process_instance, void **user_ptr); /*! * Set an interop function to override by key - * \param Key identifier of option - * \param Value pointer to the function + * \param key identifier of option + * \param value pointer to the function * \return true on success, false otherwise */ -bool Interop_SetOverride(const char *Key, void *Value); +bool Interop_SetOverride(const char *key, void *value); /*! * Set an interop option by key - * \param Key identifier of option - * \param Value value of option + * \param key identifier of option + * \param value value of option * \return true on success, false otherwise */ -bool Interop_SetOption(const char *Key, void *Value); +bool Interop_SetOption(const char *key, void *value); /*! * Loads interop functions diff --git a/taski.h b/taski.h index b8a9f61..101da59 100644 --- a/taski.h +++ b/taski.h @@ -1,91 +1,85 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - -/*********************************************************************/ - typedef struct ITask { - const char *Type; - echandle (*Create)(echandle TaskHandle); - echandle (*AddRef)(echandle Handle); - int32_t (*Release)(echandle *Handle); + const char *type; + echandle (*create)(echandle handle); + echandle (*add_ref)(echandle handle); + int32_t (*release)(echandle *handle); } ITask; /*********************************************************************/ -typedef bool (*ITask_ExpandStringCallback)(echandle TaskHandle, void *UserPtr, char *Key, char *Buffer, - int32_t MaxBuffer); -typedef bool (*ITask_EvaluatePathCallback)(echandle TaskHandle, void *UserPtr, char *Path, char *Buffer, - int32_t MaxBuffer); -typedef bool (*ITask_CompleteCallback)(echandle TaskHandle, void *UserPtr, echandle DictionaryHandle); -typedef bool (*ITask_RequestCompleteCallback)(echandle TaskHandle, void *UserPtr, uint8_t *BufferPtr, - int32_t BufferSize, int32_t ErrorCode, int32_t ErrorCodeEx); +typedef bool (*ITask_ExpandStringCallback)(echandle handle, void *user_ptr, char *key, char *buffer, + int32_t max_buffer); +typedef bool (*ITask_EvaluatePathCallback)(echandle handle, void *user_ptr, char *path, char *buffer, + int32_t max_buffer); +typedef bool (*ITask_CompleteCallback)(echandle handle, void *user_ptr, echandle dictionary_handle); +typedef bool (*ITask_RequestCompleteCallback)(echandle handle, void *user_ptr, const uint8_t *buffer, + int32_t buffer_size, int32_t error_code, int32_t error_code_ex); /*********************************************************************/ typedef struct ITaskVtbl { - bool (*SubAction_Null)(echandle TaskHandle, void *UserPtr, echandle DictionaryHandle); - bool (*SubAction_Complete)(echandle TaskHandle, void *UserPtr, echandle DictionaryHandle); - - bool (*IsCompleted)(echandle TaskHandle); - bool (*IsCancelled)(echandle TaskHandle); - - const char *(*GetType)(echandle TaskHandle); - float64_t (*GetTimeElapsed)(echandle TaskHandle); - const char *(*GetName)(echandle TaskHandle); - bool (*HasArgument)(echandle TaskHandle, const char *Name); - bool (*GetArgumentPtr)(echandle TaskHandle, const char *Name, const char **ValuePtr); - bool (*GetArgumentType)(echandle TaskHandle, const char *Name, int32_t *Type); - bool (*GetStringArgument)(echandle TaskHandle, const char *Name, char *Value, int32_t MaxValue); - bool (*GetMultiStringArgument)(echandle TaskHandle, const char *Name, char *Value, int32_t MaxValue); - bool (*GetBooleanArgument)(echandle TaskHandle, const char *Name, bool *Value); - bool (*GetNumberArgument)(echandle TaskHandle, const char *Name, float64_t *Value); - bool (*SetStatus)(echandle TaskHandle, const char *Status); - bool (*SetStatusString)(echandle TaskHandle, const char *Name, const char *Value); - bool (*SetStatusNumber)(echandle TaskHandle, const char *Name, float64_t Value); - bool (*SetStatusWithDictionary)(echandle TaskHandle, echandle DictionaryHandle); - bool (*SetProgress)(echandle TaskHandle, float64_t Progress); - - bool (*RunSubAction)(echandle TaskHandle, const char *Name, void *UserPtr, ITask_CompleteCallback Callback); - bool (*RunSubTask)(echandle TaskHandle, const char *Name, echandle DictionaryHandle, void *UserPtr, - ITask_CompleteCallback Callback); - - bool (*Start)(echandle TaskHandle); - bool (*Complete)(echandle TaskHandle, echandle DictionaryHandle); - bool (*Cancel)(echandle TaskHandle); - bool (*Dump)(echandle TaskHandle); - bool (*Log)(echandle TaskHandle, const char *Format, ...); - bool (*VerboseLog)(echandle TaskHandle, int32_t Level, const char *Format, ...); - bool (*ExpandString)(echandle TaskHandle, char *String, int32_t MaxString); - - bool (*LoadFromDictionary)(echandle TaskHandle, echandle DictionaryHandle, const char *Path); - - bool (*HasError)(echandle TaskHandle, const char *Error); - bool (*HasWarning)(echandle TaskHandle, const char *Warning); - int32_t (*GetErrorCount)(echandle TaskHandle); - int32_t (*GetWarningCount)(echandle TaskHandle); - bool (*AddError)(echandle TaskHandle, const char *Format, ...); - bool (*AddErrorFromMap)(echandle TaskHandle, int32_t ExitCode, const char *DefaultExitCodeString); - const char *(*GetError)(echandle TaskHandle, int32_t Index); - bool (*AddWarning)(echandle TaskHandle, const char *Format, ...); - const char *(*GetWarning)(echandle TaskHandle, int32_t Index); - bool (*ClearErrors)(echandle TaskHandle); - bool (*ClearWarnings)(echandle TaskHandle); - - bool (*SetDelayedCancel)(echandle TaskHandle, bool DelayedCancel); - bool (*GetDelayedCancel)(echandle TaskHandle); - echandle (*GetWorkflowHandle)(echandle TaskHandle); - echandle (*GetDictionaryHandle)(echandle TaskHandle); - echandle (*GetStatusDictionaryHandle)(echandle TaskHandle); - bool (*SetExpandStringCallback)(echandle TaskHandle, void *UserPtr, ITask_ExpandStringCallback Callback); - bool (*GetExpandStringCallback)(echandle TaskHandle, void **UserPtr, ITask_ExpandStringCallback *Callback); - - bool (*RequestURL)(echandle TaskHandle, const char *URL, void *UserPtr, ITask_RequestCompleteCallback Callback); - - bool (*RunSubActionNext)(echandle TaskHandle, const char *Name, echandle PreviousCompleteDictionaryHandle, - void *UserPtr, ITask_CompleteCallback Callback); + bool (*subaction_null)(echandle handle, void *user_ptr, echandle dictionary_handle); + bool (*subaction_complete)(echandle handle, void *user_ptr, echandle dictionary_handle); + + bool (*is_complete)(echandle handle); + bool (*is_cancelled)(echandle handle); + + const char *(*get_type)(echandle handle); + float64_t (*get_time_elapsed)(echandle handle); + const char *(*get_name)(echandle handle); + bool (*has_argument)(echandle handle, const char *name); + bool (*get_argument_ptr)(echandle handle, const char *name, const char **value_ptr); + bool (*get_argument_type)(echandle handle, const char *name, int32_t *type); + bool (*get_string_argument)(echandle handle, const char *name, char *value, int32_t max_value); + bool (*get_multistring_argument)(echandle handle, const char *name, char *value, int32_t max_value); + bool (*get_boolean_argument)(echandle handle, const char *name, bool *value); + bool (*get_number_argument)(echandle handle, const char *name, float64_t *value); + bool (*set_status)(echandle handle, const char *status); + bool (*set_status_string)(echandle handle, const char *name, const char *value); + bool (*set_status_number)(echandle handle, const char *name, float64_t value); + bool (*set_status_with_dictionary)(echandle handle, echandle dictionary_handle); + bool (*set_progress)(echandle handle, float64_t progress); + + bool (*run_subaction)(echandle handle, const char *name, void *user_ptr, ITask_CompleteCallback callback); + bool (*run_subtask)(echandle handle, const char *name, echandle dictionary_handle, void *user_ptr, + ITask_CompleteCallback callback); + + bool (*start)(echandle handle); + bool (*complete)(echandle handle, echandle dictionary_handle); + bool (*cancel)(echandle handle); + bool (*dump)(echandle handle); + bool (*log)(echandle handle, const char *format, ...); + bool (*verbose_log)(echandle handle, int32_t level, const char *format, ...); + bool (*expand_string)(echandle handle, char *string, int32_t max_string); + + bool (*load_from_dictionary)(echandle handle, echandle dictionary_handle, const char *path); + + bool (*has_error)(echandle handle, const char *error); + bool (*has_warning)(echandle handle, const char *warning); + int32_t (*get_error_count)(echandle handle); + int32_t (*get_warning_count)(echandle handle); + bool (*add_error)(echandle handle, const char *error); + bool (*add_error_from_map)(echandle handle, int32_t exit_code, const char *default_exit_code_str); + const char *(*get_error)(echandle handle, int32_t index); + bool (*add_warning)(echandle handle, const char *warning); + const char *(*get_warning)(echandle handle, int32_t index); + bool (*clear_errors)(echandle handle); + bool (*clear_warnings)(echandle handle); + + bool (*set_delayed_cancel)(echandle handle, bool delayed_cancel); + bool (*get_delayed_cancel)(echandle handle); + echandle (*get_workflow_handle)(echandle handle); + echandle (*get_dictionary_handle)(echandle handle); + echandle (*get_status_dictionary_handle)(echandle handle); + bool (*set_expand_string_callback)(echandle handle, void *user_ptr, ITask_ExpandStringCallback callback); + bool (*get_expand_string_callback)(echandle handle, void **user_ptr, ITask_ExpandStringCallback *callback); + + bool (*request_url)(echandle handle, const char *url, void *user_ptr, ITask_RequestCompleteCallback callback); + + bool (*run_subaction_next)(echandle handle, const char *name, echandle prev_complete_dictionary_handle, + void *user_ptr, ITask_CompleteCallback callback); } ITaskVtbl; /*********************************************************************/ @@ -98,99 +92,97 @@ typedef struct ITaskVtbl { return true; \ } -#define ITask_SubAction_Null(TaskHandle) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->SubAction_Null(TaskHandle, UserPtr, DictionaryHandle) -#define ITask_SubAction_Complete(TaskHandle) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->SubAction_Complete(TaskHandle, UserPtr, DictionaryHandle) - -#define ITask_IsCompleted(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->IsCompleted(TaskHandle) -#define ITask_IsCancelled(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->IsCancelled(TaskHandle) - -#define ITask_GetType(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetType(TaskHandle) -#define ITask_GetTimeElapsed(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetTimeElapsed(TaskHandle) -#define ITask_GetName(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetName(TaskHandle) -#define ITask_HasArgument(TaskHandle, Name) Class_VtblCast(TaskHandle, ITaskVtbl)->HasArgument(TaskHandle, Name) -#define ITask_GetArgumentPtr(TaskHandle, Name, ValuePtr) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetArgumentPtr(TaskHandle, Name, ValuePtr) -#define ITask_GetArgumentType(TaskHandle, Name, Type) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetArgumentType(TaskHandle, Name, Type) -#define ITask_GetStringArgument(TaskHandle, Name, Value, MaxValue) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetStringArgument(TaskHandle, Name, Value, MaxValue) -#define ITask_GetMultiStringArgument(TaskHandle, Name, Value, MaxValue) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetMultiStringArgument(TaskHandle, Name, Value, MaxValue) -#define ITask_GetBooleanArgument(TaskHandle, Name, Value) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetBooleanArgument(TaskHandle, Name, Value) -#define ITask_GetNumberArgument(TaskHandle, Name, Value) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetNumberArgument(TaskHandle, Name, Value) -#define ITask_SetStatus(TaskHandle, Status) Class_VtblCast(TaskHandle, ITaskVtbl)->SetStatus(TaskHandle, Status) -#define ITask_SetStatusString(TaskHandle, Name, Value) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->SetStatusString(TaskHandle, Name, Value) -#define ITask_SetStatusNumber(TaskHandle, Name, Value) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->SetStatusNumber(TaskHandle, Name, Value) -#define ITask_SetStatusWithDictionary(TaskHandle, DictionaryHandle) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->SetStatusWithDictionary(TaskHandle, DictionaryHandle) -#define ITask_SetProgress(TaskHandle, Progress) Class_VtblCast(TaskHandle, ITaskVtbl)->SetProgress(TaskHandle, Progress) - -#define ITask_RunSubAction(TaskHandle, Name, UserPtr, Callback) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->RunSubAction(TaskHandle, Name, UserPtr, Callback) -#define ITask_RunSubActionNext(TaskHandle, Name, PreviousCompleteDictionaryHandle, UserPtr, Callback) \ - Class_VtblCast(TaskHandle, ITaskVtbl) \ - ->RunSubActionNext(TaskHandle, Name, PreviousCompleteDictionaryHandle, UserPtr, Callback) -#define ITask_RunSubTask(TaskHandle, Name, DictionaryHandle, UserPtr, Callback) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->RunSubTask(TaskHandle, Name, DictionaryHandle, UserPtr, Callback) - -#define ITask_Start(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->Start(TaskHandle) -#define ITask_Complete(TaskHandle, DictionaryHandle) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->Complete(TaskHandle, DictionaryHandle) -#define ITask_Cancel(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->Cancel(TaskHandle) -#define ITask_Dump(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->Dump(TaskHandle) -#define ITask_Log(TaskHandle, Format, ...) Class_VtblCast(TaskHandle, ITaskVtbl)->Log(TaskHandle, Format, ##__VA_ARGS__) -#define ITask_VerboseLog(TaskHandle, Level, Format, ...) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->VerboseLog(TaskHandle, Level, Format, ##__VA_ARGS__) -#define ITask_ExpandString(TaskHandle, String, MaxString) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->ExpandString(TaskHandle, String, MaxString) - -#define ITask_LoadFromDictionary(TaskHandle, DictionaryHandle, Path) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->LoadFromDictionary(TaskHandle, DictionaryHandle, Path) - -#define ITask_HasError(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->HasError(TaskHandle) -#define ITask_HasWarning(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->HasWarning(TaskHandle) -#define ITask_GetErrorCount(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetErrorCount(TaskHandle) -#define ITask_GetWarningCount(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetWarningCount(TaskHandle) -#define ITask_AddError(TaskHandle, Format, ...) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->AddError(TaskHandle, Format, ##__VA_ARGS__) -#define ITask_AddErrorFromMap(TaskHandle, ExitCode, DefaultExitCodeString) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->AddErrorFromMap(TaskHandle, ExitCode, DefaultExitCodeString) -#define ITask_GetError(TaskHandle, Index) Class_VtblCast(TaskHandle, ITaskVtbl)->GetError(TaskHandle, Index) -#define ITask_AddWarning(TaskHandle, Format, ...) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->AddWarning(TaskHandle, Format, ##__VA_ARGS__) -#define ITask_GetWarning(TaskHandle, Index) Class_VtblCast(TaskHandle, ITaskVtbl)->GetWarning(TaskHandle, Index) -#define ITask_ClearErrors(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->ClearErrors(TaskHandle) -#define ITask_ClearWarnings(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->ClearWarnings(TaskHandle) - -#define ITask_SetDelayedCancel(TaskHandle, DelayedCancel) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->SetDelayedCancel(TaskHandle, DelayedCancel) -#define ITask_GetDelayedCancel(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetDelayedCancel(TaskHandle) -#define ITask_GetWorkflowHandle(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetWorkflowHandle(TaskHandle) -#define ITask_GetDictionaryHandle(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetDictionaryHandle(TaskHandle) -#define ITask_GetStatusDictionaryHandle(TaskHandle) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetStatusDictionaryHandle(TaskHandle) -#define ITask_SetExpandStringCallback(TaskHandle, UserPtr, Callback) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->SetExpandStringCallback(TaskHandle, UserPtr, Callback) -#define ITask_GetExpandStringCallback(TaskHandle, UserPtr, Callback) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetExpandStringCallback(TaskHandle, UserPtr, Callback) - -#define ITask_RequestURL(TaskHandle, URL, UserPtr, Callback) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->RequestURL(TaskHandle, URL, UserPtr, Callback) +#define ITask_SubAction_Null(handle, user_ptr, dictionary_handle) \ + Class_VtblCast(handle, ITaskVtbl)->subaction_null(handle, user_ptr, dictionary_handle) +#define ITask_SubAction_Complete(handle, user_ptr, dictionary_handle) \ + Class_VtblCast(handle, ITaskVtbl)->subaction_complete(handle, user_ptr, dictionary_handle) + +#define ITask_IsCompleted(handle) Class_VtblCast(handle, ITaskVtbl)->is_complete(handle) +#define ITask_IsCancelled(handle) Class_VtblCast(handle, ITaskVtbl)->is_cancelled(handle) + +#define ITask_GetType(handle) Class_VtblCast(handle, ITaskVtbl)->get_type(handle) +#define ITask_GetTimeElapsed(handle) Class_VtblCast(handle, ITaskVtbl)->get_time_elapsed(handle) +#define ITask_GetName(handle) Class_VtblCast(handle, ITaskVtbl)->get_name(handle) +#define ITask_HasArgument(handle, name) Class_VtblCast(handle, ITaskVtbl)->has_argument(handle, name) +#define ITask_GetArgumentPtr(handle, name, value_ptr) \ + Class_VtblCast(handle, ITaskVtbl)->get_argument_ptr(handle, name, value_ptr) +#define ITask_GetArgumentType(handle, name, type) \ + Class_VtblCast(handle, ITaskVtbl)->get_argument_type(handle, name, type) +#define ITask_GetStringArgument(handle, name, value, max_value) \ + Class_VtblCast(handle, ITaskVtbl)->get_string_argument(handle, name, value, max_value) +#define ITask_GetMultiStringArgument(handle, name, value, max_value) \ + Class_VtblCast(handle, ITaskVtbl)->get_multistring_argument(handle, name, value, max_value) +#define ITask_GetBooleanArgument(handle, name, value) \ + Class_VtblCast(handle, ITaskVtbl)->get_boolean_argument(handle, name, value) +#define ITask_GetNumberArgument(handle, name, value) \ + Class_VtblCast(handle, ITaskVtbl)->get_number_argument(handle, name, value) +#define ITask_SetStatus(handle, status) Class_VtblCast(handle, ITaskVtbl)->set_status(handle, status) +#define ITask_SetStatusString(handle, name, value) \ + Class_VtblCast(handle, ITaskVtbl)->set_status_string(handle, name, value) +#define ITask_SetStatusNumber(handle, name, value) \ + Class_VtblCast(handle, ITaskVtbl)->set_status_number(handle, name, value) +#define ITask_SetStatusWithDictionary(handle, dictionary_handle) \ + Class_VtblCast(handle, ITaskVtbl)->set_status_with_dictionary(handle, dictionary_handle) +#define ITask_SetProgress(handle, progress) Class_VtblCast(handle, ITaskVtbl)->set_progress(handle, progress) + +#define ITask_RunSubAction(handle, name, user_ptr, callback) \ + Class_VtblCast(handle, ITaskVtbl)->run_subaction(handle, name, user_ptr, callback) +#define ITask_RunSubActionNext(handle, name, prev_complete_dictionary_handle, user_ptr, callback) \ + Class_VtblCast(handle, ITaskVtbl) \ + ->run_subaction_next(handle, name, prev_complete_dictionary_handle, user_ptr, callback) +#define ITask_RunSubTask(handle, name, dictionary_handle, user_ptr, callback) \ + Class_VtblCast(handle, ITaskVtbl)->run_subtask(handle, name, dictionary_handle, user_ptr, callback) + +#define ITask_Start(handle) Class_VtblCast(handle, ITaskVtbl)->start(handle) +#define ITask_Complete(handle, dictionary_handle) Class_VtblCast(handle, ITaskVtbl)->complete(handle, dictionary_handle) +#define ITask_Cancel(handle) Class_VtblCast(handle, ITaskVtbl)->cancel(handle) +#define ITask_Dump(handle) Class_VtblCast(handle, ITaskVtbl)->dump(handle) +#define ITask_Log(handle, format, ...) Class_VtblCast(handle, ITaskVtbl)->log(handle, format, ##__VA_ARGS__) +#define ITask_VerboseLog(handle, level, format, ...) \ + Class_VtblCast(handle, ITaskVtbl)->verbose_log(handle, level, format, ##__VA_ARGS__) +#define ITask_ExpandString(handle, string, max_string) \ + Class_VtblCast(handle, ITaskVtbl)->expand_string(handle, string, max_string) + +#define ITask_LoadFromDictionary(handle, dictionary_handle, path) \ + Class_VtblCast(handle, ITaskVtbl)->load_from_dictionary(handle, dictionary_handle, path) + +#define ITask_HasError(handle, error) Class_VtblCast(handle, ITaskVtbl)->has_error(handle, error) +#define ITask_HasWarning(handle, warning) Class_VtblCast(handle, ITaskVtbl)->has_warning(handle, warning) +#define ITask_GetErrorCount(handle) Class_VtblCast(handle, ITaskVtbl)->get_error_count(handle) +#define ITask_GetWarningCount(handle) Class_VtblCast(handle, ITaskVtbl)->get_warning_count(handle) +#define ITask_AddError(handle, error) Class_VtblCast(handle, ITaskVtbl)->add_error(handle, error) +#define ITask_AddErrorFromMap(handle, exit_code, default_exit_code_str) \ + Class_VtblCast(handle, ITaskVtbl)->add_error_from_map(handle, exit_code, default_exit_code_str) +#define ITask_GetError(handle, index) Class_VtblCast(handle, ITaskVtbl)->get_error(handle, index) +#define ITask_AddWarning(handle, warning) Class_VtblCast(handle, ITaskVtbl)->add_warning(handle, warning) +#define ITask_GetWarning(handle, index) Class_VtblCast(handle, ITaskVtbl)->get_warning(handle, index) +#define ITask_ClearErrors(handle) Class_VtblCast(handle, ITaskVtbl)->clear_errors(handle) +#define ITask_ClearWarnings(handle) Class_VtblCast(handle, ITaskVtbl)->clear_warnings(handle) + +#define ITask_SetDelayedCancel(handle, delayed_cancel) \ + Class_VtblCast(handle, ITaskVtbl)->set_delayed_cancel(handle, delayed_cancel) +#define ITask_GetDelayedCancel(handle) Class_VtblCast(handle, ITaskVtbl)->get_delayed_cancel(handle) +#define ITask_GetWorkflowHandle(handle) Class_VtblCast(handle, ITaskVtbl)->get_workflow_handle(handle) +#define ITask_GetDictionaryHandle(handle) Class_VtblCast(handle, ITaskVtbl)->get_dictionary_handle(handle) +#define ITask_GetStatusDictionaryHandle(handle) Class_VtblCast(handle, ITaskVtbl)->get_status_dictionary_handle(handle) +#define ITask_SetExpandStringCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, ITaskVtbl)->set_expand_string_callback(handle, user_ptr, callback) +#define ITask_GetExpandStringCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, ITaskVtbl)->get_expand_string_callback(handle, user_ptr, callback) + +#define ITask_RequestURL(handle, url, user_ptr, callback) \ + Class_VtblCast(handle, ITaskVtbl)->request_url(handle, url, user_ptr, callback) /*********************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif + #define ITask_Declare(CLASS) extern ITask CLASS##_INTERFACE; #define ITask_DefineInt(TASK, CLASS) ITask CLASS##_INTERFACE = {#TASK, CLASS##_Create, CLASS##_AddRef, CLASS##_Release}; #define ITask_Define(TASK) ITask_DefineInt(TASK, TASK) -/*********************************************************************/ - #ifdef __cplusplus } #endif diff --git a/workflowi.h b/workflowi.h index 24d8b16..9d63446 100644 --- a/workflowi.h +++ b/workflowi.h @@ -6,135 +6,129 @@ extern "C" { /*********************************************************************/ -typedef bool (*IWorkflow_ExpandStringCallback)(void *UserPtr, const char *Key, const char *Value, char *Buffer, - int32_t MaxBuffer); -typedef bool (*IWorkflow_CompleteCallback)(echandle WorkflowHandle, void *UserPtr, echandle DictionaryHandle); +typedef bool (*IWorkflow_ExpandStringCallback)(void *user_ptr, const char *key, const char *value, char *buffer, + int32_t max_buffer); +typedef bool (*IWorkflow_CompleteCallback)(echandle handle, void *user_ptr, echandle dictionary_handle); /*********************************************************************/ typedef struct IWorkflowVtbl { - bool (*FindTaskByInstanceId)(echandle WorkflowHandle, const char *InstanceId, echandle *TaskHandle); - bool (*FindTaskByName)(echandle WorkflowHandle, const char *Name, echandle *TaskHandle); - bool (*GetParentTaskHandle)(echandle WorkflowHandle, echandle TaskHandle, echandle *ParentTaskHandle); - - bool (*FindTaskHandler)(echandle WorkflowHandle, const char *Type, ITask **Interface); - bool (*RegisterTaskHandler)(echandle WorkflowHandle, ITask *Interface); - bool (*UnregisterTaskHandler)(echandle WorkflowHandle, ITask *Interface); - - bool (*CanCreateTask)(echandle WorkflowHandle, const char *Name); - bool (*CreateTask)(echandle WorkflowHandle, const char *Name, echandle DictionaryHandle, echandle ParentTaskHandle, - echandle *TaskHandle); - bool (*RunTask)(echandle WorkflowHandle, const char *Name, echandle ParentTaskHandle, void *UserPtr, - IWorkflow_CompleteCallback Callback); - bool (*QueueTask)(echandle WorkflowHandle, const char *Name, echandle ParentTaskHandle, void *UserPtr, - IWorkflow_CompleteCallback Callback); - bool (*CancelTasks)(echandle WorkflowHandle); - bool (*ClearTasks)(echandle WorkflowHandle); - bool (*IsTaskRunning)(echandle WorkflowHandle, const char *Name); - bool (*IsTaskQueued)(echandle WorkflowHandle, const char *Name); - bool (*IsActivated)(echandle WorkflowHandle); - bool (*Complete)(echandle WorkflowHandle, echandle DictionaryHandle); - bool (*Reset)(echandle WorkflowHandle); - - bool (*AddMacro)(echandle WorkflowHandle, const char *Key, const char *Value); - bool (*ExpandString)(echandle WorkflowHandle, char *String, int32_t MaxString); - bool (*LoadFile)(echandle WorkflowHandle, const char *Path); - bool (*LoadBuffer)(echandle WorkflowHandle, char *Buffer, int32_t BufferSize, int32_t Merge); - bool (*LoadDictionary)(echandle WorkflowHandle, echandle DictionaryHandle, int32_t Merge); - bool (*RegisterDefaultTasks)(echandle WorkflowHandle); - bool (*UnregisterDefaultTasks)(echandle WorkflowHandle); - bool (*Log)(echandle WorkflowHandle, const char *Format, ...); - - bool (*SetExpandStringCallback)(echandle WorkflowHandle, void *UserPtr, IWorkflow_ExpandStringCallback Callback); - bool (*GetExpandStringCallback)(echandle WorkflowHandle, void **UserPtr, IWorkflow_ExpandStringCallback *Callback); - bool (*GetMacroDictionaryHandle)(echandle WorkflowHandle, echandle *MacroDictionaryHandle); - bool (*GetDictionaryHandle)(echandle WorkflowHandle, echandle *DictionaryHandle); - - bool (*IsGlobal)(echandle WorkflowHandle); - - bool (*CreateTaskWithMacros)(echandle WorkflowHandle, const char *Name, echandle DictionaryHandle, - echandle MacroDictionaryHandle, echandle ParentTaskHandle, echandle *TaskHandle); - bool (*RunTaskWithMacros)(echandle WorkflowHandle, const char *Name, echandle MacroDictionaryHandle, - echandle ParentTaskHandle, void *UserPtr, IWorkflow_CompleteCallback Callback); - bool (*QueueTaskWithMacros)(echandle WorkflowHandle, const char *Name, echandle MacroDictionaryHandle, - echandle ParentTaskHandle, void *UserPtr, IWorkflow_CompleteCallback Callback); + bool (*find_task_by_instance_id)(echandle handle, const char *instance_id, echandle *task_handle); + bool (*find_task_by_name)(echandle handle, const char *name, echandle *task_handle); + echandle (*get_parent_task_handle)(echandle handle, echandle task_handle); + + bool (*find_task_handler)(echandle handle, const char *type, ITask **task_interface); + bool (*register_task_handler)(echandle handle, ITask *task_interface); + bool (*unregister_task_handler)(echandle handle, ITask *task_interface); + + bool (*can_create_task)(echandle handle, const char *name); + bool (*create_task)(echandle handle, const char *name, echandle dictionary_handle, echandle parent_task_handle, + echandle *task_handle); + bool (*run_task)(echandle handle, const char *name, echandle parent_task_handle, void *user_ptr, + IWorkflow_CompleteCallback callback); + bool (*queue_task)(echandle handle, const char *name, echandle parent_task_handle, void *user_ptr, + IWorkflow_CompleteCallback callback); + bool (*cancel_tasks)(echandle handle); + bool (*clear_tasks)(echandle handle); + bool (*is_task_running)(echandle handle, const char *name); + bool (*is_task_queued)(echandle handle, const char *name); + bool (*is_activated)(echandle handle); + bool (*complete)(echandle handle, echandle dictionary_handle); + bool (*reset)(echandle handle); + + bool (*add_macro)(echandle handle, const char *key, const char *value); + bool (*expand_string)(echandle handle, char *string, int32_t max_string); + bool (*load_file)(echandle handle, const char *path); + bool (*load_buffer)(echandle handle, char *buffer, int32_t buffer_size, bool merge); + bool (*load_dictionary)(echandle handle, echandle dictionary_handle, bool merge); + bool (*register_default_tasks)(echandle handle); + bool (*unregister_default_tasks)(echandle handle); + + bool (*log)(echandle handle, const char *format, ...); + + bool (*set_expand_string_callback)(echandle handle, void *user_ptr, IWorkflow_ExpandStringCallback callback); + bool (*get_expand_string_callback)(echandle handle, void **user_ptr, IWorkflow_ExpandStringCallback *callback); + echandle (*get_macro_dictionary_handle)(echandle handle); + echandle (*get_dictionary_handle)(echandle handle); + + bool (*is_global)(echandle handle); + + bool (*create_task_with_macros)(echandle handle, const char *name, echandle dictionary_handle, + echandle macro_dictionary_handle, echandle parent_task_handle, + echandle *task_handle); + bool (*run_task_with_macros)(echandle handle, const char *name, echandle macro_dictionary_handle, + echandle parent_task_handle, void *user_ptr, IWorkflow_CompleteCallback callback); + bool (*queue_task_with_macros)(echandle handle, const char *name, echandle macro_dictionary_handle, + echandle parent_task_handle, void *user_ptr, IWorkflow_CompleteCallback callback); } IWorkflowVtbl; /*********************************************************************/ -#define IWorkflow_FindTaskByInstanceId(WorkflowHandle, InstanceId, TaskHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->FindTaskByInstanceId(WorkflowHandle, InstanceId, TaskHandle) -#define IWorkflow_FindTaskByName(WorkflowHandle, Name, TaskHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->FindTaskByName(WorkflowHandle, Name, TaskHandle) -#define IWorkflow_GetParentTaskHandle(WorkflowHandle, TaskHandle, ParentTaskHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetParentTaskHandle(WorkflowHandle, TaskHandle, ParentTaskHandle) - -#define IWorkflow_FindTaskHandler(WorkflowHandle, Type, Interface) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->FindTaskHandler(WorkflowHandle, Type, Interface) -#define IWorkflow_RegisterTaskHandler(WorkflowHandle, Interface) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->RegisterTaskHandler(WorkflowHandle, Interface) -#define IWorkflow_UnregisterTaskHandler(WorkflowHandle, Interface) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->UnregisterTaskHandler(WorkflowHandle, Interface) - -#define IWorkflow_CanCreateTask(WorkflowHandle, Name) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->CanCreateTask(WorkflowHandle, Name) -#define IWorkflow_CreateTask(WorkflowHandle, Name, DictionaryHandle, ParentTaskHandle, SubTaskHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->CreateTask(WorkflowHandle, Name, DictionaryHandle, ParentTaskHandle) -#define IWorkflow_CreateTaskWithMacros(WorkflowHandle, Name, DictionaryHandle, MacroDictionaryHandle, \ - ParentTaskHandle, SubTaskHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl) \ - ->CreateTaskWithMacros(WorkflowHandle, Name, DictionaryHandle, MacroDictionaryHandle, ParentTaskHandle) -#define IWorkflow_RunTask(WorkflowHandle, Name, ParentTaskHandle, UserPtr, Callback) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->RunTask(WorkflowHandle, Name, ParentTaskHandle, UserPtr, Callback) -#define IWorkflow_RunTaskWithMacros(WorkflowHandle, Name, MacroDictionaryHandle, ParentTaskHandle, UserPtr, Callback) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl) \ - ->RunTaskWithMacros(WorkflowHandle, Name, MacroDictionaryHandle, ParentTaskHandle, UserPtr, Callback) -#define IWorkflow_QueueTask(WorkflowHandle, Name, ParentTaskHandle, UserPtr, Callback) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->QueueTask(WorkflowHandle, Name, ParentTaskHandle, UserPtr, Callback) -#define IWorkflow_QueueTaskWithMacros(WorkflowHandle, Name, MacroDictionaryHandle, ParentTaskHandle, UserPtr, \ - Callback) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl) \ - ->QueueTaskWithMacros(WorkflowHandle, Name, MacroDictionaryHandle, ParentTaskHandle, UserPtr, Callback) -#define IWorkflow_CancelTasks(WorkflowHandle) Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->CancelTasks(WorkflowHandle) -#define IWorkflow_ClearTasks(WorkflowHandle) Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->ClearTasks(WorkflowHandle) -#define IWorkflow_IsTaskRunning(WorkflowHandle, Name) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->IsTaskRunning(WorkflowHandle, Name) -#define IWorkflow_IsTaskQueued(WorkflowHandle, Name) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->IsTaskQueued(WorkflowHandle, Name) -#define IWorkflow_IsActivated(WorkflowHandle, Name) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->IsActivated(WorkflowHandle) -#define IWorkflow_Complete(WorkflowHandle, DictionaryHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->Complete(WorkflowHandle, DictionaryHandle) -#define IWorkflow_Reset(WorkflowHandle) Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->Reset(WorkflowHandle) - -#define IWorkflow_AddMacro(WorkflowHandle, Key, Value) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->AddMacro(WorkflowHandle, Key, Value) -#define IWorkflow_ExpandString(WorkflowHandle, String, MaxString) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->ExpandString(WorkflowHandle, String, MaxString) -#define IWorkflow_LoadFile(WorkflowHandle, Path) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->LoadFile(WorkflowHandle, Path) -#define IWorkflow_LoadBuffer(WorkflowHandle, Buffer, BufferSize, Merge) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->LoadBuffer(WorkflowHandle, Buffer, BufferSize, Merge) -#define IWorkflow_RegisterDefaultTasks(WorkflowHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->RegisterDefaultTasks(WorkflowHandle) -#define IWorkflow_UnregisterDefaultTasks(WorkflowHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->UnregisterDefaultTasks(WorkflowHandle) -#define IWorkflow_Log(WorkflowHandle, Format, ...) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->Log(WorkflowHandle, Format, ##__VA_ARGS__) - -#define IWorkflow_IsGlobal(WorkflowHandle) Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->IsGlobal(WorkflowHandle) -#define IWorkflow_SetExpandStringCallback(WorkflowHandle, UserPtr, Callback) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->SetExpandStringCallback(WorkflowHandle, UserPtr, Callback) -#define IWorkflow_GetExpandStringCallback(WorkflowHandle, UserPtr, Callback) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetExpandStringCallback(WorkflowHandle, UserPtr, Callback) -#define IWorkflow_GetMacroDictionaryHandle(WorkflowHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetMacroDictionaryHandle(WorkflowHandle) -#define IWorkflow_GetDictionaryHandle(WorkflowHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetDictionaryHandle(WorkflowHandle) - -#define IWorkflow_RegisterTask(WorkflowHandle, TASK) IWorkflow_RegisterTaskHandler(WorkflowHandle, &TASK##_INTERFACE) -#define IWorkflow_UnregisterTask(WorkflowHandle, TASK) \ - IWorkflow_UnregisterTaskHandler(WorkflowHandle, &TASK##_INTERFACE) +#define IWorkflow_FindTaskByInstanceId(handle, instance_id, task_handle) \ + Class_VtblCast(handle, IWorkflowVtbl)->find_task_by_instance_id(handle, instance_id, task_handle) +#define IWorkflow_FindTaskByName(handle, name, task_handle) \ + Class_VtblCast(handle, IWorkflowVtbl)->find_task_by_name(handle, name, task_handle) +#define IWorkflow_GetParentTaskHandle(handle, task_handle) \ + Class_VtblCast(handle, IWorkflowVtbl)->get_parent_task_handle(handle, task_handle) + +#define IWorkflow_FindTaskHandler(handle, type, task_interface) \ + Class_VtblCast(handle, IWorkflowVtbl)->find_task_handler(handle, type, task_interface) +#define IWorkflow_RegisterTaskHandler(handle, task_interface) \ + Class_VtblCast(handle, IWorkflowVtbl)->register_task_handler(handle, task_interface) +#define IWorkflow_UnregisterTaskHandler(handle, task_interface) \ + Class_VtblCast(handle, IWorkflowVtbl)->unregister_task_handler(handle, task_interface) + +#define IWorkflow_CanCreateTask(handle, name) Class_VtblCast(handle, IWorkflowVtbl)->can_create_task(handle, name) +#define IWorkflow_CreateTask(handle, name, dictionary_handle, parent_task_handle, sub_task_handle) \ + Class_VtblCast(handle, IWorkflowVtbl) \ + ->create_task(handle, name, dictionary_handle, parent_task_handle, sub_task_handle) +#define IWorkflow_CreateTaskWithMacros(handle, name, dictionary_handle, macro_dictionary_handle, parent_task_handle, \ + sub_task_handle) \ + Class_VtblCast(handle, IWorkflowVtbl) \ + ->create_task_with_macros(handle, name, dictionary_handle, macro_dictionary_handle, parent_task_handle, \ + sub_task_handle) +#define IWorkflow_RunTask(handle, name, parent_task_handle, user_ptr, callback) \ + Class_VtblCast(handle, IWorkflowVtbl)->run_task(handle, name, parent_task_handle, user_ptr, callback) +#define IWorkflow_RunTaskWithMacros(handle, name, macro_dictionary_handle, parent_task_handle, user_ptr, callback) \ + Class_VtblCast(handle, IWorkflowVtbl) \ + ->run_task_with_macros(handle, name, macro_dictionary_handle, parent_task_handle, user_ptr, callback) +#define IWorkflow_QueueTask(handle, name, parent_task_handle, user_ptr, callback) \ + Class_VtblCast(handle, IWorkflowVtbl)->queue_task(handle, name, parent_task_handle, user_ptr, callback) +#define IWorkflow_QueueTaskWithMacros(handle, name, macro_dictionary_handle, parent_task_handle, user_ptr, callback) \ + Class_VtblCast(handle, IWorkflowVtbl) \ + ->queue_task_with_macros(handle, name, macro_dictionary_handle, parent_task_handle, user_ptr, callback) +#define IWorkflow_CancelTasks(handle) Class_VtblCast(handle, IWorkflowVtbl)->cancel_tasks(handle) +#define IWorkflow_ClearTasks(handle) Class_VtblCast(handle, IWorkflowVtbl)->clear_tasks(handle) +#define IWorkflow_IsTaskRunning(handle, name) Class_VtblCast(handle, IWorkflowVtbl)->is_task_running(handle, name) +#define IWorkflow_IsTaskQueued(handle, name) Class_VtblCast(handle, IWorkflowVtbl)->is_task_queued(handle, name) +#define IWorkflow_IsActivated(handle) Class_VtblCast(handle, IWorkflowVtbl)->is_activated(handle) +#define IWorkflow_Complete(handle, dictionary_handle) \ + Class_VtblCast(handle, IWorkflowVtbl)->complete(handle, dictionary_handle) +#define IWorkflow_Reset(handle) Class_VtblCast(handle, IWorkflowVtbl)->reset(handle) + +#define IWorkflow_AddMacro(handle, key, value) Class_VtblCast(handle, IWorkflowVtbl)->add_macro(handle, key, value) +#define IWorkflow_ExpandString(handle, string, max_string) \ + Class_VtblCast(handle, IWorkflowVtbl)->expand_string(handle, string, max_string) +#define IWorkflow_LoadFile(handle, path) Class_VtblCast(handle, IWorkflowVtbl)->load_file(handle, path) +#define IWorkflow_LoadBuffer(handle, buffer, buffer_size, merge) \ + Class_VtblCast(handle, IWorkflowVtbl)->load_buffer(handle, buffer, buffer_size, merge) +#define IWorkflow_LoadDictionary(handle, dictionary, merge) \ + Class_VtblCast(handle, IWorkflowVtbl)->load_dictionary(handle, dictionary, merge) +#define IWorkflow_RegisterDefaultTasks(handle) Class_VtblCast(handle, IWorkflowVtbl)->register_default_tasks(handle) +#define IWorkflow_UnregisterDefaultTasks(handle) Class_VtblCast(handle, IWorkflowVtbl)->unregister_default_tasks(handle) +#define IWorkflow_Log(handle, format, ...) Class_VtblCast(handle, IWorkflowVtbl)->log(handle, format, ##__VA_ARGS__) + +#define IWorkflow_IsGlobal(handle) Class_VtblCast(handle, IWorkflowVtbl)->is_global(handle) +#define IWorkflow_SetExpandStringCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, IWorkflowVtbl)->set_expand_string_callback(handle, user_ptr, callback) +#define IWorkflow_GetExpandStringCallback(handle, user_ptr, callback) \ + Class_VtblCast(handle, IWorkflowVtbl)->get_expand_string_callback(handle, user_ptr, callback) +#define IWorkflow_GetMacroDictionaryHandle(handle) \ + Class_VtblCast(handle, IWorkflowVtbl)->get_macro_dictionary_handle(handle) +#define IWorkflow_GetDictionaryHandle(handle) Class_VtblCast(handle, IWorkflowVtbl)->get_dictionary_handle(handle) + +#define IWorkflow_RegisterTask(handle, TASK) IWorkflow_RegisterTaskHandler(handle, &TASK##_INTERFACE) +#define IWorkflow_UnregisterTask(handle, TASK) IWorkflow_UnregisterTaskHandler(handle, &TASK##_INTERFACE) /*********************************************************************/