#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/statfs.h>
#include <sys/stat.h>
#include <errno.h>
Classes | |
struct | nl |
A NODELIST is a linked list of (node, id) pairs where the node is a string associated with the node, and is an integer identifier. More... | |
struct | el |
An EDGELIST is a linked list of (src,tgt) pairs where the src is a string associated with a file entry and tgt is a string associated with another file entry. More... | |
Typedefs | |
typedef nl | NODELIST |
A NODELIST is a linked list of (node, id) pairs where the node is a string associated with the node, and is an integer identifier. | |
typedef nl * | NODELIST_PTR |
A NODELIST is a linked list of (node, id) pairs where the node is a string associated with the node, and is an integer identifier. | |
typedef el | EDGELIST |
An EDGELIST is a linked list of (src,tgt) pairs where the src is a string associated with a file entry and tgt is a string associated with another file entry. | |
typedef el * | EDGELIST_PTR |
An EDGELIST is a linked list of (src,tgt) pairs where the src is a string associated with a file entry and tgt is a string associated with another file entry. | |
Functions | |
NODELIST_PTR | findVertex (char *n) |
Locate a vertex by name or return NULL if not found. | |
void | recordNode (char *n) |
Record the following string as a vertex. | |
void | recordEdge (char *u, char *v) |
Edges are always added anew. | |
void | process (int level, char *file) |
Process the given directory 'level' levels. | |
int | main (int argc, char **argv) |
Application that loads up the file system, starting from '/' and creates a graph based upon the top 5 levels found. | |
Variables | |
NODELIST_PTR | headVertex = NULL |
The headVertex of a list containing all visited files. | |
EDGELIST_PTR | headEdge = NULL |
The headEdge of a list containing all known edges. | |
static int | numVertices = 0 |
Number of vertices discovered. | |
static int | numEdges = 0 |
Number of edges discovered. |
An EDGELIST is a linked list of (src,tgt) pairs where the src is a string associated with a file entry and tgt is a string associated with another file entry.
The edge could either be containment or a symbolic link.
typedef struct el * EDGELIST_PTR |
An EDGELIST is a linked list of (src,tgt) pairs where the src is a string associated with a file entry and tgt is a string associated with another file entry.
The edge could either be containment or a symbolic link.
A NODELIST is a linked list of (node, id) pairs where the node is a string associated with the node, and is an integer identifier.
typedef struct nl * NODELIST_PTR |
A NODELIST is a linked list of (node, id) pairs where the node is a string associated with the node, and is an integer identifier.
NODELIST_PTR findVertex | ( | char * | n | ) |
Locate a vertex by name or return NULL if not found.
n | desired vertex |
int main | ( | int | argc, | |
char ** | argv | |||
) |
Application that loads up the file system, starting from '/' and creates a graph based upon the top 5 levels found.
void process | ( | int | level, | |
char * | file | |||
) |
Process the given directory 'level' levels.
level | number of levels to probe | |
file | the top-level directory into which to probe. |
void recordEdge | ( | char * | u, | |
char * | v | |||
) |
Edges are always added anew.
void recordNode | ( | char * | n | ) |
Record the following string as a vertex.
Checks first to see if it has already been discovered, otherwise it is added anew to the headVertex list.
n | the string identifier to be recorded (and searched for). |
EDGELIST_PTR headEdge = NULL |
The headEdge of a list containing all known edges.
NODELIST_PTR headVertex = NULL |
The headVertex of a list containing all visited files.
int numEdges = 0 [static] |
Number of edges discovered.
int numVertices = 0 [static] |
Number of vertices discovered.
Algorithm Development Kit 1.0