gattrib

s_string_list.c File Reference

Functions involved in manipulating the STRING_LIST structure. More...

#include <config.h>
#include <stdio.h>
#include <math.h>
#include <libgeda/libgeda.h>
#include "../include/struct.h"
#include "../include/prototype.h"
#include "../include/globals.h"
Include dependency graph for s_string_list.c:

Go to the source code of this file.

Defines

#define NUM_CERTAINS   (sizeof(certain_attribs)/sizeof(certain_attribs[0]))
#define DEFAULT_ATTRIB_POS   100

Functions

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, gchar *item)
 Delete an item from a STRING_LIST.
int s_string_list_in_list (STRING_LIST *list, char *item)
 Detect item in list.
gint s_string_list_find_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.

Variables

struct {
   const char *   attrib
   int   pos
certain_attribs []

Detailed Description

This file holds functions involved in manipulating the STRING_LIST structure. STRING_LIST is basically a linked list of strings (text).

Todo:
This could be implemented using an underlying GList structure. The count parameter could also be eliminated - either store it in the struct or preferably, calculate it when needed - I don't think the speed penalty of traversing the list is significant at all. GDE

Definition in file s_string_list.c.


Define Documentation

#define NUM_CERTAINS   (sizeof(certain_attribs)/sizeof(certain_attribs[0]))

Definition at line 426 of file s_string_list.c.

#define DEFAULT_ATTRIB_POS   100

Definition at line 427 of file s_string_list.c.


Function Documentation

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,
gchar *  item 
)

Deletes an item in a STRING_LIST.

Parameters:
listpointer to STRING_LIST
countpointer to count of items in list
itemitem to remove from list

Definition at line 182 of file s_string_list.c.

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.

gint s_string_list_find_in_list ( STRING_LIST list,
char *  item 
)

Look for item in the list, and return the index (-1 if absent). Intended to be a more useful variant of s_string_list_in_list.

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

Definition at line 309 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.


Variable Documentation

const char* attrib

Definition at line 418 of file s_string_list.c.

int pos

Definition at line 419 of file s_string_list.c.

struct { ... } certain_attribs[] [static]
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines