libgeda

s_hierarchy.c File Reference

#include <config.h>
#include <stdio.h>
#include "libgeda_priv.h"
Include dependency graph for s_hierarchy.c:

Go to the source code of this file.

Functions

PAGEs_hierarchy_down_schematic_single (TOPLEVEL *toplevel, const gchar *filename, PAGE *parent, int page_control, int flag)
 Search for schematic associated source files and load them.
void s_hierarchy_down_symbol (TOPLEVEL *toplevel, const CLibSymbol *symbol, PAGE *parent)
PAGEs_hierarchy_find_up_page (GedaPageList *page_list, PAGE *current_page)
 Search for the parent page of a page in hierarchy.
GList * s_hierarchy_traversepages (TOPLEVEL *toplevel, PAGE *p_current, gint flags)
 Find page hierarchy below a page.
gint s_hierarchy_print_page (PAGE *p_current, void *data)
PAGEs_hierarchy_find_prev_page (GedaPageList *page_list, PAGE *current_page)
 Search for a page preceding a given page in hierarchy.
PAGEs_hierarchy_find_next_page (GedaPageList *page_list, PAGE *current_page)
 Search for a page following a given page in hierarchy.

Variables

static int page_control_counter = 0

Function Documentation

PAGE* s_hierarchy_down_schematic_single ( TOPLEVEL toplevel,
const gchar *  filename,
PAGE parent,
int  page_control,
int  flag 
)
Todo:
Finish function documentation!!!
Function Description
This function searches the associated source file refered by the filename and loads it. If the flag is set to HIERARCHY_NORMAL_LOAD and the page is allready in the list of pages it will return the pid of that page. If the flag is set to HIERARCHY_FORCE_LOAD then this function will load the page again with a new page id. The second case is mainly used by gnetlist where pushed down schematics MUST be unique.
Parameters:
[in]toplevelThe TOPLEVEL object.
[in]filenameSchematic file name.
[in]parentThe parent page of the schematic.
[in]page_control
[in]flag
Returns:
The page loaded, or NULL if failed.
Note:
This function goes and finds the associated source files and loads all up It only works for schematic files though this is basically push flag can either be HIERARCHY_NORMAL_LOAD or HIERARCHY_FORCE_LOAD flag is mainly used by gnetlist where pushed down schematics MUST be unique

Definition at line 63 of file s_hierarchy.c.

Here is the call graph for this function:

void s_hierarchy_down_symbol ( TOPLEVEL toplevel,
const CLibSymbol symbol,
PAGE parent 
)
Todo:
Finish function documentation!!!
Function Description

Definition at line 144 of file s_hierarchy.c.

Here is the call graph for this function:

PAGE* s_hierarchy_find_up_page ( GedaPageList page_list,
PAGE current_page 
)
Function Description
This function searches the parent page of page page in the hierarchy. It checks all the pages in the list page_list.

It returns a pointer on the page if found, NULL otherwise.

Note:
The page current_page must be in the list page_list.
Parameters:
[in]page_listThe list of pages in which to search.
[in]current_pageThe reference page for the search.
Returns:
A pointer on the page found or NULL if not found.

Definition at line 191 of file s_hierarchy.c.

Here is the call graph for this function:

GList* s_hierarchy_traversepages ( TOPLEVEL toplevel,
PAGE p_current,
gint  flags 
)
Function Description
This function traverses the hierarchy tree of pages and returns a flat list of pages that are below p_current. There are two flags that can be used to control the way that the return value is constructed: HIERARCHY_NODUPS returns a list without duplicate pages, and HIERARCHY_POSTORDER traverses the hierarchy tree and returns a postorder list instead of preorder.
Parameters:
toplevelThe TOPLEVEL structure.
p_currentThe PAGE to traverse hierarchy for.
flagsFlags controlling form of return value.
Returns:
A GList of PAGE pointers.
Warning:
Caller must destroy returned GList with g_list_free().

Definition at line 219 of file s_hierarchy.c.

Here is the call graph for this function:

gint s_hierarchy_print_page ( PAGE p_current,
void *  data 
)
Todo:
Finish function documentation!!!
Function Description
Note:
Test function which only prints the name of a page and it's number.

Definition at line 304 of file s_hierarchy.c.

PAGE* s_hierarchy_find_prev_page ( GedaPageList page_list,
PAGE current_page 
)
Function Description
This function searches the previous sibling of page page in the hierarchy. It checks all the pages preceding page in the list page_list.

It returns a pointer on the page if found, NULL otherwise.

Note:
The page current_page must be in the list page_list.
Parameters:
[in]page_listThe list of pages in which to search.
[in]current_pageThe reference page for the search.
Returns:
A pointer on the page found or NULL if not found.

Definition at line 327 of file s_hierarchy.c.

PAGE* s_hierarchy_find_next_page ( GedaPageList page_list,
PAGE current_page 
)
Function Description
This function searches the next sibling of page page in the hierarchy. It checks all the pages following page in the list page_list.

It returns a pointer on the page if found, NULL otherwise.

Note:
The page current_page must be in the list page_list.
Parameters:
[in]page_listThe list of pages in which to search.
[in]current_pageThe reference page for the search.
Returns:
A pointer on the page found or NULL if not found.

Definition at line 361 of file s_hierarchy.c.


Variable Documentation

int page_control_counter = 0 [static]

Definition at line 34 of file s_hierarchy.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines