[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.6.1-20100214-247-gf300ff0)



The branch, master has been updated
       via  f300ff057ab77b5ac8f1adef6345ffe2279cac63 (commit)
       via  29994756d3dd499dbfc5252085074d47926bd0be (commit)
       via  77477fe829b9c056564084748cad5110e564c903 (commit)
      from  2d07ac4933633837fc394e5001a452c7db290d13 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gattrib/include/prototype.h |   81 +++++++++++++++++---------------
 gattrib/src/i_basic.c       |    6 +-
 gattrib/src/i_vars.c        |   14 +++---
 gattrib/src/s_object.c      |  107 ++++++++++++++++++++++++++----------------
 gattrib/src/s_rename.c      |    2 +-
 gattrib/src/s_toplevel.c    |  109 ++++++++++++++++++++++---------------------
 gattrib/src/x_dialog.c      |    2 +-
 gattrib/src/x_fileselect.c  |    2 +-
 gattrib/src/x_window.c      |    2 +-
 9 files changed, 180 insertions(+), 145 deletions(-)


=================
 Commit Messages
=================

commit f300ff057ab77b5ac8f1adef6345ffe2279cac63
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gattrib: Add TOPLEVEL * attributes to various functions
    
    Rather than using the global variable pr_current, pass the variable
    explitly where we can. This patch removes all useage of pr_current
    in s_toplevel.c and s_object.c
    
    The remaining usage of pr_current exists in the gui protions of
    gattrib.

:100644 100644 f2ac095... 1152af4... M	gattrib/include/prototype.h
:100644 100644 5255ed0... 0845758... M	gattrib/src/s_object.c
:100644 100644 e822e90... 572b482... M	gattrib/src/s_toplevel.c
:100644 100644 703f1ea... a1d5e2f... M	gattrib/src/x_dialog.c
:100644 100644 da35a7b... b0a0b13... M	gattrib/src/x_fileselect.c
:100644 100644 521a96a... 72bcad1... M	gattrib/src/x_window.c

commit 29994756d3dd499dbfc5252085074d47926bd0be
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gattrib: Rename TOPLEVELs passed as arguments to "toplevel"
    
    Lets us notice the difference between pr_current the global variable
    and those passed as arguments.

:100644 100644 2c122f3... f2ac095... M	gattrib/include/prototype.h
:100644 100644 cbd49f8... 2dab181... M	gattrib/src/i_basic.c
:100644 100644 14b22dd... ed5249b... M	gattrib/src/i_vars.c
:100644 100644 92031f5... 5255ed0... M	gattrib/src/s_object.c
:100644 100644 a647303... cb22509... M	gattrib/src/s_rename.c
:100644 100644 3632b79... e822e90... M	gattrib/src/s_toplevel.c

commit 77477fe829b9c056564084748cad5110e564c903
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gattrib: Remove unused function s_toplevel_empty_project()

:100644 100644 4895461... 2c122f3... M	gattrib/include/prototype.h
:100644 100644 53c971a... 3632b79... M	gattrib/src/s_toplevel.c

=========
 Changes
=========

commit f300ff057ab77b5ac8f1adef6345ffe2279cac63
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gattrib: Add TOPLEVEL * attributes to various functions
    
    Rather than using the global variable pr_current, pass the variable
    explitly where we can. This patch removes all useage of pr_current
    in s_toplevel.c and s_object.c
    
    The remaining usage of pr_current exists in the gui protions of
    gattrib.

diff --git a/gattrib/include/prototype.h b/gattrib/include/prototype.h
index f2ac095..1152af4 100644
--- a/gattrib/include/prototype.h
+++ b/gattrib/include/prototype.h
@@ -83,51 +83,59 @@ void s_table_gtksheet_to_table(GtkSheet *local_gtk_sheet,
 			      TABLE **local_table, int num_rows, int num_cols);
 
 /* ------------- s_toplevel.c ------------- */
-int s_toplevel_read_page(char *filename);
+int s_toplevel_read_page(TOPLEVEL *toplevel, char *filename);
 void s_toplevel_verify_design(TOPLEVEL *toplevel);
-void s_toplevel_gtksheet_to_toplevel();
+void s_toplevel_gtksheet_to_toplevel(TOPLEVEL *toplevel);
 void s_toplevel_add_new_attrib(gchar *new_attrib_name);
 void s_toplevel_delete_attrib_col();
 void s_toplevel_select_object();
-void s_toplevel_sheetdata_to_toplevel(PAGE *page);
+void s_toplevel_sheetdata_to_toplevel(TOPLEVEL *toplevel, PAGE *page);
 
 STRING_LIST *s_toplevel_get_component_attribs_in_sheet(char *refdes);
-void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current, 
-					 STRING_LIST *new_comp_attrib_list);
+void s_toplevel_update_component_attribs_in_toplevel(
+					    TOPLEVEL *toplevel,
+					    OBJECT *o_current,
+					    STRING_LIST *new_comp_attrib_list);
 STRING_LIST *s_toplevel_get_net_attribs_in_sheet(char *netname);
 void s_toplevel_update_net_attribs_in_toplevel(OBJECT *o_current, 
 					 STRING_LIST *new_net_attrib_list);
 STRING_LIST *s_toplevel_get_pin_attribs_in_sheet(char *refdes, OBJECT *pin);
-void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *pin,
+void s_toplevel_update_pin_attribs_in_toplevel(TOPLEVEL *toplevel,
+					 char *refdes, OBJECT *pin,
 					 STRING_LIST *new_pin_attrib_list);
 
 
 /* ------------- s_object.c ------------- */
-void s_object_add_comp_attrib_to_object(OBJECT *o_current, 
-					char *new_attrib_name, 
-					char *new_attrib_value,
-					gint visibility,
-					gint show_name_value);
-void s_object_add_net_attrib_to_object(OBJECT *o_current, 
-				       char *new_attrib_name, 
-				       char *new_attrib_value);
-void s_object_add_pin_attrib_to_object(OBJECT *o_current, 
-				       char *new_attrib_name, 
-				       char *new_attrib_value);
-
-void s_object_replace_attrib_in_object(OBJECT *o_current, 
-				       char *new_attrib_name, 
-				       char *new_attrib_value,
-				       gint visibility,
-				       gint show_name_value);
-void s_object_remove_attrib_in_object(OBJECT *o_current, 
-				      char *new_attrib_name);
-
-OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL *toplevel,
-					     char *text_string,
-					     gint visibility, 
-					     gint show_name_value,
-					     OBJECT * object);
+void s_object_add_comp_attrib_to_object (TOPLEVEL *toplevel,
+                                         OBJECT *o_current,
+                                         char *new_attrib_name,
+                                         char *new_attrib_value,
+                                         gint visibility,
+                                         gint show_name_value);
+void s_object_add_net_attrib_to_object (TOPLEVEL *toplevel,
+                                        OBJECT *o_current,
+                                        char *new_attrib_name,
+                                        char *new_attrib_value);
+void s_object_add_pin_attrib_to_object (TOPLEVEL *toplevel,
+                                        OBJECT *o_current,
+                                        char *new_attrib_name,
+                                        char *new_attrib_value);
+
+void s_object_replace_attrib_in_object (TOPLEVEL *toplevel,
+                                        OBJECT *o_current,
+                                        char *new_attrib_name,
+                                        char *new_attrib_value,
+                                        gint visibility,
+                                        gint show_name_value);
+void s_object_remove_attrib_in_object (TOPLEVEL *toplevel,
+                                       OBJECT *o_current,
+                                       char *new_attrib_name);
+
+OBJECT *s_object_attrib_add_attrib_in_object (TOPLEVEL *toplevel,
+                                              char *text_string,
+                                              gint visibility,
+                                              gint show_name_value,
+                                              OBJECT * object);
 void s_object_delete_text_object_in_object(TOPLEVEL *toplevel, OBJECT *test_object);
 int s_object_has_sym_file(OBJECT *object);
 
diff --git a/gattrib/src/s_object.c b/gattrib/src/s_object.c
index 5255ed0..0845758 100644
--- a/gattrib/src/s_object.c
+++ b/gattrib/src/s_object.c
@@ -70,17 +70,20 @@
  *    calls o_text_new() to add position info and name=value string
  *    to attrib_graphic.
  * -# It calls o_attrib_add() to wrap attrib_graphic with (attribute OBJECT )
+ * \param toplevel TOPLEVEL structure
  * \param o_current pointer to object to add attribute to
  * \param new_attrib_name name of the attribute to add
  * \param new_attrib_value value of the attribute to add
  * \param visibility Is the attribute visible?
  * \param show_name_value Control visibility of name and value.
  */
-void s_object_add_comp_attrib_to_object(OBJECT *o_current, 
-					char *new_attrib_name, 
-					char *new_attrib_value,
-					gint visibility,
-					gint show_name_value)
+void
+s_object_add_comp_attrib_to_object (TOPLEVEL *toplevel,
+                                    OBJECT *o_current,
+                                    char *new_attrib_name,
+                                    char *new_attrib_value,
+                                    gint visibility,
+                                    gint show_name_value)
 {
   char *name_value_pair;
   OBJECT *attrib_graphic_object;
@@ -89,8 +92,12 @@ void s_object_add_comp_attrib_to_object(OBJECT *o_current,
   /* One last sanity check, then add attrib */
   if (strlen(new_attrib_value) != 0) {
     name_value_pair = g_strconcat(new_attrib_name, "=", new_attrib_value, NULL);
-    attrib_graphic_object = s_object_attrib_add_attrib_in_object(pr_current, name_value_pair, visibility, 
-							 show_name_value, o_current);
+    attrib_graphic_object =
+      s_object_attrib_add_attrib_in_object (toplevel,
+                                            name_value_pair,
+                                            visibility,
+                                            show_name_value,
+                                            o_current);
   }
   
   return;
@@ -102,8 +109,11 @@ void s_object_add_comp_attrib_to_object(OBJECT *o_current,
 /*!
  * \todo This needs to be filled in.
  */
-void s_object_add_net_attrib_to_object(OBJECT *o_current, char *new_attrib_name, 
-				char *new_attrib_value)
+void
+s_object_add_net_attrib_to_object (TOPLEVEL *toplevel,
+                                   OBJECT *o_current,
+                                   char *new_attrib_name,
+                                   char *new_attrib_value)
 {
   /* TBD */
 }
@@ -120,14 +130,18 @@ void s_object_add_net_attrib_to_object(OBJECT *o_current, char *new_attrib_name,
  *    calls o_text_new() to add position info and name=value string
  *    to attrib_graphic.
  * -# It calls o_attrib_add() to wrap attrib_graphic with (attribute OBJECT )
+ * \param toplevel TOPLEVEL structure
  * \param o_current Pointer to pin object
  * \param new_attrib_name Name of attribute to add
  * \parma new_attrib_value Value of attribute to add
  * \todo Do I really need separate fcns for comps, nets, and
  * pins???
  */
-void s_object_add_pin_attrib_to_object(OBJECT *o_current, char *new_attrib_name, 
-				char *new_attrib_value)
+void
+s_object_add_pin_attrib_to_object (TOPLEVEL *toplevel,
+                                   OBJECT *o_current,
+                                   char *new_attrib_name,
+                                   char *new_attrib_value)
 {
   char *name_value_pair;
   OBJECT *attrib_graphic_object;
@@ -136,13 +150,15 @@ void s_object_add_pin_attrib_to_object(OBJECT *o_current, char *new_attrib_name,
   /* One last sanity check */
   if (strlen(new_attrib_value) != 0) {
     name_value_pair = g_strconcat(new_attrib_name, "=", new_attrib_value, NULL);
-    attrib_graphic_object = s_object_attrib_add_attrib_in_object(pr_current, name_value_pair, 
-								 INVISIBLE, 
-								 SHOW_NAME_VALUE, o_current);
+    attrib_graphic_object =
+      s_object_attrib_add_attrib_in_object (toplevel,
+                                            name_value_pair,
+                                            INVISIBLE,
+                                            SHOW_NAME_VALUE,
+                                            o_current);
   }
-  
-  return;
 
+  return;
 }
 
 
@@ -151,13 +167,15 @@ void s_object_add_pin_attrib_to_object(OBJECT *o_current, char *new_attrib_name,
  *
  * Find the instance of attrib_name on o_current, and
  * replace its value with the new_attrib_value.
+ * \param toplevel TOPLEVEL object
  * \param o_current object to operate on
  * \param new_attrib_name name of attribute to replace
  * \param new_attrib_value value to set attribute to
  * \param visibility set visibility of attribute
  * \param show_name_value set visibility of attribute name and value
  */
-void s_object_replace_attrib_in_object(OBJECT *o_current, 
+void s_object_replace_attrib_in_object(TOPLEVEL *toplevel,
+				       OBJECT *o_current,
 				       char *new_attrib_name, 
 				       char *new_attrib_value,
 				       gint visibility, 
@@ -181,7 +199,7 @@ void s_object_replace_attrib_in_object(OBJECT *o_current,
       old_attrib_name = u_basic_breakup_string(old_attrib_text, '=', 0);
       
       if (strcmp(old_attrib_name, new_attrib_name) == 0) {
-	/* create attrib=value text string & stuff it back into pr_current */
+	/* create attrib=value text string & stuff it back into toplevel */
 	new_attrib_text = g_strconcat(new_attrib_name, "=", new_attrib_value, NULL);
 	g_free(a_current->text->string);   /* remove old attrib string */
 	a_current->text->string = g_strdup(new_attrib_text);   /* insert new attrib string */
@@ -216,10 +234,14 @@ void s_object_replace_attrib_in_object(OBJECT *o_current,
  * \brief Remove attribute from object
  *
  * Remove an attribute from an object.
+ * \param toplevel TOPLEVEL structure
  * \param o_current Object to remove attribute from
  * \param new_attrib_name Name of attribute to remove
  */
-void s_object_remove_attrib_in_object(OBJECT *o_current, char *new_attrib_name) 
+void
+s_object_remove_attrib_in_object (TOPLEVEL *toplevel,
+                                  OBJECT *o_current,
+                                  char *new_attrib_name)
 {
   GList *a_iter;
   OBJECT *a_current;
@@ -245,7 +267,7 @@ void s_object_remove_attrib_in_object(OBJECT *o_current, char *new_attrib_name)
 #endif
 
 	attribute_object = a_current;
-	s_object_delete_text_object_in_object(pr_current, attribute_object);
+	s_object_delete_text_object_in_object (toplevel, attribute_object);
 
 	g_free(old_attrib_text);
 	g_free(old_attrib_name);
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index e822e90..572b482 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -55,22 +55,22 @@
 /*! \brief Read a schematic page
  *
  * Reads in a schematic page & calls f_open, which fills out the
- * pr_current structure.
+ * toplevel structure.
  *
+ *  \param toplevel TOPLEVEL structure
  *  \param filename file to be opened
  *  \returns 1 on success, 0 on failure
  */
-int s_toplevel_read_page(char *filename)
+int s_toplevel_read_page(TOPLEVEL *toplevel, char *filename)
 {
   int file_return_code;
   GError *err = NULL;
     
   /* Set the new filename */
-  pr_current->page_current->page_filename = g_strdup(filename);
+  toplevel->page_current->page_filename = g_strdup(filename);
   
-  /* read in and fill out pr_current using f_open and its callees */
-  file_return_code = f_open(pr_current, pr_current->page_current,
-                            filename, &err);
+  /* read in and fill out toplevel using f_open and its callees */
+  file_return_code = f_open (toplevel, toplevel->page_current, filename, &err);
 
   /* If an error occurred, print message */
   if (err != NULL) {
@@ -91,7 +91,7 @@ int s_toplevel_read_page(char *filename)
  *  no symbol file is found.  If this function finds a
  *  placeholder, it warns the user.
  *
- *  \param pr_current pointer to the toplevel object to be verified
+ *  \param toplevel pointer to the toplevel object to be verified
  */
 void s_toplevel_verify_design (TOPLEVEL *toplevel)
 {
@@ -132,7 +132,7 @@ void s_toplevel_verify_design (TOPLEVEL *toplevel)
  * stuff in SHEET_DATA into the libgeda TOPLEVEL structure.
  */
 void
-s_toplevel_gtksheet_to_toplevel()
+s_toplevel_gtksheet_to_toplevel(TOPLEVEL *toplevel)
 {
   GList *iter;
   PAGE *p_current;
@@ -147,15 +147,15 @@ s_toplevel_gtksheet_to_toplevel()
 #endif
 
   /* must iterate over all pages in design */
-  for ( iter = geda_list_get_glist( pr_current->pages );
+  for ( iter = geda_list_get_glist( toplevel->pages );
         iter != NULL;
         iter = g_list_next( iter ) ) {
 
     p_current = (PAGE *)iter->data;
-    pr_current->page_current = p_current;
+    toplevel->page_current = p_current;
     /* only traverse pages which are toplevel */
     if (p_current->page_control == 0) {
-      s_toplevel_sheetdata_to_toplevel (p_current);    /* adds all objects from page */
+      s_toplevel_sheetdata_to_toplevel (toplevel, p_current);    /* adds all objects from page */
     }
   }
 
@@ -398,10 +398,11 @@ void s_toplevel_select_object()
  * -# First find and update component attribs.
  * -# Then find and update net attribs.
  * -# Finally find and update pin attribs.
+ * \param toplevel TOPLEVEL structure
  * \param page schematic page to copy
  */
 void
-s_toplevel_sheetdata_to_toplevel (PAGE *page)
+s_toplevel_sheetdata_to_toplevel (TOPLEVEL *toplevel, PAGE *page)
 {
   GList *copy_list;
   GList *o_iter, *prim_iter;
@@ -451,7 +452,8 @@ s_toplevel_sheetdata_to_toplevel (PAGE *page)
 
 
 	/* Now update attribs in toplevel using this list.  */
-	s_toplevel_update_component_attribs_in_toplevel(o_current, 
+	s_toplevel_update_component_attribs_in_toplevel(toplevel,
+							o_current,
 							new_comp_attrib_pair_list);
 
 	g_free(temp_uref);
@@ -511,10 +513,14 @@ s_toplevel_sheetdata_to_toplevel (PAGE *page)
              prim_iter = g_list_next (prim_iter)) {
           OBJECT *comp_prim_obj = prim_iter->data;
 
-	  if (comp_prim_obj->type == OBJ_PIN) { 
-	    new_pin_attrib_list = s_toplevel_get_pin_attribs_in_sheet(temp_uref, comp_prim_obj);
-	    s_toplevel_update_pin_attribs_in_toplevel(temp_uref, comp_prim_obj, new_pin_attrib_list);
-	  }
+          if (comp_prim_obj->type == OBJ_PIN) {
+            new_pin_attrib_list =
+              s_toplevel_get_pin_attribs_in_sheet (temp_uref, comp_prim_obj);
+           s_toplevel_update_pin_attribs_in_toplevel (toplevel,
+                                                      temp_uref,
+                                                      comp_prim_obj,
+                                                      new_pin_attrib_list);
+         }
         }
       }     /* if(temp_uref  */
       
@@ -619,12 +625,16 @@ STRING_LIST *s_toplevel_get_component_attribs_in_sheet(char *refdes)
  * -# If the attribs doesn't exist on o_current, but is non-null in
  *    the name=value pair, create an attrib object and add it to the part
  *    on o_current.
+ * \param toplevel TOPLEVEL structure
  * \param o_current Component (complex) to be updated.
  * \param new_comp_attrib_list list of name=value attribute pairs
  *                             from SHEET_DATA.
  */
-void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current, 
-						     STRING_LIST *new_comp_attrib_list) 
+void
+s_toplevel_update_component_attribs_in_toplevel (
+                                        TOPLEVEL *toplevel,
+                                        OBJECT *o_current,
+                                        STRING_LIST *new_comp_attrib_list)
 {
   STRING_LIST *local_list;
   STRING_LIST *complete_comp_attrib_list;
@@ -770,7 +780,8 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
       printf("               visibility = %d, show_name_value = %d.\n",
 	     visibility, show_name_value);
 #endif
-      s_object_replace_attrib_in_object(o_current, 
+      s_object_replace_attrib_in_object(toplevel,
+					o_current,
 					new_attrib_name, 
 					new_attrib_value, 
 					visibility, 
@@ -784,7 +795,7 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
       printf("     -- In s_toplevel_update_component_attribs_in_toplevel, about to remove old attrib with name= %s, value= %s\n",
 	     old_attrib_name, old_attrib_value);
 #endif
-      s_object_remove_attrib_in_object(o_current, old_attrib_name);
+      s_object_remove_attrib_in_object (toplevel, o_current, old_attrib_name);
     }
 
     /* -------  Four cases to consider: Case 3 ----- */
@@ -796,11 +807,12 @@ void s_toplevel_update_component_attribs_in_toplevel(OBJECT *o_current,
 	     new_attrib_name, new_attrib_value);
 #endif 
 
-      s_object_add_comp_attrib_to_object(o_current, 
-					 new_attrib_name, 
-					 new_attrib_value, 
-					 visibility,
-					 show_name_value);
+      s_object_add_comp_attrib_to_object (toplevel,
+                                          o_current,
+                                          new_attrib_name,
+                                          new_attrib_value,
+                                          visibility,
+                                          show_name_value);
 
       /* -------  Four cases to consider: Case 4 ----- */
     } else {
@@ -954,12 +966,16 @@ STRING_LIST *s_toplevel_get_pin_attribs_in_sheet(char *refdes, OBJECT *pin)
  *    delete the attrib.
  * -# If the attribs doesn't exist on pin, but is non-null in
  *    the name=value pair, create an attrib object and add it to the pin.
+ * \param toplevel TOPLEVEL structure
  * \param refdes Unused - needs refactored out
  * \param [in,out] o_pin pin to update
  * \param [in] new_pin_attrib_list New pin attribute list to apply
  */
-void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *o_pin, 
-				   STRING_LIST *new_pin_attrib_list)
+void
+s_toplevel_update_pin_attribs_in_toplevel (TOPLEVEL *toplevel,
+                                           char *refdes,
+                                           OBJECT *o_pin,
+                                           STRING_LIST *new_pin_attrib_list)
 {
   STRING_LIST *local_list;
   char *new_name_value_pair;
@@ -995,7 +1011,8 @@ void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *o_pin,
       printf("In s_toplevel_update_pin_attribs_in_toplevel, about to replace old attrib with new one: name= %s, value= %s\n",
              new_attrib_name, new_attrib_value);
 #endif
-      s_object_replace_attrib_in_object(o_pin, 
+      s_object_replace_attrib_in_object(toplevel,
+					o_pin,
 					new_attrib_name, 
 					new_attrib_value, 
 					LEAVE_VISIBILITY_ALONE,
@@ -1009,7 +1026,7 @@ void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *o_pin,
       printf("In s_toplevel_update_pin_attribs_in_toplevel, about to remove old attrib with name= %s, value= %s\n",
              new_attrib_name, old_attrib_value);
 #endif
-      s_object_remove_attrib_in_object(o_pin, new_attrib_name);
+      s_object_remove_attrib_in_object (toplevel, o_pin, new_attrib_name);
     }
                                                                                                        
     /* -------  Four cases to consider: Case 3: No old attrib, new one exists. ----- */
@@ -1020,9 +1037,12 @@ void s_toplevel_update_pin_attribs_in_toplevel(char *refdes, OBJECT *o_pin,
       printf("In s_toplevel_update_pin_attribs_in_toplevel, about to add new attrib with name= %s, value= %s\n",
              new_attrib_name, new_attrib_value);
 #endif
-                                                                                                       
-      s_object_add_pin_attrib_to_object(o_pin, new_attrib_name, new_attrib_value);
-                                                                                                       
+
+      s_object_add_pin_attrib_to_object (toplevel,
+                                         o_pin,
+                                         new_attrib_name,
+                                         new_attrib_value);
+
       /* -------  Four cases to consider: Case 4 ----- */
     } else {
       /* Do nothing. */
diff --git a/gattrib/src/x_dialog.c b/gattrib/src/x_dialog.c
index 703f1ea..a1d5e2f 100644
--- a/gattrib/src/x_dialog.c
+++ b/gattrib/src/x_dialog.c
@@ -254,7 +254,7 @@ void x_dialog_unsaved_data()
         }
       case GTK_RESPONSE_YES:
         {
-          s_toplevel_gtksheet_to_toplevel();  /* Dumps sheet data into TOPLEVEL */
+          s_toplevel_gtksheet_to_toplevel(pr_current);  /* Dumps sheet data into TOPLEVEL */
           s_page_save_all(pr_current);  /* saves all pages in design */
           sheet_head->CHANGED = FALSE;
           gattrib_quit(0);
diff --git a/gattrib/src/x_fileselect.c b/gattrib/src/x_fileselect.c
index da35a7b..b0a0b13 100644
--- a/gattrib/src/x_fileselect.c
+++ b/gattrib/src/x_fileselect.c
@@ -139,7 +139,7 @@ x_fileselect_load_files (GSList *filenames)
 
     s_page_goto (pr_current, s_page_new (pr_current, string));
 
-    if(s_toplevel_read_page(string) == 0) {
+    if(s_toplevel_read_page(pr_current, string) == 0) {
        fprintf(stderr, "Couldn't load schematic [%s]\n", string);
        return FALSE;
     }
diff --git a/gattrib/src/x_window.c b/gattrib/src/x_window.c
index 521a96a..72bcad1 100644
--- a/gattrib/src/x_window.c
+++ b/gattrib/src/x_window.c
@@ -157,7 +157,7 @@ menu_file_open()
 static void
 menu_file_save()
 {
-  s_toplevel_gtksheet_to_toplevel();  /* Dumps sheet data into TOPLEVEL */
+  s_toplevel_gtksheet_to_toplevel(pr_current);  /* Dumps sheet data into TOPLEVEL */
   s_page_save_all(pr_current);  /* saves all pages in design */
 
   sheet_head->CHANGED = FALSE;

commit 29994756d3dd499dbfc5252085074d47926bd0be
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gattrib: Rename TOPLEVELs passed as arguments to "toplevel"
    
    Lets us notice the difference between pr_current the global variable
    and those passed as arguments.

diff --git a/gattrib/include/prototype.h b/gattrib/include/prototype.h
index 2c122f3..f2ac095 100644
--- a/gattrib/include/prototype.h
+++ b/gattrib/include/prototype.h
@@ -84,7 +84,7 @@ void s_table_gtksheet_to_table(GtkSheet *local_gtk_sheet,
 
 /* ------------- s_toplevel.c ------------- */
 int s_toplevel_read_page(char *filename);
-void s_toplevel_verify_design(TOPLEVEL *pr_current);
+void s_toplevel_verify_design(TOPLEVEL *toplevel);
 void s_toplevel_gtksheet_to_toplevel();
 void s_toplevel_add_new_attrib(gchar *new_attrib_name);
 void s_toplevel_delete_attrib_col();
@@ -123,12 +123,12 @@ void s_object_replace_attrib_in_object(OBJECT *o_current,
 void s_object_remove_attrib_in_object(OBJECT *o_current, 
 				      char *new_attrib_name);
 
-OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * w_current, 
+OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL *toplevel,
 					     char *text_string,
 					     gint visibility, 
 					     gint show_name_value,
 					     OBJECT * object);
-void s_object_delete_text_object_in_object(TOPLEVEL *w_current, OBJECT *test_object);
+void s_object_delete_text_object_in_object(TOPLEVEL *toplevel, OBJECT *test_object);
 int s_object_has_sym_file(OBJECT *object);
 
 /* ------------- s_rename.c ------------- */
@@ -139,7 +139,7 @@ void s_rename_print(void);
 int s_rename_search(char *src, char *dest, int quiet_flag);
 void s_rename_add(char *src, char *dest);
 void s_rename_all_lowlevel(NETLIST * netlist_head, char *src, char *dest);
-void s_rename_all(TOPLEVEL * pr_current, NETLIST * netlist_head);
+void s_rename_all(TOPLEVEL *toplevel, NETLIST *netlist_head);
 
 /* ------------- s_misc.c ------------- */
 void verbose_print(char *string);
@@ -156,8 +156,8 @@ void s_visibility_set_cell(gint cur_page, gint row, gint col,
 			   gint visibility, gint show_name_value);
 
 /* ------------- i_vars.c ------------- */
-void i_vars_set(TOPLEVEL * pr_current);
-void i_window_vars_set(TOPLEVEL * w_current);
+void i_vars_set(TOPLEVEL *toplevel);
+void i_window_vars_set(TOPLEVEL *toplevel);
 
 /* ------------- x_dialog.c ------------- */
 void x_dialog_newattrib();
diff --git a/gattrib/src/i_basic.c b/gattrib/src/i_basic.c
index cbd49f8..2dab181 100644
--- a/gattrib/src/i_basic.c
+++ b/gattrib/src/i_basic.c
@@ -51,15 +51,15 @@
  *
  * ------------------------------------------------------------- */
 #if 0 /* not used, but leaving it here in case we need it later */
-static void i_update_status(TOPLEVEL * w_current, const char *string)
+static void i_update_status(TOPLEVEL *toplevel, const char *string)
 {
-  if (!w_current->status_label) {
+  if (!toplevel->status_label) {
     return;
   }
 
   if (string) {
     /* NOTE: consider optimizing this if same label */
-    gtk_label_set(GTK_LABEL(w_current->status_label), (char *) string);
+    gtk_label_set(GTK_LABEL(toplevel->status_label), (char *) string);
   }
 }
 #endif
diff --git a/gattrib/src/i_vars.c b/gattrib/src/i_vars.c
index 14b22dd..ed5249b 100644
--- a/gattrib/src/i_vars.c
+++ b/gattrib/src/i_vars.c
@@ -60,16 +60,16 @@ int   default_paper_height = 85000;/*!< height for letter paper (landscape)
 
 
 /*------------------------------------------------------------------*/
-/*! \brief Initialise variables in pr_current
+/*! \brief Initialise variables in the TOPLEVEL
  *
- * Initialize the variables in pr_current. In practice, this is only
+ * Initialize the variables in toplevel. In practice, this is only
  * the paper size for the sheet.
- * \param pr_current pointer to the TOPLEVEL to set paper size in.
+ * \param toplevel pointer to the TOPLEVEL to set paper size in.
  */
-void i_vars_set(TOPLEVEL * pr_current)
+void i_vars_set (TOPLEVEL *toplevel)
 {
-  i_vars_libgeda_set(pr_current);
+  i_vars_libgeda_set (toplevel);
 
-  pr_current->paper_width = default_paper_width;
-  pr_current->paper_height = default_paper_height;
+  toplevel->paper_width = default_paper_width;
+  toplevel->paper_height = default_paper_height;
 }
diff --git a/gattrib/src/s_object.c b/gattrib/src/s_object.c
index 92031f5..5255ed0 100644
--- a/gattrib/src/s_object.c
+++ b/gattrib/src/s_object.c
@@ -273,7 +273,7 @@ void s_object_remove_attrib_in_object(OBJECT *o_current, char *new_attrib_name)
  * Attach the name=value pair to the OBJECT "object". This function
  * was stolen from gschem/src/o_attrib.c:o_attrib_add_attrib and
  * hacked for gattrib.
- * \param pr_current TOPLEVEL to operate on
+ * \param toplevel TOPLEVEL to operate on
  * \param text_string
  * \param visibility
  * \param show_name_value
@@ -281,9 +281,12 @@ void s_object_remove_attrib_in_object(OBJECT *o_current, char *new_attrib_name)
  * \returns pointer to the object
  * \todo Does it need to return OBJECT?
  */
-OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_string,
-			    int visibility, int show_name_value,
-			    OBJECT * object)
+OBJECT *
+s_object_attrib_add_attrib_in_object (TOPLEVEL *toplevel,
+                                      char *text_string,
+                                      int visibility,
+                                      int show_name_value,
+                                      OBJECT * object)
 {
   int world_x = -1, world_y = -1;
   int color;
@@ -316,9 +319,9 @@ OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_s
       exit(-1);
     }
   } else {    /* This must be a floating attrib, but what is that !?!?!?!?!  */
-    world_get_object_glist_bounds(pr_current,
-                                  s_page_objects (pr_current->page_current),
-                                  &left, &top, &right, &bottom);
+    world_get_object_glist_bounds (toplevel,
+                                   s_page_objects (toplevel->page_current),
+                                   &left, &top, &right, &bottom);
 
     /* this really is the lower left hand corner */
     world_x = left;
@@ -333,30 +336,30 @@ OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_s
   printf("===  In s_object_attrib_add_attrib_in_object, about to attach new text attrib with properties:\n");
   printf("     color = %d\n", color);
   printf("     text_string = %s \n", text_string);
-  printf("     text_size = %d \n", pr_current->text_size);
+  printf("     text_size = %d \n", toplevel->text_size);
   printf("     visibility = %d \n", visibility);
   printf("     show_name_value = %d \n", show_name_value);
 #endif
 
-  new_obj = o_text_new (pr_current, OBJ_TEXT, color, world_x, world_y,
+  new_obj = o_text_new (toplevel, OBJ_TEXT, color, world_x, world_y,
                         LOWER_LEFT, 0, /* zero is angle */
                         text_string, DEFAULT_TEXT_SIZE,
                         visibility, show_name_value);
-  s_page_append (pr_current, pr_current->page_current, new_obj);
+  s_page_append (toplevel, toplevel->page_current, new_obj);
 
-  /* now pr_current->page_current->object_tail contains new text item */
+  /* now toplevel->page_current->object_tail contains new text item */
 
   /* now attach the attribute to the object (if o_current is not NULL) */
   /* remember that o_current contains the object to get the attribute */
   if (o_current) {
-    o_attrib_attach (pr_current, new_obj, o_current, FALSE);
+    o_attrib_attach (toplevel, new_obj, o_current, FALSE);
   }
 
-  o_selection_add (pr_current,
-                   pr_current->page_current->selection_list, new_obj);
+  o_selection_add (toplevel,
+                   toplevel->page_current->selection_list, new_obj);
 
 
-  pr_current->page_current->CHANGED = 1;
+  toplevel->page_current->CHANGED = 1;
 
   return new_obj;
 }
@@ -370,14 +373,16 @@ OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_s
  * Delete the text object pointed to by text_object.  This function
  * was shamelessly stolen from gschem/src/o_delete.c and hacked
  * for gattrib by SDB.
- * \param pr_current TOPLEVEL to be operated on
+ * \param toplevel TOPLEVEL to be operated on
  * \param test_object text object to be deleted
  */
-void s_object_delete_text_object_in_object(TOPLEVEL * pr_current, OBJECT * text_object)
+void
+s_object_delete_text_object_in_object (TOPLEVEL *toplevel,
+                                       OBJECT * text_object)
 {
-  s_page_remove (pr_current, pr_current->page_current, text_object);
-  s_delete_object (pr_current, text_object);
-  pr_current->page_current->CHANGED = 1;
+  s_page_remove (toplevel, toplevel->page_current, text_object);
+  s_delete_object (toplevel, text_object);
+  toplevel->page_current->CHANGED = 1;
 }
                                                                                                     
 
diff --git a/gattrib/src/s_rename.c b/gattrib/src/s_rename.c
index a647303..cb22509 100644
--- a/gattrib/src/s_rename.c
+++ b/gattrib/src/s_rename.c
@@ -279,7 +279,7 @@ void s_rename_all_lowlevel(NETLIST * netlist_head, char *src, char *dest)
 
 }
 
-void s_rename_all(TOPLEVEL * pr_current, NETLIST * netlist_head)
+void s_rename_all (TOPLEVEL *toplevel, NETLIST * netlist_head)
 {
     int i;
 
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index 3632b79..e822e90 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -93,14 +93,14 @@ int s_toplevel_read_page(char *filename)
  *
  *  \param pr_current pointer to the toplevel object to be verified
  */
-void s_toplevel_verify_design(TOPLEVEL *pr_current)
+void s_toplevel_verify_design (TOPLEVEL *toplevel)
 {
   GList *p_iter;
   const GList *o_iter;
 
   int missing_sym_flag = 0;
 
-  for (p_iter = geda_list_get_glist (pr_current->pages);
+  for (p_iter = geda_list_get_glist (toplevel->pages);
        p_iter != NULL;
        p_iter = g_list_next (p_iter)) {
     PAGE *p_current = p_iter->data;

commit 77477fe829b9c056564084748cad5110e564c903
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gattrib: Remove unused function s_toplevel_empty_project()

diff --git a/gattrib/include/prototype.h b/gattrib/include/prototype.h
index 4895461..2c122f3 100644
--- a/gattrib/include/prototype.h
+++ b/gattrib/include/prototype.h
@@ -85,7 +85,6 @@ void s_table_gtksheet_to_table(GtkSheet *local_gtk_sheet,
 /* ------------- s_toplevel.c ------------- */
 int s_toplevel_read_page(char *filename);
 void s_toplevel_verify_design(TOPLEVEL *pr_current);
-void s_toplevel_empty_project();
 void s_toplevel_gtksheet_to_toplevel();
 void s_toplevel_add_new_attrib(gchar *new_attrib_name);
 void s_toplevel_delete_attrib_col();
diff --git a/gattrib/src/s_toplevel.c b/gattrib/src/s_toplevel.c
index 53c971a..3632b79 100644
--- a/gattrib/src/s_toplevel.c
+++ b/gattrib/src/s_toplevel.c
@@ -122,25 +122,6 @@ void s_toplevel_verify_design(TOPLEVEL *pr_current)
   }
 }
 
-
-
-/*------------------------------------------------------------------*/
-/*! \brief Detect empty project
- *
- * Test if there is data in the current project.
- * \returns 1 if the project is empty (i.e. pr_current is
- * not filled out yet), and 0 if the project is non-empty (i.e. there
- * is some data in pr_current).
- * \todo Doesn't do anything. Candidate for removal?
- */
-void s_toplevel_empty_project()
-{
-  /* Nothing here yet.  Is this necessary in current program
-   * architecture? */
-}
-
-
-
 /*------------------------------------------------------------------*/
 /*! \brief Copy data from gtksheet into TOPLEVEL struct
  *




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs