MCPcopy Create free account
hub / github.com/Entware/Entware / get_symbol_str

Function get_symbol_str

scripts/config/menu.c:789–838  ·  view source on GitHub ↗

* head is optional and may be NULL */

Source from the content-addressed store, hash-verified

787 * head is optional and may be NULL
788 */
789static void get_symbol_str(struct gstr *r, struct symbol *sym,
790 struct list_head *head)
791{
792 struct property *prop;
793
794 if (sym && sym->name) {
795 str_printf(r, "Symbol: %s [=%s]\n", sym->name,
796 sym_get_string_value(sym));
797 str_printf(r, "Type : %s\n", sym_type_name(sym->type));
798 if (sym->type == S_INT || sym->type == S_HEX) {
799 prop = sym_get_range_prop(sym);
800 if (prop) {
801 str_printf(r, "Range : ");
802 expr_gstr_print(prop->expr, r);
803 str_append(r, "\n");
804 }
805 }
806 }
807
808 /* Print the definitions with prompts before the ones without */
809 for_all_properties(sym, prop, P_SYMBOL) {
810 if (prop->menu->prompt) {
811 get_def_str(r, prop->menu);
812 get_prompt_str(r, prop->menu->prompt, head);
813 }
814 }
815
816 for_all_properties(sym, prop, P_SYMBOL) {
817 if (!prop->menu->prompt) {
818 get_def_str(r, prop->menu);
819 get_dep_str(r, prop->menu->dep, " Depends on: ");
820 }
821 }
822
823 get_symbol_props_str(r, sym, P_SELECT, "Selects: ");
824 if (sym->rev_dep.expr) {
825 expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, "Selected by [y]:\n");
826 expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, "Selected by [m]:\n");
827 expr_gstr_print_revdep(sym->rev_dep.expr, r, no, "Selected by [n]:\n");
828 }
829
830 get_symbol_props_str(r, sym, P_IMPLY, "Implies: ");
831 if (sym->implied.expr) {
832 expr_gstr_print_revdep(sym->implied.expr, r, yes, "Implied by [y]:\n");
833 expr_gstr_print_revdep(sym->implied.expr, r, mod, "Implied by [m]:\n");
834 expr_gstr_print_revdep(sym->implied.expr, r, no, "Implied by [n]:\n");
835 }
836
837 str_append(r, "\n\n");
838}
839
840struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head)
841{

Callers 2

get_relations_strFunction · 0.85
menu_get_ext_helpFunction · 0.85

Calls 11

str_printfFunction · 0.85
sym_get_string_valueFunction · 0.85
sym_type_nameFunction · 0.85
sym_get_range_propFunction · 0.85
expr_gstr_printFunction · 0.85
str_appendFunction · 0.85
get_def_strFunction · 0.85
get_prompt_strFunction · 0.85
get_dep_strFunction · 0.85
get_symbol_props_strFunction · 0.85
expr_gstr_print_revdepFunction · 0.85

Tested by

no test coverage detected