up already, but if opening via raw low-level calls, you need to figure
out which dict is the parent and set it on the child via ctf_import().
+ To determine whether a CTF type is in a child, use !ctf_type_isparent().
+ (ctf_type_isparent cannot fail.)
+
Almost all operations other than ctf_import and ctf_close do not work on
child dicts that have not yet had ctf_import called on them; in particular,
name lookups and type lookup in general are broken, as is type addition. */
extern ctf_dict_t *ctf_parent_dict (ctf_dict_t *);
extern const char *ctf_parent_name (ctf_dict_t *);
extern ctf_bool_t ctf_type_isparent (const ctf_dict_t *, ctf_id_t);
-extern ctf_bool_t ctf_type_ischild (const ctf_dict_t *, ctf_id_t);
extern ctf_ret_t ctf_import (ctf_dict_t *child, ctf_dict_t *parent);
/* Set these names (used when creating dicts). */
return expr;
}
+static inline ctf_bool_t
+ctf_type_ischild (const ctf_dict_t *fp, ctf_id_t id)
+{
+ return (!ctf_type_isparent (fp, id));
+}
+
/* Un-inline these functions if debugging, so you can drop breakpoints on the
setting of any error anywhere by the library. */
return 0;
}
-ctf_bool_t
-ctf_type_ischild (const ctf_dict_t *fp, ctf_id_t id)
-{
- return (!ctf_type_isparent (fp, id));
-}
-
/* Get the index in the internal type array (or otherwise) for a given type ID.
Only ever called on the right dictionary for the type, and can fail otherwise.
If called on an invalid type, may return an index that does not correspond to