tsort.c File Reference

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

Include dependency graph for tsort.c:

Go to the source code of this file.

Data Structures

struct  __v
struct  __e
struct  name

Defines

#define insq(x)   ((x->next = outq),(outq = x))
#define deq()   ((tmp = outq),(outq = outq->next),tmp)

Typedefs

typedef __v vertex
typedef __e edge

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (void *xmalloc,(size_t siz))
 _PROTOTYPE (edge *new_edge,(vertex *v))
 _PROTOTYPE (char *copyupto,(char *name, char *buf, int stop))
 _PROTOTYPE (int child_of,(vertex *parent, vertex *child))
 _PROTOTYPE (vertex *add_v,(char *s))
 _PROTOTYPE (void readin,(void))
 _PROTOTYPE (void pushname,(char *s))
 _PROTOTYPE (char *popname,(void))
 _PROTOTYPE (void print_cycle,(vertex *parent, vertex *child))
 _PROTOTYPE (void dfs,(vertex *v))
void * xmalloc (size_t siz)
edgenew_edge (vertex *v)
char * copyupto (char *name, char *buf, char stop)
int child_of (vertex *parent, vertex *child)
vertexadd_v (char *s)
void readin ()
void pushname (char *s)
char * popname ()
void topo ()
void print_cycle (vertex *parent, vertex *child)
void dfs (vertex *v)
void check_cycles ()
int main (int argc, char **argv)

Variables

vertexvset = NULL
namenamelist


Define Documentation

 
#define deq  )     ((tmp = outq),(outq = outq->next),tmp)
 

Referenced by topo().

#define insq x   )     ((x->next = outq),(outq = x))
 

Referenced by topo().


Typedef Documentation

typedef struct __e edge
 

typedef struct __v vertex
 


Function Documentation

_PROTOTYPE void  dfs,
(vertex *v) 
 

_PROTOTYPE void  print_cycle,
(vertex *parent, vertex *child) 
 

_PROTOTYPE char *  popname,
(void) 
 

_PROTOTYPE void  pushname,
(char *s
 

_PROTOTYPE void  readin,
(void) 
 

_PROTOTYPE vertex add_v,
(char *s
 

_PROTOTYPE int  child_of,
(vertex *parent, vertex *child) 
 

_PROTOTYPE char *  copyupto,
(char *name, char *buf, int stop) 
 

_PROTOTYPE edge new_edge,
(vertex *v) 
 

_PROTOTYPE void *  xmalloc,
(size_t siz) 
 

_PROTOTYPE int  main,
(int argc, char **argv) 
 

vertex* add_v char *  s  ) 
 

Definition at line 108 of file tsort.c.

References __v::key, __v::next, NULL, strcmp, strcpy(), strlen(), __e::v, vset, and xmalloc().

Referenced by readin().

void check_cycles  ) 
 

Definition at line 330 of file tsort.c.

References dfs(), __v::next, NULL, and vset.

Referenced by main().

int child_of vertex parent,
vertex child
 

Definition at line 91 of file tsort.c.

References e, and NULL.

Referenced by readin().

char* copyupto char *  name,
char*  buf,
char  stop
 

Definition at line 76 of file tsort.c.

References isspace.

Referenced by readin().

void dfs vertex v  ) 
 

Definition at line 299 of file tsort.c.

References e, fprintf(), NULL, print_cycle(), and stderr.

Referenced by check_cycles().

int main int  argc,
char **  argv
 

Definition at line 340 of file tsort.c.

References check_cycles(), exit(), freopen(), NULL, perror(), readin(), stdin, stdout, and topo().

edge* new_edge vertex v  ) 
 

Definition at line 64 of file tsort.c.

References __e::v, and xmalloc().

Referenced by readin().

char* popname  ) 
 

Definition at line 189 of file tsort.c.

References free, NULL, and tmp.

Referenced by topo().

void print_cycle vertex parent,
vertex child
 

Definition at line 264 of file tsort.c.

References e, NULL, pushname(), s, and x.

Referenced by dfs().

void pushname char *  s  ) 
 

Definition at line 179 of file tsort.c.

References x, and xmalloc().

Referenced by print_cycle(), and topo().

void readin  ) 
 

Definition at line 148 of file tsort.c.

References add_v(), bp, child, child_of(), copyupto(), e, fgets(), new_edge(), NULL, parent(), stdin, and strlen().

Referenced by gzscan(), main(), and readmore().

void topo  ) 
 

Definition at line 204 of file tsort.c.

References deq, e, insq, n, NULL, popname(), pushname(), puts(), tmp, vset, and x.

Referenced by main().

void* xmalloc size_t  siz  ) 
 

Definition at line 49 of file tsort.c.

References exit(), fputs(), malloc(), NULL, and stderr.


Variable Documentation

struct name * namelist
 

Referenced by command().

vertex* vset = NULL
 

Definition at line 105 of file tsort.c.

Referenced by add_v(), check_cycles(), and topo().


Generated on Fri Apr 14 23:07:47 2006 for minix by  doxygen 1.4.6