Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

graph.h File Reference

Graph functions. More...

Go to the source code of this file.

Data Structures

struct  _PmEdge
 An edge in a graph. More...

struct  _PmVertice
 A vertice in a graph. More...

struct  PmGraph
 A graph, containing vertices and edges. More...


Typedefs

typedef _PmEdge PmEdge
 Graph edge.

typedef _PmVertice PmVertice
 Graph vertice.


Functions

PmGraphpmNewGraph (void)
 Creates a new graph.

void pmDestroyGraph (PmGraph *graph)
 Destroys a graph and all associated vertices and edges.

PmVerticepmNewVertice (void *data)
 Creates a new vertice.

void pmDestroyVertice (PmVertice *vertice)
 Destroys a vertice.

PmEdgepmNewEdge (PmVertice *target)
 Creates a new edge.

void pmDestroyEdge (PmEdge *edge)
 Destroys an edge.

PmVerticepmAddVertice (PmGraph *graph, void *data)
 Adds a vertice to the graph with the specified data.

PmEdgepmAddEdge (PmVertice *parent, PmVertice *target)
 Adds an edge to the graph with the specified vertice as a target.

PmGraphpmBuildDepGraph (PmBatch *batch)
 Builds a dependency graph from the specified batch of packages.

void pmTSortPackages (PmGraph *graph, PmBatch *batch)
 Performs a topological sort on a graph containing packages.


Detailed Description

Graph functions.

Id:
graph.h,v 1.4 2002/03/20 07:05:01 chipx86 Exp
Copyright:
(C) 1999-2002 The GNUpdate Project.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


Typedef Documentation

typedef struct _PmEdge PmEdge
 

Graph edge.

typedef struct _PmVertice PmVertice
 

Graph vertice.


Function Documentation

PmEdge* pmAddEdge PmVertice   parent,
PmVertice   target
 

Adds an edge to the graph with the specified vertice as a target.

Parameters:
parent  The parent vertice.
target  The target vertice.
Returns:
The newly added edge.
See also:
pmAddVertice() , pmNewEdge() , pmDestroyEdge()

PmVertice* pmAddVertice PmGraph   graph,
void *    data
 

Adds a vertice to the graph with the specified data.

Parameters:
graph  The graph to add to.
data  The data to add.
Returns:
The newly added vertice.
See also:
pmAddEdge() , pmNewVertice() , pmDestroyVertice()

PmGraph* pmBuildDepGraph PmBatch   batch
 

Builds a dependency graph from the specified batch of packages.

Parameters:
batch  The batch of packages.
Returns:
The graph of dependencies.
See also:
pmNewGraph() , pmDestroyGraph() , pmTSortPackages()

void pmDestroyEdge PmEdge   edge
 

Destroys an edge.

Parameters:
edge  The edge to destroy.
See also:
pmNewEdge()

void pmDestroyGraph PmGraph   graph
 

Destroys a graph and all associated vertices and edges.

The data stored inside verticies will not be deleted.

Parameters:
graph  The graph to destroy.
See also:
pmNewGraph()

void pmDestroyVertice PmVertice   vertice
 

Destroys a vertice.

This will not destroy the data inside the vertice.

Parameters:
vertice  The vertice to destroy.
See also:
pmNewVertice()

PmEdge* pmNewEdge PmVertice   target
 

Creates a new edge.

Parameters:
target  The vertice being pointed to.
Returns:
The new edge.
See also:
pmDestroyEdge()

PmGraph* pmNewGraph void   
 

Creates a new graph.

Returns:
A PmGraph structure.
See also:
pmDestroyGraph()

PmVertice* pmNewVertice void *    data
 

Creates a new vertice.

Parameters:
data  The data to store in the vertice.
Returns:
The new vertice.
See also:
pmDestroyVertice()

void pmTSortPackages PmGraph   graph,
PmBatch   batch
 

Performs a topological sort on a graph containing packages.

Parameters:
graph  The graph to perform the sort on.
batch  The batch to put the packages in.
See also:
pmBuildDepGraph()


Generated on Tue Jul 2 03:15:24 2002 for libpackman by doxygen1.2.15-20020430