这是report obj information 的,可以参考一下
static void report_object_info(char *what, tag_t object)
{
int
status,
subtype,
type;
tag_t
owner;
char
name[UF_OBJ_NAME_LEN + 1],
msg[133];
UF_OBJ_disp_props_t
disp_props;
UF_CALL(UF_UI_open_listing_window());
if (object != NULL_TAG)
{
UF_CALL(UF_OBJ_ask_type_and_subtype(object, &type, &subtype));
sprintf(msg, "%s = %d, type = %d, subtype = %d, ", what, object, type,
subtype);
if (UF_OBJ_is_object_a_promotion(object)) strcat(msg, "promotion, ");
if (UF_ASSEM_is_occurrence(object)) strcat(msg, "occurrence, ");
UF_CALL(UF_UI_write_listing_window(msg));
if (!UF_CALL(UF_OBJ_ask_owning_part(object, &owner)))
{
sprintf(msg, "owned by %d, ", owner);
UF_CALL(UF_UI_write_listing_window(msg));
}
if (!uc6409(object, &status, name) && (status == 1))
{
sprintf(msg, "view dependent in %s, ", name);
UF_CALL(UF_UI_write_listing_window(msg));
}
if (!UF_OBJ_ask_name(object, name))
{
sprintf(msg, "named %s, ", name);
UF_CALL(UF_UI_write_listing_window(msg));
}
status = UF_OBJ_ask_status(object);
sprintf(msg, "status %d\n", status);
UF_CALL(UF_UI_write_listing_window(msg));
if (UF_OBJ_is_type_displayable(type))
{
UF_CALL(UF_OBJ_ask_display_properties(object, &disp_props));
sprintf(msg, " layer = %d, color = %d, blank = %d, width = %d, "
"font = %d, highlight = %d\n", disp_props.layer,
disp_props.color, disp_props.blank_status,
disp_props.line_width, disp_props.font,
disp_props.highlight_status);
UF_CALL(UF_UI_write_listing_window(msg));
}
}
else
{
sprintf(msg, "%s = %d (NULL_TAG)\n", what, object);
UF_CALL(UF_UI_write_listing_window(msg));
}
} |