gattrib

prototype.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

gboolean gattrib_really_quit (void)
 GTK callback to quit the program.
gint gattrib_quit (gint return_code)
 Quit the program.
void usage (char *cmd)
 Print usage message.
int parse_commandline (int argc, char *argv[])
 Parse command line switches.
int cmp (STRING_LIST *a, STRING_LIST *b)
 Compare values of string data.
STRING_LISTlistsort (STRING_LIST *list, int is_circular, int is_double)
 Sort the linked list.
void f_export_components (gchar *filename)
void g_register_funcs (void)
 Register Scheme functions.
SCM g_quit (void)
 Scheme function to quit the application.
SCM g_rc_gattrib_version (SCM version)
 Test the version of gattrib and gEDA/gaf.
int s_attrib_name_in_list (STRING_LIST *name_value_list, char *name)
 Detect "name" in STRING_LIST.
char * s_attrib_get_refdes (OBJECT *object)
 Locate the refdes associated with an object.
SHEET_DATAs_sheet_data_new ()
 Create a SHEET_DATA struct.
void s_sheet_data_add_master_comp_list_items (const GList *obj_list)
 Add components to master list.
void s_sheet_data_add_master_comp_attrib_list_items (const GList *obj_list)
 Add attributes to master list.
void s_sheet_data_add_master_net_list_items (const GList *obj_list)
 Add net names to master list.
void s_sheet_data_add_master_net_attrib_list_items (const GList *obj_list)
 Add net attributes to master list.
void s_sheet_data_add_master_pin_list_items (const GList *obj_list)
 Add pin names to master list.
void s_sheet_data_add_master_pin_attrib_list_items (const GList *obj_list)
 Add pin attributes to master list.
void s_sheet_data_gtksheet_to_sheetdata ()
 Extract data from gtksheet.
STRING_LISTs_string_list_new ()
 Return a pointer to a new STRING_LIST.
STRING_LISTs_string_list_duplicate_string_list (STRING_LIST *old_string_list)
 Duplicate a STRING_LIST.
void s_string_list_add_item (STRING_LIST *list, int *count, char *item)
 Add an item to a STRING_LIST.
void s_string_list_delete_item (STRING_LIST **list, int *count, char *item)
int s_string_list_in_list (STRING_LIST *list, char *item)
 Detect item in list.
gchar * s_string_list_get_data_at_index (STRING_LIST *list, gint index)
 Get an item from a STRING_LIST by index.
void s_string_list_sort_master_comp_list ()
 Sort the master component list.
void s_string_list_sort_master_comp_attrib_list ()
 Sort the master component attribute list.
void s_string_list_sort_master_net_list ()
 Sort the master netlist.
void s_string_list_sort_master_net_attrib_list ()
 Sort the master net attribute list.
void s_string_list_sort_master_pin_list ()
 Sort the master pin list.
void s_string_list_sort_master_pin_attrib_list ()
 Sort the master pin attribute list.
TABLE ** s_table_new (int rows, int cols)
 Create a new table.
TABLE ** s_table_resize (TABLE **table, int rows, int old_cols, int new_cols)
 Resize a TABLE.
void s_table_destroy (TABLE **table, int row_count, int col_count)
 Destroy a table.
int s_table_get_index (STRING_LIST *list, char *string)
 Get a string index number.
STRING_LISTs_table_create_attrib_pair (gchar *row_name, TABLE **table, STRING_LIST *row_list, int num_attribs)
 Create attribute pair.
void s_table_add_toplevel_comp_items_to_comp_table (const GList *obj_list)
 Add components to the component table.
void s_table_add_toplevel_net_items_to_net_table (const GList *obj_list)
void s_table_add_toplevel_pin_items_to_pin_table (const GList *obj_list)
 Add pins to pin table.
void s_table_gtksheet_to_all_tables ()
 Push spreadsheet data to TABLEs.
void s_table_gtksheet_to_table (GtkSheet *local_gtk_sheet, STRING_LIST *master_row_list, STRING_LIST *master_col_list, TABLE **local_table, int num_rows, int num_cols)
 Extract attributes from gtksheet into TABLE.
int s_toplevel_read_page (TOPLEVEL *toplevel, char *filename)
 Read a schematic page.
void s_toplevel_verify_design (TOPLEVEL *toplevel)
 Verify the entire design.
void s_toplevel_gtksheet_to_toplevel (TOPLEVEL *toplevel)
 Copy data from gtksheet into TOPLEVEL struct.
void s_toplevel_add_new_attrib (gchar *new_attrib_name)
 Add a new attribute to the top level.
void s_toplevel_delete_attrib_col ()
 Delete an attribute column.
void s_toplevel_sheetdata_to_toplevel (TOPLEVEL *toplevel, PAGE *page)
 Copy SHEET_DATA content to TOP_LEVEL.
STRING_LISTs_toplevel_get_component_attribs_in_sheet (char *refdes)
 Get the component attributes from the top level.
void s_toplevel_update_component_attribs_in_toplevel (TOPLEVEL *toplevel, OBJECT *o_current, STRING_LIST *new_comp_attrib_list)
 Update component attributes in TOP_LEVEL.
STRING_LISTs_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_LISTs_toplevel_get_pin_attribs_in_sheet (char *refdes, OBJECT *pin)
 Get pin attributes.
