Types:
enum tao_result_type { TAO_VOID = 0, TAO_PATH = 1, TAO_SHORTCUT = 2}
struct tao_result {
size_t struct_size;
enum tao_result_type excepted_result;
char path;
struct tao_shortcut shortcut;
}
API:
bool taoV3_query(struct obinded window, const char path, struct tao_result result);
bool taoV3_query_shortcut(struct tao_shortcut shortcut, struct tao_path relative_path, struct tao_result result);
bool taoV3_query_next_sibling_shortcut(struct tao_shortcut shortcut, struct tao_result result);
bool taoV3_query_first_child_shortcut(struct tao_shortcut shortcut, struct tao_result result);
Example:
/ Counting entities provides by our file manager /
int count = 0;
struct tao_result result, result2;
result.struct_size = sizeof(result);
result.expected_result = TAO_SHORTCUT;
result2.struct_size = sizeof(result);
result2.expected_result = TAO_SHORTCUT;
taoV3_query(window, "/fileviews/left/items", &result);
if (!taoV3_query_first_child_shortcut(result.shortcut, &result2)) {
taoV3_release_shortcut(result.shortcut);
return 0;
}
++count;
while ( taoV3_query_next_sibling_shortcut(result2.shortcut, &result)) {
++count;
taoV3_release_shortcut(result2.shortcut);
result2 = result;
}
taoV3_release_shortcut(result2.shortcut);
return count;
Diff: