Skip to content

Commit

Permalink
lib: Rename the function o_attrib_search_attached_attribs_by_name()
Browse files Browse the repository at this point in the history
  • Loading branch information
vzh committed Sep 5, 2024
1 parent 18dee83 commit 6964d0d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
5 changes: 4 additions & 1 deletion liblepton/include/liblepton/prototype.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,11 @@ void o_attrib_print(GList *attributes);
gboolean o_attrib_string_get_name_value (const gchar *string, gchar **name_ptr, gchar **value_ptr);
GList *o_attrib_find_floating_attribs (const GList *list);
char *o_attrib_search_floating_attribs_by_name (const GList *list, const char *name, int counter);
char *o_attrib_search_attached_attribs_by_name (LeptonObject *object, const char *name, int counter);

char*
lepton_attrib_search_attached_attribs_by_name (LeptonObject *object,
const char *name,
int counter);
char*
lepton_attrib_search_inherited_attribs_by_name (LeptonObject *object,
const char *name,
Expand Down
2 changes: 1 addition & 1 deletion liblepton/src/component_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ lepton_component_check_symversion (LeptonPage* page,
inside = lepton_attrib_search_inherited_attribs_by_name (object, "symversion", 0);

/* now look for the symversion= attached to object */
outside = o_attrib_search_attached_attribs_by_name (object, "symversion", 0);
outside = lepton_attrib_search_attached_attribs_by_name (object, "symversion", 0);

/* get the uref for future use */
refdes = lepton_attrib_search_object_attribs_by_name(object, "refdes", 0);
Expand Down
7 changes: 4 additions & 3 deletions liblepton/src/o_attrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,10 @@ char *o_attrib_search_floating_attribs_by_name (const GList *list,
* \warning
* Caller must g_free returned character string.
*/
char *o_attrib_search_attached_attribs_by_name (LeptonObject *object,
const char *name,
int counter)
char*
lepton_attrib_search_attached_attribs_by_name (LeptonObject *object,
const char *name,
int counter)
{
GList *attribs = lepton_object_get_attribs (object);
return o_attrib_search_attrib_list_by_name (attribs, name, counter);
Expand Down
9 changes: 6 additions & 3 deletions libleptonattrib/src/s_toplevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,9 @@ s_toplevel_update_component_attribs_in_toplevel (LeptonToplevel *toplevel,
/* Now get the old attrib name & value from complete_comp_attrib_list
* and value from o_current */
old_attrib_name = u_basic_breakup_string(local_list->data, '=', 0);
old_attrib_value = o_attrib_search_attached_attribs_by_name (o_current, old_attrib_name, 0);

old_attrib_value = lepton_attrib_search_attached_attribs_by_name (o_current,
old_attrib_name,
0);
g_debug ("s_toplevel_update_component_attribs_in_toplevel: "
"Old name = \"%s\".\n"
"Old value = \"%s\".\n",
Expand Down Expand Up @@ -990,7 +991,9 @@ s_toplevel_update_pin_attribs_in_toplevel (LeptonToplevel *toplevel,
g_free(new_attrib_value);
new_attrib_value = NULL; /* s_misc_remaining_string doesn't return NULL for empty substring. */
}
old_attrib_value = o_attrib_search_attached_attribs_by_name (o_pin, new_attrib_name, 0);
old_attrib_value = lepton_attrib_search_attached_attribs_by_name (o_pin,
new_attrib_name,
0);

/* ------- Four cases to consider: Case 1: old and new attribs exist ----- */
if ( (old_attrib_value != NULL) && (new_attrib_value != NULL) && (strlen(new_attrib_value) != 0) ) {
Expand Down
7 changes: 3 additions & 4 deletions libleptongui/src/find_text_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,9 @@ get_subpages (SchematicWindow *w_current,
continue;
}

attrib = o_attrib_search_attached_attribs_by_name (object,
"source",
0);

attrib = lepton_attrib_search_attached_attribs_by_name (object,
"source",
0);
if (attrib == NULL) {
attrib = lepton_attrib_search_inherited_attribs_by_name (object,
"source",
Expand Down
3 changes: 2 additions & 1 deletion libleptongui/src/i_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ parent_comp_selected (LeptonPage* page)

if (obj != NULL)
{
char* attr = o_attrib_search_attached_attribs_by_name (obj, "source", 0);
char* attr =
lepton_attrib_search_attached_attribs_by_name (obj, "source", 0);
if (attr == NULL)
{
attr = lepton_attrib_search_inherited_attribs_by_name (obj, "source", 0);
Expand Down
2 changes: 1 addition & 1 deletion libleptongui/src/schematic_hierarchy.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ s_hierarchy_traversepages (SchematicWindow *w_current,
if (!lepton_object_is_component (o_current)) continue;

filename =
o_attrib_search_attached_attribs_by_name (o_current, "source", 0);
lepton_attrib_search_attached_attribs_by_name (o_current, "source", 0);

/* if above is NULL, then look inside symbol */
if (filename == NULL) {
Expand Down

0 comments on commit 6964d0d

Please sign in to comment.