void s_toplevel_update_pin_attribs_in_toplevel (TOPLEVEL *toplevel, char *refdes, OBJECT *pin, STRING_LIST *new_pin_attrib_list)
 Update pin attributes in toplevel.
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)
 Add an attribute to an OBJECT.
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)
 Add a new attribute to an pin OBJECT.
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)
 Replace attribute value in object.
void s_object_remove_attrib_in_object (TOPLEVEL *toplevel, OBJECT *o_current, char *new_attrib_name)
 Remove attribute from object.
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)
 Delete text object.
int s_object_has_sym_file (OBJECT *object)
 Ensure object has a symbol file.
void s_rename_init (void)
 Initialize the renaming data space.
void s_rename_destroy_all (void)
 Free all data referred to by the rename pairs.
void s_rename_next_set (void)
void s_rename_print (void)
 Print all rename sets.
int s_rename_search (char *src, char *dest, int quiet_flag)
 Search the rename sets.
void s_rename_add (char *src, char *dest)
 Add to the rename pairs.
void s_rename_all_lowlevel (NETLIST *netlist_head, char *src, char *dest)
void s_rename_all (TOPLEVEL *toplevel, NETLIST *netlist_head)
void verbose_print (char *string)
 Print message in verbose mode.
void verbose_done (void)
 Print "DONE" message in verbose mode.
void verbose_reset_index (void)
 Reset the running character count.
char * s_misc_remaining_string (char *string, char delimiter, int count)
void s_visibility_set_invisible ()
void s_visibility_set_name_only ()
 Set the visibility of the selected cells to NAME_ONLY.
void s_visibility_set_value_only ()
void s_visibility_set_name_and_value ()
void s_visibility_set_cell (gint cur_page, gint row, gint col, gint visibility, gint show_name_value)
void i_vars_set (TOPLEVEL *toplevel)
 Initialise variables in the TOPLEVEL.
void i_window_vars_set (TOPLEVEL *toplevel)
void x_dialog_newattrib ()
 Add new attribute dialog.
void x_dialog_delattrib ()
 Delete Attribute dialog.
void x_dialog_missing_sym ()
 Missing Symbol dialog.
void x_dialog_unsaved_data ()
 Unsaved data dialog.
void x_dialog_unimplemented_feature ()
 Unimplemented feature dialog.
void x_dialog_fatal_error (gchar *string, gint return_code)
 Fatal error dialog.
void x_dialog_about_dialog ()
 About gattrib dialog.
void x_dialog_export_file ()
 Export file dialog.
void x_gtksheet_init ()
 Create the GtkSheet.
void x_gtksheet_add_row_labels (GtkSheet *sheet, int count, STRING_LIST *list_head)
 Add row labels to GtkSheet.
void x_gtksheet_add_col_labels (GtkSheet *sheet, int count, STRING_LIST *list_head)
 Add column labels to GtkSheet.
void x_gtksheet_add_cell_item (GtkSheet *sheet, gint i, gint j, char *text, gint visibility, gint show_name_value)
void x_gtksheet_set_cell_text_color (GtkSheet *sheet, gint row, gint col, gint color_name)
 Set the text color of a cell.
int x_gtksheet_get_min_col (GtkSheet *sheet)
 Get the first column selected in the GtkSheet.
int x_gtksheet_get_max_col (GtkSheet *sheet)
 Get the last column selected in the GtkSheet.
GSList * x_fileselect_open (void)
 Open file dialog.
void x_fileselect_save (void)
 File save dialog.
gboolean x_fileselect_load_files (GSList *filenames)
 Open all files specified in the list.
void x_window_init ()
 Initialises the toplevel gtksheet.
void x_window_add_items ()
 Add all items to the top level window.

Detailed Description

This file holds all function prototypes for the entire gattrib project. It should be #include'ed after struct.h.

Definition in file prototype.h.


Function Documentation

gboolean gattrib_really_quit ( void  )

This is called when the user quits the program using the UI. The callback is attached to the GTK window_delete event in x_window_init() and attached to the File->Quit menu item in x_window_create_menu(). On execution, the function checks for unsaved changes before calling gattrib_quit() to quit the program.

Returns:
value 0 to the shell to denote a successful quit.

Definition at line 149 of file gattrib.c.

Here is the call graph for this function:

gint gattrib_quit ( gint  return_code)

Unconditionally quit gattrib. Flushes caches and I/O channels, calls the GTK function to quit the application then calls exit() with the appropriate return code.

Parameters:
return_codeValue to pass to the exit() system call.

Definition at line 168 of file gattrib.c.

void usage ( char *  cmd)

Prints gattrib usage information to stdout.

Parameters:
cmdUnused parameter.

Definition at line 77 of file parsecmd.c.

int parse_commandline ( int  argc,
char *  argv[] 
)

Parse command line switches at startup. There are only 3 command line switches:

  • verbose
  • quiet
  • help
    Parameters:
    argcNumber of command line arguments
    argvCommand line arguments (array of strings)
    Returns:
    I don't know what - looks uninitialised in some circumstances.

Definition at line 119 of file parsecmd.c.

Here is the call graph for this function:

int cmp ( STRING_LIST al,
STRING_LIST bl 
)

Comparison function -- compare values of string data.

Parameters:
alpointer to first STRING_LIST item to be compared
blpointer to second STRING_LIST item to be compared
Returns:
+ve if al > bl, -ve if al < bl, 0 if al = bl

Definition at line 87 of file listsort.c.

STRING_LIST* listsort ( STRING_LIST list,
int  is_circular,
int  is_double 
)

This is the actual sort function. Notice that it returns the new head of the list. (It has to, because the head will not generally be the same element after the sort.) So unlike sorting an array, where you can do

  • sort(myarray);

you now have to do

  • list = listsort(mylist);
Parameters:
listThe linked STRING_LIST to be sorted
is_circularTRUE if this is a circularly linked list
is_doubleTRUE if this is a doubly-linked list
Returns:
a pointer to the new head of the list

Definition at line 139 of file listsort.c.

Here is the call graph for this function:

void f_export_components ( gchar *  filename)

Definition at line 58 of file f_export.c.

Here is the call graph for this function:

void g_register_funcs ( void  )

This function registers the Scheme functions required to use gattrib. They are mostly unnecessary, except for reading in the gattribrc file at the beginning of the prog which gives the library search paths.

Definition at line 62 of file g_register.c.

Here is the call graph for this function:

SCM g_quit ( void  )

Quit the application from within Scheme.

Definition at line 77 of file g_register.c.

Here is the call graph for this function:

SCM g_rc_gattrib_version ( SCM  scm_version)
Parameters:
versionVersion being tested
Returns:
false if incorrect version, true if OK

Definition at line 64 of file g_rc.c.

int s_attrib_name_in_list ( STRING_LIST name_value_list,
char *  name 
)

This function is passed a STRING_LIST of name=value pairs, and a name.

Parameters:
name_value_listpointer to STRING_LIST to search
namename string to search for
Returns:
1 (TRUE) if the name is in the STRING_LIST, otherwise it returns 0 (FALSE).

Definition at line 59 of file s_attrib.c.

char* s_attrib_get_refdes ( OBJECT *  object)

This fcn takes an object, finds its refdes and returns it.

Parameters:
objectPointer to the object to search for.
Returns:
For normal components, it returns a pointer to a string containing the refdes. If the component is slotted, it returns a refdes of the form refdes.slot. If no refdes is found, it returns NULL.

Definition at line 92 of file s_attrib.c.

SHEET_DATA* s_sheet_data_new ( )

Creates an initialised but empty SHEET_DATA struct.

Returns:
a pointer to a SHEET_DATA struct.

Definition at line 62 of file s_sheet_data.c.

Here is the call graph for this function:

void s_sheet_data_add_master_comp_list_items ( const GList *  obj_list)

Add to the master list of components refdeses by running through the components and recording the comp refdeses it discovers. Then it sorts them into alphabetical order. Data struct being searched is: OBJECT->attribs(->next. . .)->object->text->string

Parameters:
obj_listpointer to the component list to be added.

Definition at line 110 of file s_sheet_data.c.

Here is the call graph for this function:

void s_sheet_data_add_master_comp_attrib_list_items ( const GList *  obj_list)

Add to the master list of comp attributes by running through each component on the page and recording all attribs it discovers. Then it sorts them into an order used for the horiz listing of the attribs on the spreadsheet. Data struct being searched is: sheet_head->component_list_head->attrib->name;

Parameters:
obj_listpointer to list of attributes being added

Definition at line 173 of file s_sheet_data.c.

Here is the call graph for this function:

void s_sheet_data_add_master_net_list_items ( const GList *  obj_start)

Build the master list of net names by running through the individual cells and recording the net refdeses it discovers. It's currently empty, waiting for implementation of net attributes.

Definition at line 250 of file s_sheet_data.c.

void s_sheet_data_add_master_net_attrib_list_items ( const GList *  obj_start)

Build the master list of net attribs. It's currently empty, waiting for implementation of net attributes.

Definition at line 262 of file s_sheet_data.c.

void s_sheet_data_add_master_pin_list_items ( const GList *  obj_list)

Build the master list of pin names. It writes the label refdes:pinnumber into the global master pin list. Algorithm:

  1. Loop on o_current looking for OBJ_COMPLEX
  2. When we find a complex, save the refdes.
  3. Dive down to o_lower_current = o_current->complex->prim_objs
  4. Loop on o_lower_current looking for OBJ_PIN
  5. When we find a pin, find the pinnumber by calling o_attrib_search_object_attribs_by_name(o_lower_current, "pinnumber", 0)
  6. Create the pin list label as "refdes=XXX", and stick it into the master pin list. Since this function operates on the global sheet_data->master_pin_list, it doesn't return a value.
    Parameters:
    obj_listpointer to list of pin names to be added.

Definition at line 286 of file s_sheet_data.c.

Here is the call graph for this function:

void s_sheet_data_add_master_pin_attrib_list_items ( const GList *  obj_list)

Build the master list of pin attributes. It writes each attrib name into the master pin attrib list. Algorithm:

  1. Loop on o_current looking for OBJ_COMPLEX
  2. When we find a complex, save the refdes.
  3. Dive down to o_lower_current = o_current->complex->prim_objs
  4. Loop on o_lower_current looking for OBJ_PIN
  5. When we find a pin, get pin_attribs = o_lower_current->attribs
  6. Loop on attribs looking for non-NULL text.
  7. When we find a non-NULL text attrib, extract the attrib name and stick it in the master pin attrib list.
    Parameters:
    obj_listpointer to list of pin attributes to be added.

Definition at line 376 of file s_sheet_data.c.

Here is the call graph for this function:

void s_sheet_data_gtksheet_to_sheetdata ( )

This fcn extracts the attribs from the gtksheet widget cells, and places them back into SHEET_DATA. This is the first step in saving out a project. Right now I just invoke s_table_gtksheet_to_table. Do I need to do anything else here?

Definition at line 468 of file s_sheet_data.c.

Here is the call graph for this function:

STRING_LIST* s_string_list_new ( )

Returns a pointer to a new STRING_LIST struct. This list is empty.

Returns:
pointer to the new STRING_LIST struct.

Definition at line 64 of file s_string_list.c.

STRING_LIST* s_string_list_duplicate_string_list ( STRING_LIST old_string_list)

Given a STRING_LIST, duplicate it and returns a pointer to the new, duplicate list.

Parameters:
old_string_listpointer to the STRING_LIST to be duplicated
Returns:
a pointer to the duplicate STRING_LIST

Definition at line 85 of file s_string_list.c.

Here is the call graph for this function:

void s_string_list_add_item ( STRING_LIST list,
int *  count,
char *  item 
)

Inserts the item into a STRING_LIST. It first passes through the list to make sure that there are no duplications.

Parameters:
listpointer to STRING_LIST to be added to.
countFIXME Don't know what this does - input or output? both?
itempointer to string to be added

Definition at line 119 of file s_string_list.c.

void s_string_list_delete_item ( STRING_LIST **  list,
int *  count,
char *  item 
)
int s_string_list_in_list ( STRING_LIST list,
char *  item 
)

Look for item in the list.

Parameters:
listpointer to the STRING_LIST struct
itemstring to search for
Returns:
0 if absent, 1 if present

Definition at line 269 of file s_string_list.c.

gchar* s_string_list_get_data_at_index ( STRING_LIST list,
gint  index 
)

Returns the index'th item in the string list.

Parameters:
listpointer to STRING_LIST to get from
indexindex of item to return
Returns:
NULL if there is a problem otherwise a pointer to the string.

Definition at line 348 of file s_string_list.c.

void s_string_list_sort_master_comp_list ( )

Takes the master comp list sheet_head->master_comp_list_head and sorts it in this order: <all refdeses="" in="" alphabetical="" order>=""> Right now it does nothing other than fill in the "position" and "length" variables.

Definition at line 381 of file s_string_list.c.

Here is the call graph for this function:

void s_string_list_sort_master_comp_attrib_list ( )

Take the master comp attrib list sheet_head->master_comp_attrib_list_head and sort it in this order: <all refdeses="" in="" alphabetical="" order>=""> Right now it does nothing other than fill in the "position" and "length" variables.

Definition at line 439 of file s_string_list.c.

Here is the call graph for this function:

void s_string_list_sort_master_net_list ( )

This fcn takes the master net list sheet_head->master_net_list_head and sorts it in this order: <all nets="" in="" alphabetical="" order>="">

Definition at line 485 of file s_string_list.c.

void s_string_list_sort_master_net_attrib_list ( )

Take the master net attribute list sheet_head->master_net_attrib_list_head and sort it in this order: value, footprint, model-name, file, <all other="" attributes="" in="" alphabetical="" order>="">

Definition at line 512 of file s_string_list.c.

void s_string_list_sort_master_pin_list ( )

Take the master pin list sheet_head->master_pin_list_head and sorts it in this order: <all refdeses="" in="" alphabetical="" order>=""> Right now it does nothing other than fill in the "position" and "length" variables.

Definition at line 541 of file s_string_list.c.

Here is the call graph for this function:

void s_string_list_sort_master_pin_attrib_list ( )

Takes the master pin attrib list sheet_head->master_pin_attrib_list_head and sorts it in this order: <all pin="" attribs="" in="" alphabetical="" order>=""> Right now it does nothing other than fill in the "position" and "length" variables.

Definition at line 584 of file s_string_list.c.

TABLE** s_table_new ( int  rows,
int  cols 
)

This is the table creator. It returns a pointer to an initialized TABLE struct. As calling args, it needs the number of rows and cols to allocate. The table is a dynamically allocated 2D array of structs. To access data in a cell in the table, you reference (for example): ((sheet_data->comp_table)[i][j]).attrib_value (Parens used only for clarity. It works without parens.)

Parameters:
rowsNumber of rows required in the new table
colsNumber of columns required in the new table
Returns:
a pointer to an initialized TABLE struct.

Definition at line 68 of file s_table.c.

TABLE** s_table_resize ( TABLE **  table,
int  rows,
int  old_cols,
int  new_cols 
)

This function recreates the table with a new size. It can only increase the number of cols. You can't increase the number of rows since gattrib doesn't allow you to input new components. Decreasing the number of cols is also TBD.

Parameters:
tableTable to resize
rowsNumber of rows in the table
old_colsNumber of columns previously in the table
new_colsNumber of columns required in the table
Returns:
a pointer to the resized table
Todo:
The row and column information could be stored in the TABLE struct.

Definition at line 115 of file s_table.c.

void s_table_destroy ( TABLE **  table,
int  row_count,
int  col_count 
)

This function destroys the old table. Use it after reading in a new page to get rid of the old table before building a new one.

Parameters:
tableTable to destroy
row_countNumber of rows in table
col_countNumber of columns in table

Definition at line 153 of file s_table.c.

int s_table_get_index ( STRING_LIST local_list,
char *  local_string 
)

This function returns the index number when given a STRING_LIST and a string to match. It finds the index number by iterating through the master list.

Parameters:
local_list
local_string
Returns:
the index of the string

Definition at line 191 of file s_table.c.

STRING_LIST* s_table_create_attrib_pair ( gchar *  row_name,
TABLE **  table,
STRING_LIST row_list,
int  num_attribs 
)

This function takes a table, a row list, and a row name, and returns a list holding name=value pairs for all attribs pertainent to that particular row. If the row holds no attribs, it just returns NULL.

Parameters:
row_nameName of the row to search for
tableTable to be searched
row_listlist of rows
num_attribs
Returns:
STRING_LIST of name=value pairs

Definition at line 228 of file s_table.c.

Here is the call graph for this function:

void s_table_add_toplevel_comp_items_to_comp_table ( const GList *  obj_list)

This fcn iterates over adds all objects found on this page looking for components. When it finds a component, it finds all component attribs and sticks them in the TABLE.

Parameters:
obj_listpointer to GList containing objects on this page

Definition at line 275 of file s_table.c.

Here is the call graph for this function:

void s_table_add_toplevel_net_items_to_net_table ( const GList *  obj_list)
void s_table_add_toplevel_pin_items_to_pin_table ( const GList *  obj_list)

This function iterates over adds all items found on this page looking for pins. WHen it finds a pin, it gathers all pin attribs and sticks them into the pin table.

Parameters:
obj_listList of objects on page

Definition at line 482 of file s_table.c.

Here is the call graph for this function:

void s_table_gtksheet_to_all_tables ( )

This function traverses the spreadsheet, extracts the attribs from the cells, and places them back into TABLE. This is the first step in saving out a project.

Definition at line 603 of file s_table.c.

Here is the call graph for this function:

void s_table_gtksheet_to_table ( GtkSheet local_gtk_sheet,
STRING_LIST master_row_list,
STRING_LIST master_col_list,
TABLE **  local_table,
int  num_rows,
int  num_cols 
)

This function does the actual heavy lifting of looping through the spreadsheet, extracting the attribs from the cells, and placing them back into TABLE. This is the first step in saving out a project.

Parameters:
local_gtk_sheetGtkSheet to save
master_row_listSTRING_LIST of rows
master_col_listSTRING_LIST of columns
local_tableTABLE structure to fill
num_rowsNumber of rows in table
num_colsNumber of columns in table

Definition at line 678 of file s_table.c.

Here is the call graph for this function:

int s_toplevel_read_page ( TOPLEVEL *  toplevel,
char *  filename 
)

Reads in a schematic page & calls f_open, which fills out the toplevel structure.

Parameters:
toplevelTOPLEVEL structure
filenamefile to be opened
Returns:
1 on success, 0 on failure

Definition at line 64 of file s_toplevel.c.

void s_toplevel_verify_design ( TOPLEVEL *  toplevel)

This function loops through all components in the design looking for components which are placeholders.

Placeholders are inserted into the object list when no symbol file is found. If this function finds a placeholder, it warns the user.

Parameters:
toplevelpointer to the toplevel object to be verified

Definition at line 96 of file s_toplevel.c.

Here is the call graph for this function:

void s_toplevel_gtksheet_to_toplevel ( TOPLEVEL *  toplevel)

Called when the user invokes "save". It first places all data from gtksheet into SHEET_DATA. Then it loops through all pages & calls s_toplevel_sheetdata_to_toplevel() to place all stuff in SHEET_DATA into the libgeda TOPLEVEL structure.

Definition at line 135 of file s_toplevel.c.

Here is the call graph for this function:

void s_toplevel_add_new_attrib ( gchar *  new_attrib_name)

This function gets called when the user has entered a new attrib name, and clicked the OK button. It does this:

  1. It figures out which attrib/sheet is being added to
  2. It destroys the old table in preparation for the new attrib.
  3. It adds the new attrib to the master lists.
  4. It creates a new table with the new attrib.
  5. It then adds the appropriate col to the gtksheet.
    Parameters:
    new_attrib_nameattribute to be added

Definition at line 183 of file s_toplevel.c.

Here is the call graph for this function:

void s_toplevel_delete_attrib_col ( )

This function gets called when the user has selected a single attrib column, selected the edit->delete attrib item from the pull-down menu, and then said "yes" to the confirm dialog.

Definition at line 279 of file s_toplevel.c.

Here is the call graph for this function:

void s_toplevel_sheetdata_to_toplevel ( TOPLEVEL *  toplevel,
PAGE *  page 
)

This function loops through all objects on (PAGE page)->(OBJECT *start_obj). It takes the updated SHEET_DATA->TABLE data and then updates the objects with the new attribs & attrib values. For each component, it updates the attached attrib values using the updated values held in the SHEET_DATA->TABLE structure. It does so in three steps:

  1. First find and update component attribs.
  2. Then find and update net attribs.
  3. Finally find and update pin attribs.
    Parameters:
    toplevelTOPLEVEL structure
    pageschematic page to copy

Definition at line 394 of file s_toplevel.c.

Here is the call graph for this function:

STRING_LIST* s_toplevel_get_component_attribs_in_sheet ( char *  refdes)

This function returns a list of attributes attached to obj_name = comp refdes or netlist.

Parameters:
refdescomponent refdes to return values from
Returns:
a STRING_LIST where the data field holds a name=value string.

Definition at line 534 of file s_toplevel.c.

Here is the call graph for this function:

void s_toplevel_update_component_attribs_in_toplevel ( TOPLEVEL *  toplevel,
OBJECT *  o_current,
STRING_LIST new_comp_attrib_list 
)

For each attrib string attached to the component, update it using the value held in new_comp_attrib_list. Algorithm:

  1. Form list of all component attribs held on both the component (o_current), as well as in the attrib list (SHEET_DATA).
  2. Loop over name=value pairs held in complete_comp_attrib_list.
  3. For each name=value pair, look for corresponding attrib on o_current.
  4. For each name=value pair, look for the corresponding attrib in new_comp_attrib_list.
  5. If the attrib exists on o_current and in new_comp_attrib_list, write the new value (from new_comp_attrib_list) into o_current.
  6. If the attrib exists on o_current, but is null in name=value pair, delete the attrib from o_current.
  7. 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.
    Parameters:
    toplevelTOPLEVEL structure
    o_currentComponent (complex) to be updated.
    new_comp_attrib_listlist of name=value attribute pairs from SHEET_DATA.

Definition at line 623 of file s_toplevel.c.

Here is the call graph for this function:

STRING_LIST* s_toplevel_get_net_attribs_in_sheet ( char *  netname)
Todo:
Function doesn't do anything - candidate for removal?

Definition at line 832 of file s_toplevel.c.

void s_toplevel_update_net_attribs_in_toplevel ( OBJECT *  o_current,
STRING_LIST new_net_attrib_list 
)
Todo:
Function doesn't do anything - candidate for removal?

Definition at line 843 of file s_toplevel.c.

STRING_LIST* s_toplevel_get_pin_attribs_in_sheet ( char *  refdes,
OBJECT *  pin 
)

This function takes a pointer to the OBJECT pin, and returns a list of attribs found attached to the pin. The returned list is a STRING_LIST where the ->data holds a name=value string. The algorithm is as follows:

  1. Form refdes:pinnumber label for this pin.
  2. Get row number of this refdes:pinnumber
  3. Create a list of name=value pairs from entries in the pin_table on this row.
  4. Return list of name=value pairs found.
Parameters:
refdesRef des string
pinPin object
Returns:
name=value pair as a STRING_LIST

Definition at line 868 of file s_toplevel.c.

Here is the call graph for this function:

void s_toplevel_update_pin_attribs_in_toplevel ( TOPLEVEL *  toplevel,
char *  refdes,
OBJECT *  o_pin,
STRING_LIST new_pin_attrib_list 
)

For each attrib string attached to the pin, update it using the value held in new_pin_attrib_list. Algorithm:

  1. Loop over name=value pairs held in new_pin_attrib_list.
  2. For each name=value pair, look for corresponding attrib on pin.
  3. If the attrib exists on pin and in name=value pair, write the new value in.
  4. If the attrib exists on pin, but is null in name=value pair, delete the attrib.
  5. 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.
    Parameters:
    toplevelTOPLEVEL structure
    refdesUnused - needs refactored out
    [in,out]o_pinpin to update
    [in]new_pin_attrib_listNew pin attribute list to apply

Definition at line 964 of file s_toplevel.c.

Here is the call graph for this function:

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 
)

This fcn adds a new attrib to o_current, when o_current is a component. It does it in the following way:

  1. It creates an object -- "attrib_graphic" -- and fills it in.
  2. It gets the position info from o_current's refdes attrib and calls o_text_new() to add position info and name=value string to attrib_graphic.
  3. It calls o_attrib_add() to wrap attrib_graphic with (attribute OBJECT )
    Parameters:
    toplevelTOPLEVEL structure
    o_currentpointer to object to add attribute to
    new_attrib_namename of the attribute to add
    new_attrib_valuevalue of the attribute to add
    visibilityIs the attribute visible?
    show_name_valueControl visibility of name and value.

Definition at line 81 of file s_object.c.

Here is the call graph for this function:

void s_object_add_net_attrib_to_object ( TOPLEVEL *  toplevel,
OBJECT *  o_current,
char *  new_attrib_name,
char *  new_attrib_value 
)
Todo:
This needs to be filled in.

Definition at line 111 of file s_object.c.

void s_object_add_pin_attrib_to_object ( TOPLEVEL *  toplevel,
OBJECT *  o_current,
char *  new_attrib_name,
char *  new_attrib_value 
)

Add a new attribute to o_current, when o_current is a pin. It does it in the following way:

  1. It creates an object -- "attrib_graphic" -- and fills it in.
  2. It gets the position info from o_current's refdes attrib and calls o_text_new() to add position info and name=value string to attrib_graphic.
  3. It calls o_attrib_add() to wrap attrib_graphic with (attribute OBJECT )
    Parameters:
    toplevelTOPLEVEL structure
    o_currentPointer to pin object
    new_attrib_nameName of attribute to add new_attrib_value Value of attribute to add
    Todo:
    Do I really need separate fcns for comps, nets, and pins???

Definition at line 139 of file s_object.c.

Here is the call graph for this function:

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 
)

Find the instance of attrib_name on o_current, and replace its value with the new_attrib_value.

Parameters:
toplevelTOPLEVEL object
o_currentobject to operate on
new_attrib_namename of attribute to replace
new_attrib_valuevalue to set attribute to
visibilityset visibility of attribute
show_name_valueset visibility of attribute name and value

Definition at line 172 of file s_object.c.

void s_object_remove_attrib_in_object ( TOPLEVEL *  toplevel,
OBJECT *  o_current,
char *  new_attrib_name 
)

Remove an attribute from an object.

Parameters:
toplevelTOPLEVEL structure
o_currentObject to remove attribute from
new_attrib_nameName of attribute to remove

Definition at line 237 of file s_object.c.

Here is the call graph for this function:

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 *  text_object 
)

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.

Parameters:
toplevelTOPLEVEL to be operated on
test_objecttext object to be deleted

Definition at line 397 of file s_object.c.

int s_object_has_sym_file ( OBJECT *  object)

This verifies that the object has a non-null symbol file.

Returns:
0 = valid symbol file, 1 = no symbol file found.

Definition at line 413 of file s_object.c.

void s_rename_init ( void  )

Initialise the renaming data space by setting all the pair pointers to NULL.

Definition at line 75 of file s_rename.c.

void s_rename_destroy_all ( void  )

Runs through the rename pairs and calls g_free() on the non-NULL entries, then sets the entry to NULL.

Definition at line 94 of file s_rename.c.

void s_rename_next_set ( void  )

Definition at line 116 of file s_rename.c.

void s_rename_print ( void  )

Iterate through the array and print all the rename sets to stdout.

Definition at line 131 of file s_rename.c.

int s_rename_search ( char *  src,
char *  dest,
int  quiet_flag 
)

Search through the rename sets looking for src and dest. If quiet_flag is true than don't print anything.

Parameters:
srcSource to search for
destDestination to search for
quiet_flagSuppress printing if set to TRUE
Returns:
TRUE if the src is found. If the dest is found, also return true, but warn user

Definition at line 159 of file s_rename.c.

void s_rename_add ( char *  src,
char *  dest 
)

Add a source and destination to the rename pairs.

Parameters:
srcSource to add
destDestination to add

Definition at line 194 of file s_rename.c.

Here is the call graph for this function:

void s_rename_all_lowlevel ( NETLIST *  netlist_head,
char *  src,
char *  dest 
)

Definition at line 248 of file s_rename.c.

void s_rename_all ( TOPLEVEL *  toplevel,
NETLIST *  netlist_head 
)

Definition at line 282 of file s_rename.c.

Here is the call graph for this function:

void verbose_print ( char *  string)

Print the supplied message in verbose mode. Line wrap if necessary.

Identical to that defined in gnetlist/src/s_misc.c

Parameters:
stringString to be printed

Definition at line 61 of file s_misc.c.

void verbose_done ( void  )

Prints the "DONE" message in verbose mode, wrapping before printing if near the end of line.

Identical to function defined in gnetlist/src/s_misc.c

Definition at line 80 of file s_misc.c.

void verbose_reset_index ( void  )

Reset the current characted count.

Identical to function defined in gnetlist/src/s_misc.c

Definition at line 100 of file s_misc.c.

char* s_misc_remaining_string ( char *  string,
char  delimiter,
int  count 
)
void s_visibility_set_invisible ( )

Definition at line 88 of file s_visibility.c.

Here is the call graph for this function:

void s_visibility_set_name_only ( )

This sets the selected cells to NAME_ONLY. This function is invoked from the menu, it assumes you have selected a range of cells which are carried in the global variable "sheet".

Definition at line 161 of file s_visibility.c.

Here is the call graph for this function:

void s_visibility_set_value_only ( )

Definition at line 222 of file s_visibility.c.

Here is the call graph for this function:

void s_visibility_set_name_and_value ( )

Definition at line 287 of file s_visibility.c.

Here is the call graph for this function:

void s_visibility_set_cell ( gint  cur_page,
gint  row,
gint  col,
gint  visibility,
gint  show_name_value 
)

Definition at line 352 of file s_visibility.c.

void i_vars_set ( TOPLEVEL *  toplevel)

Initialize the variables in toplevel. In practice, this is only the paper size for the sheet.

Parameters:
toplevelpointer to the TOPLEVEL to set paper size in.

Definition at line 69 of file i_vars.c.

void i_window_vars_set ( TOPLEVEL *  toplevel)
void x_dialog_newattrib ( )

This asks for the name of the attrib column to insert and then inserts the column.

Definition at line 69 of file x_dialog.c.

Here is the call graph for this function:

void x_dialog_delattrib ( )

This function throws up the "Delete foo, are you sure?" dialog box. It offers two buttons: "yes" and "cancel".

Definition at line 123 of file x_dialog.c.

Here is the call graph for this function:

void x_dialog_missing_sym ( )

This is the "missing symbol file found on object" dialog.

It offers the user the chance to close the project without saving because he read a schematic with a missing symbol file.

Definition at line 173 of file x_dialog.c.

void x_dialog_unsaved_data ( )

This is the "Unsaved data -- are you sure you want to quit?" dialog box which is thrown up before the user quits.

Definition at line 215 of file x_dialog.c.

Here is the call graph for this function:

void x_dialog_unimplemented_feature ( )

This function informs the user that he has chosen an unimplemented feature. It presents only an "OK" button to leave.

Definition at line 278 of file x_dialog.c.

void x_dialog_fatal_error ( gchar *  string,
gint  return_code 
)

This function displays a dialog with the error string and terminates the program.

Parameters:
[in]stringthe error string
[in]return_codethe exit code
Todo:
Is the GPOINTER_TO_INT() call needed in exit()?

Definition at line 310 of file x_dialog.c.

void x_dialog_about_dialog ( )

This dosplays the about dialog.

Definition at line 334 of file x_dialog.c.

void x_dialog_export_file ( )

This asks for the filename for the CSV export file and then does the exporting.

Definition at line 364 of file x_dialog.c.

Here is the call graph for this function:

void x_gtksheet_init ( )

Creates and initializes the GtkSheet widget, which is the spreadsheet widget used for displaying the data.

Definition at line 71 of file x_gtksheet.c.

Here is the call graph for this function:

void x_gtksheet_add_row_labels ( GtkSheet sheet,
int  count,
STRING_LIST list_head 
)

Add row labels to GtkSheet

Parameters:
sheetPointer to the GtkSheet object
countNumber of row labels to add
list_headTop of the string list

Definition at line 166 of file x_gtksheet.c.

Here is the call graph for this function:

void x_gtksheet_add_col_labels ( GtkSheet sheet,
int  count,
STRING_LIST list_head 
)

Add column labels to GtkSheet.

Parameters:
sheetGtkSheet to add columns to
count
list_headpointer to top of STRING_LIST

Definition at line 212 of file x_gtksheet.c.

Here is the call graph for this function:

void x_gtksheet_add_cell_item ( GtkSheet sheet,
gint  i,
gint  j,
char *  text,
gint  visibility,
gint  show_name_value 
)
void x_gtksheet_set_cell_text_color ( GtkSheet sheet,
gint  row,
gint  col,
gint  color_name 
)

Sets the color of a cell identified by row, col.

Parameters:
sheetGtkSheet to operate on
rowRow of cell to set
colColumn of cell to set
color_nameColor to set text to

Definition at line 322 of file x_gtksheet.c.

Here is the call graph for this function:

int x_gtksheet_get_min_col ( GtkSheet sheet)

Get the first column selected in the GtkSheet Returns the index of the first column selected, or -1 if no column is selected.

Parameters:
sheetGtkSheet to query
Returns:
index of the first column selected, or -1 if no column is selected.

Definition at line 289 of file x_gtksheet.c.

int x_gtksheet_get_max_col ( GtkSheet sheet)

Get the last column selected in the GtkSheet

Parameters:
GtkSheetto query
Returns:
the index of the last column selected, or -1 if no column is selected.

Definition at line 305 of file x_gtksheet.c.

GSList* x_fileselect_open ( void  )

This function opens a file chooser dialog and waits for the user to select at least one file to load as toplevel's new pages.

Returns:
list of files to be opened, or NULL if the user cancelled the dialog

Definition at line 228 of file x_fileselect.c.

Here is the call graph for this function:

void x_fileselect_save ( void  )

This function opens a file chooser dialog and wait for the user to select a file where the toplevel's current page will be saved.

If the user cancels the operation (with the cancel button), the page is not saved.

The function updates the user interface.

Definition at line 274 of file x_fileselect.c.

Here is the call graph for this function:

gboolean x_fileselect_load_files ( GSList *  filenames)

Open all files specified in the list. The caller is responsible for freeing the strings and the list itself.

The function updates the user interface. At the end of the function, the toplevel's current page is set to the page of the last loaded page.

Parameters:
[in]filenameslist of files to be opened
Returns:
FALSE if any of the files could not be opened, TRUE otherwise

Definition at line 124 of file x_fileselect.c.

Here is the call graph for this function:

void x_window_init ( )

This function initializes the toplevel gtksheet stuff.

It basically just initializes the following widgets: GTK_WINDOW *window GTK_CONTAINER *main_vbox GTK_MENU

Note that it doesn't display the spreadsheet itself. This is done in x_sheet_build_sheet. I suppose I could postpone all initialization until x_sheet_build_sheet, but I figured that I could at least do some initialization here. In particular, the stuff to put up the menus is long & it is worthwhile to separate it from other code. Maybe I'll refactor this later.

Definition at line 85 of file x_window.c.

Here is the call graph for this function:

void x_window_add_items ( )

This function updates the top level window after a new page is read in.

It does the following:

  1. Create a new gtksheet having the current dimensions.
  2. Call x_gktsheet_add_row_labels(comp_count, master_*_list_head)
  3. Call x_gktsheet_add_col_labels(comp_attrib_count, master_*_attrib_list_head)
  4. Call x_gktsheet_add_row_labels(net_count, master_*_list_head)
  5. Call x_gktsheet_add_col_labels(net_attrib_count, master_*_attrib_list_head)
  6. loop on i, j -- call x_gtksheet_add_entry(i, j, attrib_value)
  7. Call gtk_widget_show(window) to show new window.

Definition at line 316 of file x_window.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines