| From: Andrew Cagney <[email protected]> | then I can display a truncated value vis: | | strip_prefix("ESN_", enum_enum_show(ikev2_trans_type_esn_names, | IKEv2_ESN_DISABLED)) | -> "DISABLED"
It seems that strip_prefix is used about 45 times. That's often enough to be catered to. Idea: introduce 1) a "prefix" field into struct enum names 2) add new functions "enum_showb_short" and "enum_name_short" that suppress the prefix found in struct enum names Don't bother with a version of enum_show: let's not make another function with confusing storage for the result 3) we could add a shortbitnames function. That would take an extra argument, prefix-to-be-suppressed. (There is no descriptor struct to contain the prefix. I guess we could add one.) Is that reasonable? _______________________________________________ Swan-dev mailing list [email protected] https://lists.libreswan.org/mailman/listinfo/swan-dev
