diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3 | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3')
5 files changed, 1402 insertions, 0 deletions
diff --git a/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/cdt.3 b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/cdt.3 new file mode 100644 index 0000000..01cb2e0 --- /dev/null +++ b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/cdt.3 @@ -0,0 +1,483 @@ +.TH LIBCDT 3 +.SH NAME +\fBCdt\fR \- container data types +.SH SYNOPSIS +.de Tp +.fl +.ne 2 +.TP +.. +.de Ss +.fl +.ne 2 +.SS "\\$1" +.. +.de Cs +.nf +.ft 5 +.. +.de Ce +.ft 1 +.fi +.. +.ta 1.0i 2.0i 3.0i 4.0i 5.0i +.Cs +#include <graphviz/cdt.h> +.Ce +.Ss "DICTIONARY TYPES" +.Cs +Void_t*; +Dt_t; +Dtdisc_t; +Dtmethod_t; +Dtlink_t; +Dtstat_t; +.Ce +.Ss "DICTIONARY CONTROL" +.Cs +Dt_t* dtopen(Dtdisc_t* disc, Dtmethod_t* meth); +int dtclose(Dt_t* dt); +void dtclear(dt); +Dtmethod_t* dtmethod(Dt_t* dt, Dtmethod_t* meth); +Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type); +Dt_t* dtview(Dt_t* dt, Dt_t* view); +.Ce +.Ss "STORAGE METHODS" +.Cs +Dtmethod_t* Dtset; +Dtmethod_t* Dtbag; +Dtmethod_t* Dtoset; +Dtmethod_t* Dtobag; +Dtmethod_t* Dtlist; +Dtmethod_t* Dtstack; +Dtmethod_t* Dtqueue; +.Ce +.Ss "DISCIPLINE" +.Cs +typedef Void_t* (*Dtmake_f)(Dt_t*, Void_t*, Dtdisc_t*); +typedef void (*Dtfree_f)(Dt_t*, Void_t*, Dtdisc_t*); +typedef int (*Dtcompar_f)(Dt_t*, Void_t*, Void_t*, Dtdisc_t*); +typedef unsigned int (*Dthash_f)(Dt_t*, Void_t*, Dtdisc_t*); +typedef Void_t* (*Dtmemory_f)(Dt_t*, Void_t*, size_t, Dtdisc_t*); +typedef int (*Dtevent_f)(Dt_t*, int, Void_t*, Dtdisc_t*); +.Ce +.Ss "OBJECT OPERATIONS" +.Cs +Void_t* dtinsert(Dt_t* dt, Void_t* obj); +Void_t* dtdelete(Dt_t* dt, Void_t* obj); +Void_t* dtsearch(Dt_t* dt, Void_t* obj); +Void_t* dtmatch(Dt_t* dt, Void_t* key); +Void_t* dtfirst(Dt_t* dt); +Void_t* dtnext(Dt_t* dt, Void_t* obj); +Void_t* dtlast(Dt_t* dt); +Void_t* dtprev(Dt_t* dt, Void_t* obj); +Void_t* dtfinger(Dt_t* dt); +Void_t* dtrenew(Dt_t* dt, Void_t* obj); +int dtwalk(Dt_t* dt, int (*userf)(Dt_t*, Void_t*, Void_t*), Void_t*); +Dtlink_t* dtflatten(Dt_t* dt); +Dtlink_t* dtlink(Dt_t*, Dtlink_t* link); +Void_t* dtobj(Dt_t* dt, Dtlink_t* link); +Dtlink_t* dtextract(Dt_t* dt); +int dtrestore(Dt_t* dt, Dtlink_t* link); +.Ce +.Ss "DICTIONARY STATUS" +.Cs +Dt_t* dtvnext(Dt_t* dt); +int dtvcount(Dt_t* dt); +Dt_t* dtvhere(Dt_t* dt); +int dtsize(Dt_t* dt); +int dtstat(Dt_t* dt, Dtstat_t*, int all); +.Ce +.Ss "HASH FUNCTIONS" +.Cs +unsigned int dtstrhash(unsigned int h, char* str, int n); +unsigned int dtcharhash(unsigned int h, unsigned char c); +.Ce +.SH DESCRIPTION +.PP +\fICdt\fP manages run-time dictionaries using standard container data types: +unordered set/multiset, ordered set/multiset, list, stack, and queue. +.PP +.Ss "DICTIONARY TYPES" +.PP +.Ss " Void_t*" +This type is used to pass objects between \fICdt\fP and application code. +\f5Void_t\fP is defined as \f5void\fP for ANSI-C and C++ +and \f5char\fP for other compilation environments. +.PP +.Ss " Dt_t" +This is the type of a dictionary handle. +.PP +.Ss " Dtdisc_t" +This defines the type of a discipline structure which describes +object lay-out and manipulation functions. +.PP +.Ss " Dtmethod_t" +This defines the type of a container method. +.PP +.Ss " Dtlink_t" +This is the type of a dictionary object holder (see \f5dtdisc()\fP.) +.PP +.Ss " Dtstat_t" +This is the type of a structure to return dictionary statistics (see \f5dtstat()\fP.) +.PP +.Ss "DICTIONARY CONTROL" +.PP +.Ss " Dt_t* dtopen(Dtdisc_t* disc, Dtmethod_t* meth)" +This creates a new dictionary. +\f5disc\fP is a discipline structure to describe object format. +\f5meth\fP specifies a manipulation method. +\f5dtopen()\fP returns the new dictionary or \f5NULL\fP on error. +.PP +.Ss " int dtclose(Dt_t* dt)" +This deletes \f5dt\fP and its objects. +Note that \f5dtclose()\fP fails if \f5dt\fP is being viewed by +some other dictionaries (see \f5dtview()\fP). +\f5dtclose()\fP returns \f50\fP on success and \f5-1\fP on error. +.PP +.Ss " void dtclear(Dt_t* dt)" +This deletes all objects in \f5dt\fP without closing \f5dt\fP. +.PP +.Ss " Dtmethod_t dtmethod(Dt_t* dt, Dtmethod_t* meth)" +If \f5meth\fP is \f5NULL\fP, \f5dtmethod()\fP returns the current method. +Otherwise, it changes the storage method of \f5dt\fP to \f5meth\fP. +Object order remains the same during a +method switch among \f5Dtlist\fP, \f5Dtstack\fP and \f5Dtqueue\fP. +Switching to and from \f5Dtset/Dtbag\fP and \f5Dtoset/Dtobag\fP may cause +objects to be rehashed, reordered, or removed as the case requires. +\f5dtmethod()\fP returns the previous method or \f5NULL\fP on error. +.PP +.Ss " Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type)" +If \f5disc\fP is \f5NULL\fP, \f5dtdisc()\fP returns the current discipline. +Otherwise, it changes the discipline of \f5dt\fP to \f5disc\fP. +Objects may be rehashed, reordered, or removed as appropriate. +\f5type\fP can be any bit combination of \f5DT_SAMECMP\fP and \f5DT_SAMEHASH\fP. +\f5DT_SAMECMP\fP means that objects will compare exactly the same as before +thus obviating the need for reordering or removing new duplicates. +\f5DT_SAMEHASH\fP means that hash values of objects remain the same +thus obviating the need to rehash. +\f5dtdisc()\fP returns the previous discipline on success +and \f5NULL\fP on error. +.PP +.Ss " Dt_t* dtview(Dt_t* dt, Dt_t* view)" +A viewpath allows a search or walk starting from a dictionary to continue to another. +\f5dtview()\fP first terminates any current view from \f5dt\fP to another dictionary. +Then, if \f5view\fP is \f5NULL\fP, \f5dtview\fP returns the terminated view dictionary. +If \f5view\fP is not \f5NULL\fP, a viewpath from \f5dt\fP to \f5view\fP is established. +\f5dtview()\fP returns \f5dt\fP on success and \f5NULL\fP on error. +.PP +If two dictionaries on the same viewpath have the same values for the discipline fields +\f5Dtdisc_t.link\fP, \f5Dtdisc_t.key\fP, \f5Dtdisc_t.size\fP, and \f5Dtdisc_t.hashf\fP, +it is expected that key hashing will be the same. +If not, undefined behaviors may result during a search or a walk. +.PP +.Ss "STORAGE METHODS" +.PP +Storage methods are of type \f5Dtmethod_t*\fP. +\fICdt\fP supports the following methods: +.PP +.Ss " Dtoset" +.Ss " Dtobag" +Objects are ordered by comparisons. +\f5Dtoset\fP keeps unique objects. +\f5Dtobag\fP allows repeatable objects. +.PP +.Ss " Dtset" +.Ss " Dtbag" +Objects are unordered. +\f5Dtset\fP keeps unique objects. +\f5Dtbag\fP allows repeatable objects and always keeps them together +(note the effect on dictionary walking.) +.PP +.Ss " Dtlist" +Objects are kept in a list. +New objects are inserted either +in front of \fIcurrent object\fP (see \f5dtfinger()\fP) if this is defined +or at list front if there is no current object. +.PP +.Ss " Dtstack" +Objects are kept in a stack, i.e., in reverse order of insertion. +Thus, the last object inserted is at stack top +and will be the first to be deleted. +.PP +.Ss " Dtqueue" +Objects are kept in a queue, i.e., in order of insertion. +Thus, the first object inserted is at queue head +and will be the first to be deleted. +.PP +.Ss "DISCIPLINE" +.PP +Object format and associated management functions are +defined in the type \f5Dtdisc_t\fP: +.Cs + typedef struct + { int key, size; + int link; + Dtmake_f makef; + Dtfree_f freef; + Dtcompar_f comparf; + Dthash_f hashf; + Dtmemory_f memoryf; + Dtevent_f eventf; + } Dtdisc_t; +.Ce +.Ss " int key, size" +Each object \f5obj\fP is identified by a key used for object comparison or hashing. +\f5key\fP should be non-negative and defines an offset into \f5obj\fP. +If \f5size\fP is negative, the key is a null-terminated +string with starting address \f5*(Void_t**)((char*)obj+key)\fP. +If \f5size\fP is zero, the key is a null-terminated string with starting address +\f5(Void_t*)((char*)obj+key)\fP. +Finally, if \f5size\fP is positive, the key is a byte array of length \f5size\fP +starting at \f5(Void_t*)((char*)obj+key)\fP. +.PP +.Ss " int link" +Let \f5obj\fP be an object to be inserted into \f5dt\fP as discussed below. +If \f5link\fP is negative, an internally allocated object holder is used +to hold \f5obj\fP. Otherwise, \f5obj\fP should have +a \f5Dtlink_t\fP structure embedded \f5link\fP bytes into it, +i.e., at address \f5(Dtlink_t*)((char*)obj+link)\fP. +.PP +.Ss " Void_t* (*makef)(Dt_t* dt, Void_t* obj, Dtdisc_t* disc)" +If \f5makef\fP is not \f5NULL\fP, +\f5dtinsert(dt,obj)\fP will call it +to make a copy of \f5obj\fP suitable for insertion into \f5dt\fP. +If \f5makef\fP is \f5NULL\fP, \f5obj\fP itself will be inserted into \f5dt\fP. +.PP +.Ss " void (*freef)(Dt_t* dt, Void_t* obj, Dtdisc_t* disc)" +If not \f5NULL\fP, +\f5freef\fP is used to destroy data associated with \f5obj\fP. +.PP +.Ss "int (*comparf)(Dt_t* dt, Void_t* key1, Void_t* key2, Dtdisc_t* disc)" +If not \f5NULL\fP, \f5comparf\fP is used to compare two keys. +Its return value should be \f5<0\fP, \f5=0\fP, or \f5>0\fP to indicate +whether \f5key1\fP is smaller, equal to, or larger than \f5key2\fP. +All three values are significant for method \f5Dtoset\fP and \f5Dtobag\fP. +For other methods, a zero value +indicates equality and a non-zero value indicates inequality. +If \f5(*comparf)()\fP is \f5NULL\fP, an internal function is used +to compare the keys as defined by the \f5Dtdisc_t.size\fP field. +.PP +.Ss " unsigned int (*hashf)(Dt_t* dt, Void_t* key, Dtdisc_t* disc)" +If not \f5NULL\fP, +\f5hashf\fP is used to compute the hash value of \f5key\fP. +It is required that keys compared equal will also have same hash values. +If \f5hashf\fP is \f5NULL\fP, an internal function is used to hash +the key as defined by the \f5Dtdisc_t.size\fP field. +.PP +.Ss " Void_t* (*memoryf)(Dt_t* dt, Void_t* addr, size_t size, Dtdisc_t* disc)" +If not \f5NULL\fP, \f5memoryf\fP is used to allocate and free memory. +When \f5addr\fP is \f5NULL\fP, a memory segment of size \f5size\fP is requested. +If \f5addr\fP is not \f5NULL\fP and \f5size\fP is zero, \f5addr\fP is to be freed. +If \f5addr\fP is not \f5NULL\fP and \f5size\fP is positive, +\f5addr\fP is to be resized to the given size. +If \f5memoryf\fP is \f5NULL\fP, \fImalloc(3)\fP is used. +When dictionaries share memory, +a record of the first allocated memory segment should be kept +so that it can be used to initialize new dictionaries (see below.) +.PP +.Ss " int (*eventf)(Dt_t* dt, int type, Void_t* data, Dtdisc_t* disc)" +If not \f5NULL\fP, \f5eventf\fP announces various events. +If it returns a negative value, the calling operation will terminate with failure. +Unless noted otherwise, a non-negative return value let the +calling function proceed normally. Following are the events: +.Tp +\f5DT_OPEN\fP: +\f5dt\fP is being opened. +If \f5eventf\fP returns zero, the opening process proceeds normally. +A positive return value indicates that \f5dt\fP +uses memory already initialized by a different dictionary. +In that case, \f5*(Void_t**)data\fP should be set to +the first allocated memory segment as discussed in \f5memoryf\fP. +\f5dtopen()\fP may fail if this segment is not returned or +if it has not been properly initialized. +.Tp +\f5DT_CLOSE\fP: +\f5dt\fP is being closed. +.Tp +\f5DT_DISC\fP: +The discipline of \f5dt\fP is being changed to a new one given in +\f5(Dtdisc_t*)data\fP. +.Tp +\f5DT_METH\fP: +The method of \f5dt\fP is being changed to a new one given in +\f5(Dtmethod_t*)data\fP. +.PP +.Ss "OBJECT OPERATIONS" +.PP +.Ss " Void_t* dtinsert(Dt_t* dt, Void_t* obj)" +This inserts an object prototyped by \f5obj\fP into \f5dt\fP. +If there is an existing object in \f5dt\fP matching \f5obj\fP +and the storage method is \f5Dtset\fP or \f5Dtoset\fP, +\f5dtinsert()\fP will simply return the matching object. +Otherwise, a new object is inserted according to the method in use. +See \f5Dtdisc_t.makef\fP for object construction. +\f5dtinsert()\fP returns the new object, a matching object as noted, +or \f5NULL\fP on error. +.PP +.Ss " Void_t* dtdelete(Dt_t* dt, Void_t* obj)" +If \f5obj\fP is not \f5NULL\fP, the first object matching it is deleted. +If \f5obj\fP is \f5NULL\fP, methods \f5Dtstack\fP and \f5Dtqueue\fP +delete respectively stack top or queue head while other methods do nothing. +See \f5Dtdisc_t.freef\fP for object destruction. +\f5dtdelete()\fP returns the deleted object (even if it was deallocated) +or \f5NULL\fP on error. +.PP +.Ss " Void_t* dtsearch(Dt_t* dt, Void_t* obj)" +.Ss " Void_t* dtmatch(Dt_t* dt, Void_t* key)" +These functions find an object matching \f5obj\fP or \f5key\fP either from \f5dt\fP or +from some dictionary accessible from \f5dt\fP via a viewpath (see \f5dtview()\fP.) +\f5dtsearch()\fP and \f5dtmatch()\fP return the matching object or +\f5NULL\fP on failure. +.PP +.Ss " Void_t* dtfirst(Dt_t* dt)" +.Ss " Void_t* dtnext(Dt_t* dt, Void_t* obj)" +\f5dtfirst()\fP returns the first object in \f5dt\fP. +\f5dtnext()\fP returns the object following \f5obj\fP. +Objects are ordered based on the storage method in use. +For \f5Dtoset\fP and \f5Dtobag\fP, objects are ordered by object comparisons. +For \f5Dtstack\fP, objects are ordered in reverse order of insertion. +For \f5Dtqueue\fP, objects are ordered in order of insertion. +For \f5Dtlist\fP, objects are ordered by list position. +For \f5Dtset\fP and \f5Dtbag\fP, +objects use some internal ordering which +may change on any search, insert, or delete operations. +Therefore, these operations should not be used +during a walk on a dictionary using either \f5Dtset\fP or \f5Dtbag\fP. +.PP +Objects in a dictionary or a viewpath can be walked using +a \f5for(;;)\fP loop as below. +Note that only one loop can be used at a time per dictionary. +Concurrent or nested loops may result in unexpected behaviors. +.Cs + for(obj = dtfirst(dt); obj; obj = dtnext(dt,obj)) +.Ce +.Ss " Void_t* dtlast(Dt_t* dt)" +.Ss " Void_t* dtprev(Dt_t* dt, Void_t* obj)" +\f5dtlast()\fP and \f5dtprev()\fP are like \f5dtfirst()\fP and \f5dtnext()\fP +but work in reverse order. +Note that dictionaries on a viewpath are still walked in order +but objects in each dictionary are walked in reverse order. +.PP +.Ss " Void_t* dtfinger(Dt_t* dt)" +This function returns the \fIcurrent object\fP of \f5dt\fP, if any. +The current object is defined after a successful call to one of +\f5dtsearch()\fP, \f5dtmatch()\fP, \f5dtinsert()\fP, +\f5dtfirst()\fP, \f5dtnext()\fP, \f5dtlast()\fP, or \f5dtprev()\fP. +As a side effect of this implementation of \fICdt\fP, +when a dictionary is based on \f5Dtoset\fP and \f5Dtobag\fP, +the current object is always defined and is the root of the tree. +.PP +.Ss " Void_t* dtrenew(Dt_t* dt, Void_t* obj)" +This function repositions and perhaps rehashes +an object \f5obj\fP after its key has been changed. +\f5dtrenew()\fP only works if \f5obj\fP is the current object (see \f5dtfinger()\fP). +.PP +.Ss " dtwalk(Dt_t* dt, int (*userf)(Dt_t*, Void_t*, Void_t*), Void_t* data)" +This function calls \f5(*userf)(walk,obj,data)\fP on each object in \f5dt\fP and +other dictionaries viewable from it. +\f5walk\fP is the dictionary containing \f5obj\fP. +If \f5userf()\fP returns a \f5<0\fP value, +\f5dtwalk()\fP terminates and returns the same value. +\f5dtwalk()\fP returns \f50\fP on completion. +.PP +.Ss " Dtlink_t* dtflatten(Dt_t* dt)" +.Ss " Dtlink_t* dtlink(Dt_t* dt, Dtlink_t* link)" +.Ss " Void_t* dtobj(Dt_t* dt, Dtlink_t* link)" +Using \f5dtfirst()/dtnext()\fP or \f5dtlast()/dtprev()\fP +to walk a single dictionary can incur significant cost due to function calls. +For efficient walking of a single directory (i.e., no viewpathing), +\f5dtflatten()\fP and \f5dtlink()\fP can be used. +Objects in \f5dt\fP are made into a linked list and walked as follows: +.Cs + for(link = dtflatten(dt); link; link = dtlink(dt,link) ) +.Ce +.PP +Note that \f5dtflatten()\fP returns a list of type \f5Dtlink_t*\fP, +not \f5Void_t*\fP. That is, it returns a dictionary holder pointer, +not a user object pointer +(although both are the same if the discipline field \f5link\fP is non-negative.) +The macro function \f5dtlink()\fP +returns the dictionary holder object following \f5link\fP. +The macro function \f5dtobj(dt,link)\fP +returns the user object associated with \f5link\fP, +Beware that the flattened object list is unflattened on any +dictionary operations other than \f5dtlink()\fP. +.PP +.Ss " Dtlink_t* dtextract(Dt_t* dt)" +.Ss " int dtrestore(Dt_t* dt, Dtlink_t* link)" +\f5dtextract()\fP extracts all objects from \f5dt\fP and makes it appear empty. +\f5dtrestore()\fP repopulates \f5dt\fP with +objects previously obtained via \f5dtextract()\fP. +\f5dtrestore()\fP will fail if \f5dt\fP is not empty. +These functions can be used +to share a same \f5dt\fP handle among many sets of objects. +They are useful to reduce dictionary overhead +in an application that creates concurrently many dictionaries. +It is important that the same discipline and method are in use at both +extraction and restoration. Otherwise, undefined behaviors may result. +.PP +.Ss "DICTIONARY INFORMATION" +.PP +.Ss " Dt_t* dtvnext(Dt_t* dt)" +This returns the dictionary that \f5dt\fP is viewing, if any. +.Ss " int dtvcount(Dt_t* dt)" +This returns the number of dictionaries that view \f5dt\fP. +.Ss " Dt_t* dtvhere(Dt_t* dt)" +This returns the dictionary \f5v\fP viewable from \f5dt\fP +where an object was found from the most recent search or walk operation. +.Ss " int dtsize(Dt_t* dt)" +This function returns the number of objects stored in \f5dt\fP. +.PP +.Ss " int dtstat(Dt_t *dt, Dtstat_t* st, int all)" +This function reports dictionary statistics. +If \f5all\fP is non-zero, all fields of \f5st\fP are filled. +Otherwise, only the \f5dt_type\fP and \f5dt_size\fP fields are filled. +It returns \f50\fP on success and \f5-1\fP on error. +.PP +\f5Dtstat_t\fP contains the below fields: +.Tp +\f5int dt_type\fP: +This is one of \f5DT_SET\fP, \f5DT_BAG\fP, \f5DT_OSET\fP, \f5DT_OBAG\fP, +\f5DT_LIST\fP, \f5DT_STACK\fP, and \f5DT_QUEUE\fP. +.Tp +\f5int dt_size\fP: +This contains the number of objects in the dictionary. +.Tp +\f5int dt_n\fP: +For \f5Dtset\fP and \f5Dtbag\fP, +this is the number of non-empty chains in the hash table. +For \f5Dtoset\fP and \f5Dtobag\fP, +this is the deepest level in the tree (counting from zero.) +Each level in the tree contains all nodes of equal distance from the root node. +\f5dt_n\fP and the below two fields are undefined for other methods. +.Tp +\f5int dt_max\fP: +For \f5Dtbag\fP and \f5Dtset\fP, this is the size of a largest chain. +For \f5Dtoset\fP and \f5Dtobag\fP, this is the size of a largest level. +.Tp +\f5int* dt_count\fP: +For \f5Dtset\fP and \f5Dtbag\fP, +this is the list of counts for chains of particular sizes. +For example, \f5dt_count[1]\fP is the number of chains of size \f51\fP. +For \f5Dtoset\fP and \f5Dtobag\fP, this is the list of sizes of the levels. +For example, \f5dt_count[1]\fP is the size of level \f51\fP. +.PP +.Ss "HASH FUNCTIONS" +.PP +.Ss " unsigned int dtcharhash(unsigned int h, char c)" +.Ss " unsigned int dtstrhash(unsigned int h, char* str, int n)" +These functions compute hash values from bytes or strings. +\f5dtcharhash()\fP computes a new hash value from byte \f5c\fP and seed value \f5h\fP. +\f5dtstrhash()\fP computes a new hash value from string \f5str\fP and seed value \f5h\fP. +If \f5n\fP is positive, \f5str\fP is a byte array of length \f5n\fP; +otherwise, \f5str\fP is a null-terminated string. +.PP +.SH IMPLEMENTATION NOTES +\f5Dtset\fP and \f5Dtbag\fP are based on hash tables with +move-to-front collision chains. +\f5Dtoset\fP and \f5Dtobag\fP are based on top-down splay trees. +\f5Dtlist\fP, \f5Dtstack\fP and \f5Dtqueue\fP are based on doubly linked list. +.PP +.SH AUTHOR +Kiem-Phong Vo, kpv@research.att.com diff --git a/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/cgraph.3 b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/cgraph.3 new file mode 100644 index 0000000..7c72459 --- /dev/null +++ b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/cgraph.3 @@ -0,0 +1,486 @@ +.de P0 +.nf +\f5 +.. +.de P1 +\fP +.fi +.. +.de Ss +.fl +.ne 2 +.SS "\\$1" +.. +.TH LIBCGRAPH 3 "30 JULY 2007" +.SH "NAME" +\fBlibcgraph\fR \- abstract graph library +.SH "SYNOPSIS" +."ta .75i 1.5i 2.25i 3i 3.75i 4.5i 5.25i 6i +.PP +.nf +.P0 +#include <graphviz/cgraph.h> +.P1 +.SS "TYPES" +.P0 +Agraph_t; +Agnode_t; +Agedge_t; +Agdesc_t; +Agdisc_t; +Agsym_t; +.P1 +.SS "GRAPHS" +.P0 +Agraph_t *agopen(char *name, Agdesc_t kind, Agdisc_t *disc); +int agclose(Agraph_t *g); +Agraph_t *agread(void *channel, Agdisc_t *); +Agraph_t *agconcat(Agraph_t *g, void *channel, Agdisc_t *disc) +int agwrite(Agraph_t *g, void *channel); +int agnnodes(Agraph_t *g),agnedges(Agraph_t *g); +void agreadline(int line_no); +void agsetfile(char *file_name); +int agisdirected(Agraph_t * g),agisundirected(Agraph_t * g),agisstrict(Agraph_t * g); +.SS "SUBGRAPHS" +.P0 +Agraph_t *agsubg(Agraph_t *g, char *name, int createflag); +Agraph_t *agidsubg(Agraph_t * g, unsigned long id, int cflag); +Agraph_t *agfstsubg(Agraph_t *g), agnxtsubg(Agraph_t *); +Agraph_t *agparent(Agraph_t *g),*agroot(Agraph_t *g); +int agdelsubg(Agraph_t * g, Agraph_t * sub); /* same as agclose() */ +.P1 +.SS "NODES" +.P0 +Agnode_t *agnode(Agraph_t *g, char *name, int createflag); +Agnode_t *agidnode(Agraph_t *g, ulong id, int createflag); +Agnode_t *agsubnode(Agraph_t *g, Agnode_t *n, int createflag); +Agnode_t *agfstnode(Agraph_t *g); +Agnode_t *agnxtnode(Agnode_t *n); +Agnode_t *agprvnode(Agnode_t *n); +Agnode_t *aglstnode(Agnode_t *n); +int agdelnode(Agraph_t *g, Agnode_t *n); +int agdegree(Agnode_t *n, int use_inedges, int use_outedges); +.P1 +.SS "EDGES" +.P0 +Agedge_t *agedge(Agnode_t *t, Agnode_t *h, char *name, int createflag); +Agedge_t *agidedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, unsigned long id, int createflag); +Agedge_t *agsubedge(Agraph_t *g, Agedge_t *e, int createflag); +Agnode_t *aghead(Agedge_t *e), *agtail(Agedge_t *e); +Agedge_t *agfstedge(Agnode_t *n); +Agedge_t *agnxtedge(Agedge_t *e, Agnode_t *n); +Agedge_t *agfstin(Agnode_t *n); +Agedge_t *agnxtin(Agedge_t *e); +Agedge_t *agfstout(Agnode_t *n); +Agedge_t *agnxtout(Agedge_t *e); +int agdeledge(Agraph_t *g, Agedge_t *e); +.SS "STRING ATTRIBUTES" +.P0 +Agsym_t *agattr(Agraph_t *g, int kind, char *name, char *value); +Agsym_t *agattrsym(void *obj, char *name); +Agsym_t *agnxtattr(Agraph_t *g, int kind, Agsym_t *attr); +char *agget(void *obj, char *name); +char *agxget(void *obj, Agsym_t *sym); +int agset(void *obj, char *name, char *value); +int agxset(void *obj, Agsym_t *sym, char *value); +int agsafeset(void *obj, char *name, char *value, char *def); +.P1 +.SS "RECORDS" +.P0 +void *agbindrec(void *obj, char *name, unsigned int size, move_to_front); +Agrec_t *aggetrec(void *obj, char *name, int move_to_front); +int agdelrec(Agraph_t *g, void *obj, char *name); +int agcopyattr(void *, void *); +void aginit(Agraph_t * g, int kind, char *rec_name, int rec_size, int move_to_front); +void agclean(Agraph_t * g, int kind, char *rec_name); +.P1 +.SS "CALLBACKS" +.P0 +Agcbdisc_t *agpopdisc(Agraph_t *g); +void agpushdisc(Agraph_t *g, Agcbdisc_t *disc); +void agmethod(Agraph_t *g, void *obj, Agcbdisc_t *disc, int initflag); +.P1 +.SS "MEMORY" +.P0 +void *agalloc(Agraph_t *g, size_t request); +void *agrealloc(Agraph_t *g, void *ptr, size_t oldsize, size_t newsize); +void agfree(Agraph_t *g, void *ptr); +.P1 +.SS "GENERIC OBJECTS" +.P0 +Agraph_t *agraphof(void*); +char *agnameof(void*); +void agdelete(Agraph_t *g, void *obj); +Agrec_t *AGDATA(void *obj); +ulong AGID(void *obj); +int AGTYPE(void *obj); +.P1 +.SH "DESCRIPTION" +Libcgraph supports graph programming by maintaining graphs in memory +and reading and writing graph files. +Graphs are composed of nodes, edges, and nested subgraphs. +These graph objects may be attributed with string name-value pairs +and programmer-defined records (see Attributes). +.PP +All of Libcgraph's global symbols have the prefix \fBag\fR (case varying). +.SH "GRAPH AND SUBGRAPHS" +.PP +A ``main'' or ``root'' graph defines a namespace for a collection of +graph objects (subgraphs, nodes, edges) and their attributes. +Objects may be named by unique strings or by 32-bit IDs. +.PP +\fBagopen\fP creates a new graph with the given name and kind. +(Graph kinds are \fBAgdirected\fP, \fBAgundirected\fP, +\fBAgstrictdirected\fP, and \fBAgstrictundirected\fP. +A strict graph cannot have multi-edges or self-arcs.) +\fBagclose\fP deletes a graph, freeing its associated storage. +\fBagread\fP, \fBagwrite\fP, and \fBagconcat\fP perform file I/O +using the graph file language described below. \fBagread\fP +constructs a new graph while \fBagconcat\fP merges the file +contents with a pre-existing graph. Though I/O methods may +be overridden, the default is that the channel argument is +a stdio FILE pointer. \fBagsetfile\fP and \fBagreadline\fP +are helper functions that simply set the current file name +and input line number for subsequent error reporting. +.PP +\fBagsubg\fP finds or creates +a subgraph by name. A new subgraph is is initially empty and +is of the same kind as its parent. Nested subgraph trees may be created. +A subgraph's name is only interpreted relative to its parent. +A program can scan subgraphs under a given graph +using \fBagfstsubg\fP and \fRagnxtsubg\fP. A subgraph is +deleted with \fBagdelsubg\fP (or \fBagclose\fP). +.PP +By default, nodes are stored in ordered sets for efficient random +access to insert, find, and delete nodes. +The edges of a node are also stored in ordered sets. +The sets are maintained internally as splay tree dictionaries +using Phong Vo's cdt library. +.PP +\fBagnnodes\fP, \fBagnedges\fP, and \fBagdegree\fP return the +sizes of node and edge sets of a graph. The \fBagdegree\fP returns +the size of the edge set of a nodes, and takes flags +to select in-edges, out-edges, or both. +.PP +An \fBAgdisc_t\fP defines callbacks to be invoked by libcgraph when +initializing, modifying, or finalizing graph objects. (Casual users can ignore +the following.) Disciplines are kept on a stack. Libcgraph automatically +calls the methods on the stack, top-down. Callbacks are installed +with \fBagpushdisc\fP, uninstalled with \fBagpopdisc\fP, and +can be held pending or released via \fBagcallbacks\fP. +.PP +(Casual users may ignore the following. +When Libcgraph is compiled with Vmalloc (which is not the default), +each graph has its own heap. +Programmers may allocate application-dependent data within the +same heap as the rest of the graph. The advantage is that +a graph can be deleted by atomically freeing its entire heap +without scanning each individual node and edge. +.SH "NODES" +A node is created by giving a unique string name or +programmer defined 32-bit ID, and is represented by a +unique internal object. (Node equality can checked +by pointer comparison.) +.PP +\fBagnode\fP searches in a graph or subgraph for a node +with the given name, and returns it if found. +If not found, if \fBcreateflag\fP is boolean true +a new node is created and returned, otherwise a nil +pointer is returned. +\fBagidnode\fP allows a programmer to specify the node +by a unique 32-bit ID. +\fBagsubnode\fP performs a similar operation on +an existing node and a subgraph. +.Pp +\fBagfstnode\fP and \fBagnxtnode\fP scan node lists. +\fBagprvnode\fP and \fPaglstnode\fP are symmetric but scan backward. +The default sequence is order of creation (object timestamp.) +\fBagdelnode\fP removes a node from a graph or subgraph. +.SH "EDGES" +.PP +An abstract edge has two endpoint nodes called tail and head +where the all outedges of the same node have it as the tail +value and similarly all inedges have it as the head. +In an undirected graph, head and tail are interchangable. +If a graph has multi-edges between the same pair of nodes, +the edge's string name behaves as a secondary key. +.Pp +\fBagedge\fP searches in a graph of subgraph for an +edge between the given endpoints (with an optional +multi-edge selector name) and returns it if found. +Otherwise, if \fBcreateflag\fP is boolean true, +a new edge is created and returned: otherwise +a nil pointer is returned. If the \fBname\fP +is \f5(char*)0\fP then an anonymous internal +value is generated. \fBagidedge\fP allows a programmer +to create an edge by giving its unique 32-bit ID. +\fBagfstin\fP, \fBagnxtint\fP, \fBagfstout\fP, and +\fBagnxtout\fP visit directed in- and out- edge lists, +and ordinarily apply only in directed graphs. +\fBagfstedge\fP and \fBagnxtedge\fP visit all edges +incident to a node. \fBagtail\fP and \fBaghead\fP +get the endpoint of an edge. +.SH "INTERNAL ATTRIBUTES" +Programmer-defined values may be dynamically +attached to graphs, subgraphs, nodes, and edges. +Such values are either uninterpreted binary records +(for implementing efficient algorithms) +or character string data (for I/O). +.SH "STRING ATTRIBUTES" +String attributes are handled automatically in reading +and writing graph files. +A string attribute is identified by name and by +an internal symbol table entry (\fBAgsym_t\fP) created by Libcgraph. +Attributes of nodes, edges, and graphs (with their subgraphs) +have separate namespaces. The contents of an \fBAgsym_t\fP +is listed below, followed by primitives to operate on string +attributes. +.P0 +typedef struct Agsym_s { /* symbol in one of the above dictionaries */ + Dtlink_t link; + char *name; /* attribute's name */ + char *defval; /* its default value for initialization */ + int id; /* its index in attr[] */ + unsigned char kind; /* referent object type */ + unsigned char fixed; /* immutable value */ +} Agsym_t; +.P1 +.PP +\fBagattr\fP creates or looks up attributes. +\fBkind\fP may be \fBAGRAPH\fP, \fBAGNODE\fP, or \fBAGEDGE\fP. +If \fBvalue\fP is \fB(char*)0)\fP, the request is to search +for an existing attribute of the given kind and name. +Otherwise, if the attribute already exists, its default +for creating new objects is set to the given value; +if it does not exist, a new attribute is created with the +given default, and the default is applied to all pre-existing +objects of the given kind. \fBagattrsym\fP is a helper function +that looks up an attribute for a graph object given as an argument. +\fBagnxtattr\P permits traversing the list of attributes of +a given type. If \fBNIL\fP is passed as an argument it gets +the first attribute, otherwise it returns the next one in +succession or returns \fBNIL\fP at the end of the list. +\fBagget\fP and \fPagset\fP allow fetching and updating a +string attribute for an object taking the attribute name as +an argument. \fBagxget\fP and \fBagxset\fP do this but with +an attribute symbol table entry as an argument (to avoid +the cost of the string lookup). \fBagsafeset\fP is a +convenience function that ensures the given attribute is +declared before setting it locally on an object. + +Note that Libcgraph performs its own storage management of strings. +The caller does not need to dynamically allocate storage. + +.SH "RECORDS" +Uninterpreted records may be attached to graphs, subgraphs, nodes, +and edges for efficient operations on values such as marks, weights, +counts, and pointers needed by algorithms. Application programmers +define the fields of these records, but they must be declared with +a common header as shown below. +.P0 +typedef struct Agrec_s { + Agrec_t header; + /* programmer-defined fields follow */ +} Agrec_t; +.P1 +Records are created and managed by Libcgraph. A programmer must +explicitly attach them to the objects in a graph, either to +individual objects one at a time via \fBagbindrec\fP, or to +all the objects of the same class in a graph via \fBaginit\fP. +The \fBname\fP argument a record distinguishes various types of records, +and is programmer defined (Libcgraph reserves the prefix \fB_ag\fR). +If size is 0, the call to \fBagbindrec\fP is simply a lookup. +\fBagdelrec\fP is the deletes records one at a time. +\fBagclean\fP does the same for all objects of the same +class in an entire graph. + +Internally, records are maintained in circular linked lists +attached to graph objects. +To allow referencing application-dependent data without function +calls or search, Libcgraph allows setting and locking the list +pointer of a graph, node, or edge on a particular record. +This pointer can be obtained with the macro \fBAGDATA(obj)\fP. +A cast, generally within a macro or inline function, +is usually applied to convert the list pointer to +an appropriate programmer-defined type. + +To control the setting of this pointer, +the \fBmove_to_front\fP flag may be \fBAG_MTF_FALSE\fP, +\fBAG_MTF_SOFT\fP, or \fBAG_MTF_HARD\fP accordingly. +The \fBAG_MTF_SOFT\fP field is only a hint that decreases +overhead in subsequent calls of \fBaggetrec\fP; +\fBAG_MTF_HARD\fP guarantees that a lock was obtained. +To release locks, use \fBAG_MTF_SOFT\fP or \fBAG_MTF_FALSE\fP. +Use of this feature implies cooperation or at least isolation +from other functions also using the move-to-front convention. + +.SH "DISCIPLINES" +(The following is not intended for casual users.) +Programmer-defined disciplines customize certain resources- +ID namespace, memory, and I/O - needed by Libcgraph. +A discipline struct (or NIL) is passed at graph creation time. +.P0 +struct Agdisc_s { /* user's discipline */ + Agmemdisc_t *mem; + Agiddisc_t *id; + Agiodisc_t *io; +} ; +.P1 +A default discipline is supplied when NIL is given for +any of these fields. + +An ID allocator discipline allows a client to control assignment +of IDs (uninterpreted 32-bit values) to objects, and possibly how +they are mapped to and from strings. + +.P0 +struct Agiddisc_s { /* object ID allocator */ + void *(*open)(Agraph_t *g); /* associated with a graph */ + int (*map)(void *state, int objtype, char *str, ulong *id, int createflag); + int (*alloc)(void *state, int objtype, ulong id); + void (*free)(void *state, int objtype, ulong id); + char *(*print)(void *state, int objtype, ulong id); + void (*close)(void *state); +} ; +.P1 + +\f5open\fP permits the ID discipline to initialize any data +structures that maintains per individual graph. +Its return value is then passed as the first argument to +all subsequent ID manager calls. + +\f5alloc\fP informs the ID manager that Libcgraph is attempting +to create an object with a specific ID that was given by a client. +The ID manager should return TRUE (nonzero) if the ID can be +allocated, or FALSE (which aborts the operation). + +\f5free\fP is called to inform the ID manager that the +object labeled with the given ID is about to go out of existence. + +\f5map\fP is called to create or look-up IDs by string name +(if supported by the ID manager). Returning TRUE (nonzero) +in all cases means that the request succeeded (with a valid +ID stored through \f5result\fP. There are four cases: +.PP +\f5name != NULL\fP and \f5createflag == 1\fP: +This requests mapping a string (e.g. a name in a graph file) into a new ID. +If the ID manager can comply, then it stores the result and returns TRUE. +It is then also responsible for being able to \f5print\fP the ID again +as a string. Otherwise the ID manager may return FALSE but it must +implement the following (at least for graph file reading and writing to work): +.PP +\f5name == NULL\fP and \f5createflag == 1\fP: +The ID manager creates a unique new ID of its own choosing. +Although it may return FALSE if it does not support anonymous objects, +but this is strongly discouraged (to support "local names" in graph files.) +.PP +\f5name != NULL\fP and \f5createflag == 0\fP: +This is a namespace probe. If the name was previously mapped into +an allocated ID by the ID manager, then the manager must return this ID. +Otherwise, the ID manager may either return FALSE, or may store +any unallocated ID into result. (This is convenient, for example, +if names are known to be digit strings that are directly converted into 32 bit values.) +.PP +\f5name == NULL\fP and \f5createflag == 0\fP: forbidden. +.PP +\f5print\fP should return +\f5print\fP is allowed to return a pointer to a static buffer; +a caller must copy its value if needed past subsequent calls. +\f5NULL\fP should be returned by ID managers that do not map names. +.PP +The \f5map\fP and \f5alloc\fP calls do not pass a pointer to the +newly allocated object. If a client needs to install object +pointers in a handle table, it can obtain them via +new object callbacks. +.P0 +struct Agiodisc_s { + int (*fread)(void *chan, char *buf, int bufsize); + int (*putstr)(void *chan, char *str); + int (*flush)(void *chan); /* sync */ + /* error messages? */ +} ; + +struct Agmemdisc_s { /* memory allocator */ + void *(*open)(void); /* independent of other resources */ + void *(*alloc)(void *state, size_t req); + void *(*resize)(void *state, void *ptr, size_t old, size_t req); + void (*free)(void *state, void *ptr); + void (*close)(void *state); +} ; +.P1 + +.SH "EXAMPLE PROGRAM" +.P0 +#include <graphviz/cgraph.h> +typedef struct mydata_s {Agrec_t hdr; int x,y,z;} mydata; + +main(int argc, char **argv) +{ + Agraph_t *g; + Agnode_t *v; + Agedge_t *e; + Agsym_t *attr; + Dict_t *d + int cnt; + mydata *p; + + if (g = agread(stdin,NIL(Agdisc_t*))) { + cnt = 0; attr = 0; + while (attr = agnxtattr(g, AGNODE, attr)) cnt++; + printf("The graph %s has %d attributes\n",agnameof(g),cnt); + + /* make the graph have a node color attribute, default is blue */ + attr = agattr(g,AGNODE,"color","blue"); + + /* create a new graph of the same kind as g */ + h = agopen("tmp",g->desc); + + /* this is a way of counting all the edges of the graph */ + cnt = 0; + for (v = agfstnode(g); v; v = agnxtnode(g,v)) + for (e = agfstout(g,v); e; e = agnxtout(g,e)) + cnt++; + + /* attach records to edges */ + for (v = agfstnode(g); v; v = agnxtnode(g,v)) + for (e = agfstout(g,v); e; e; = agnxtout(g,e)) { + p = (mydata*) agbindrec(g,e,"mydata",sizeof(mydata),TRUE); + p->x = 27; /* meaningless data access example */ + ((mydata*)(AGDATA(e)))->y = 999; /* another example */ + } + } +} +.P1 +.SH "EXAMPLE GRAPH FILES" +.P0 +digraph G { + a -> b; + c [shape=box]; + a -> c [weight=29,label="some text]; + subgraph anything { + /* the following affects only x,y,z */ + node [shape=circle]; + a; x; y -> z; y -> z; /* multiple edges */ + } +} + +strict graph H { + n0 -- n1 -- n2 -- n0; /* a cycle */ + n0 -- {a b c d}; /* a star */ + n0 -- n3; + n0 -- n3 [weight=1]; /* same edge because graph is strict */ +} +.P1 +.SH "SEE ALSO" +Libcdt(3) + +.SH "BUGS" +It is difficult to change endpoints of edges, delete string attributes or +modify edge keys. The work-around is to create a new object and copy the +contents of an old one (but new object obviously has a different ID, +internal address, and object creation timestamp). + +The API lacks convenient functions to substitute programmer-defined ordering of +nodes and edges but in principle this can be supported. +.SH "AUTHOR" +Stephen North, north@research.att.com, AT&T Research. diff --git a/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/graph.3 b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/graph.3 new file mode 100644 index 0000000..0d7ba91 --- /dev/null +++ b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/graph.3 @@ -0,0 +1,270 @@ +.TH LIBGRAPH 3 "01 MARCH 1993" +.SH NAME +\fBlibgraph\fR \- abstract graph library +.SH SYNOPSIS +.ta .75i 1.5i 2.25i 3i 3.75i 4.5i 5.25i 6i +.PP +.nf +\f5 +#include <graphviz/graph.h> +void aginit(); +Agraph_t *agread(FILE*); +int agwrite(Agraph_t*, FILE*); +int agerrors(); +Agraph_t *agopen(char *name, int kind); +void agclose(Agraph_t *g); +Agraph_t *agsubg(Agraph_t *g, char *name); +Agraph_t *agfindsubg(Agraph_t *g, char *name); +Agnode_t *agmetanode(Agraph_t *g); +Agraph_t *agusergraph(Agnode_t *metanode); +int agnnodes(Agraph_t *g), agnedges(Agraph_t *g); +.sp .i1 +int agcontains(Agraph_t *g, void *obj); +int aginsert(Agraph_t *g, void *obj); +int agdelete(Agraph_t *g, void *obj); +.sp .1i +Agnode_t *agnode(Agraph_t *g, char *name); +Agnode_t *agfindnode(Agraph_t *g, char *name); +Agnode_t *agfstnode(Agraph_t *g); +Agnode_t *agnxtnode(Agraph_t *g, Agnode_t *n); +Agnode_t *aglstnode(Agraph_t *g); +Agnode_t *agprvnode(Agraph_t *g, Agnode_t *n); +.sp .1i +Agedge_t *agedge(Agraph_t *g, Agnode_t *tail, Agnode_t *head); +Agedge_t *agfindedge(Agraph_t *g, Agnode_t *tail, Agnode_t *head); +Agedge_t *agfstedge(Agraph_t *g, Agnode_t *n); +Agedge_t *agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n); +Agedge_t *agfstin(Agraph_t *g, Agnode_t *n); +Agedge_t *agnxtin(Agraph_t *g, Agedge_t *e); +Agedge_t *agfstout(Agraph_t *g, Agnode_t *n); +Agedge_t *agnxtout(Agraph_t *g, Agedge_t *e); +.sp .1i +char *agget(void *obj, char *name); +char *agxget(void *obj, int index); +void agset(void *obj, char *name, char *value); +void agxset(void *obj, int index, char *value); +int agindex(void *obj, char *name); +.sp .1i +Agsym_t* agraphattr(Agraph_t *g,char *name,char *value); +Agsym_t* agnodeattr(Agraph_t *g,char *name,char *value); +Agsym_t* agedgeattr(Agraph_t *g,char *name,char *value); +Agsym_t* agfindattr(void *obj,char *name); +\fP +.fi +.SH DESCRIPTION +\fIlibgraph\fP maintains directed and undirected attributed graphs +in memory and reads and writes graph files. Graphs are composed of +nodes, edges, and nested subgraphs. A subgraph may contain any +nodes and edges of its parents, and may be passed to any +\fIlibgraph\fP function taking a graph pointer, except the three +that create new attributes (where a main graph is required). + +Attributes are internal or external. +Internal attributes are fields in the graph, node and edge structs +defined at compile time. +These allow efficient representation and direct access to values +such as marks, weights, and pointers for writing graph algorithms. +External attributes, on the other hand, are character strings +(name\(hyvalue pairs) dynamically allocated at runtime and accessed +through \fIlibgraph\fP calls. External attributes are used in +graph file I/O; internal attributes are not. Conversion between +internal and external attributes must be explicitly programmed. + +The subgraphs in a main graph are represented by an auxiliary directed +graph (a meta\(hygraph). Meta\(hynodes correspond to subgraphs, and meta\(hyedges +signify containment of one subgraph in another. +\f5agmetanode\fP and \f5agusergraph\fP map between +subgraphs and meta\(hynodes. The nodes and edges of the meta\(hygraph may +be traversed by the usual \fIlibgraph\fP functions for this purpose. + +.SH USE +1. Define types \f5Agraphinfo_t\fP, \f5Agnodeinfo_t\fP, +and \f5Agedgeinfo_t\fP (usually in a header file) before +including \f5<graphviz/graph.h>\fP. + +2. Call \f5aginit()\fP before any other \fIlibgraph\fP functions. +(This is a macro that calls \f5aginitlib()\fP to define the sizes +of Agraphinfo_t, Agnodeinfo_t, and Agedgeinfo_t.) + +3. Compile with \-lgraph \-lcdt. + +Except for the \fBu\fP fields, \fIlibgraph\fP +data structures must be considered read\(hyonly. +Corrupting their contents by direct updates can cause +catastrophic errors. + +.SH "GRAPHS" +.nf +\f5 +typedef struct Agraph_t { + char kind; + char *name; + Agraph_t *root; + char **attr; + graphdata_t *univ; + Dict_t *nodes,*inedges,*outedges; + proto_t *proto; + Agraphinfo_t u; +} Agraph_t; + +typedef struct graphdata_t { + Dict_t *node_dict; + attrdict_t *nodeattr, *edgeattr, *globattr; +} graphdata_t; + +typedef struct proto_t { + Agnode_t *n; + Agedge_t *e; + proto_t *prev; +} proto_t; +\fP +.fi +A graph \fIkind\fP is one of: +AGRAPH, AGRAPHSTRICT, AGDIGRAPH, or AGDIGRAPHSTRICT. +There are related macros for testing the properties of a graph: +AG_IS_DIRECTED(g) and AG_IS_STRICT(g). +Strict graphs cannot have self\(hyarcs or multi\(hyedges. +\fBattr\fP is the array of external attribute values. +\fBuniv\fP points to values shared by all subgraphs of a main graph. +\fBnodes\fP, \fBinedges\fP, and \fBoutedges\fP are sets maintained +by \fBcdt(3)\fP. Normally you don't access these dictionaries +directly, though the edge dictionaries may be re\(hyordered to support +programmer\(hydefined ordered edges (see \f5dtreorder\fP in \fIcdt(3)\fP). +\fBproto\fP is a stack of templates for node and edge initialization. +The attributes of these nodes and edges are set in the usual way (\f5agget\fP, +\f5agset\fP, etc.) to set defaults. +.PP +\f5agread\fP reads a file and returns a new graph if one +was succesfully parsed, otherwise returns NULL if +\f5EOF\fP or a syntax error was encountered. +Errors are reported on stderr and a count is returned from +\g5agerrors()\fP. +\f5write_graph\fP prints a graph on a file. +\f5agopen\fP and \f5agsubg\fP create new empty graph and subgraphs. +\f5agfindsubg\fP searches for a subgraph by name, returning NULL +when the search fails. + +.SH ALL OBJECTS +\f5agcontains\fP, \f5aginsert\fP, \f5agdelete\fP are generic functions +for nodes, edges, and graphs. \f5gcontains\fP is a predicate that tests +if an object belongs to the given graph. \f5aginsert\fP inserts an +object in a graph and \f5agdelete\fP undoes this operation. +A node or edge is destroyed (and its storage freed) at the time it +is deleted from the main graph. Likewise a subgraph is destroyed +when it is deleted from its last parent or when its last parent is deleted. + +.SH NODES +.nf +\f5 +typedef struct Agnode_t { + char *name; + Agraph_t *graph; + char **attr; + Agnodeinfo_t u; +} Agnode_t; +\fP +.fi + +\f5agnode\fP attempts to create a node. +If one with the requested name already exists, the old node +is returned unmodified. +Otherwise a new node is created, with attributed copied from g\->proto\->n. +\f5agfstnode\fP (\f5agnxtnode\fP) return the first (next) element +in the node set of a graph, respectively, or NULL. +\f5aglstnode\fP (\f5agprvnode\fP) return the last (previous) element +in the node set of a graph, respectively, or NULL. + +.SH EDGES +.nf +\f5 +typedef struct Agedge_t { + Agnode_t *head,*tail; + char **attr; + Agedgeinfo_t u; +} Agedge_t; +\fP +.fi +\f5agedge\fP creates a new edge with the attributes of g\->proto\->e +including its key if not empty. +\f5agfindedge\fP finds the first (u,v) edge in \f5g\fP. +\f5agfstedge\fP (\f5agnxtedge\fP) return the first (next) element +in the edge set of a graph, respectively, or NULL. +\f5agfstin\fP, \f5agnxtin\fP, \f5agfstout\fP, \f5agnxtout\fP +refer to in\(hy or out\(hyedge sets. +The idiomatic usage in a directed graph is: +.sp +\f5 for (e = agfstout(g,n); e; e = agnextout(g,e)) your_fun(e);\fP +.P +An edge is uniquely identified by its endpoints and its \f5key\fP +attribute (if there are multiple edges). +If the \f5key\fP of \f5g\->proto\->e\fP is empty, +new edges are assigned an internal value. +Edges also have \f5tailport\fP and \f5headport\fP values. +These have special syntax in the graph file language but are +not otherwise interpreted. +.PP +.SH ATTRIBUTES +.nf +\f5 +typedef struct attrsym_t { + char *name,*value; + int index; + unsigned char printed; +} attrsym_t; +.bp +typedef struct attrdict_t { + char *name; + Dict_t *dict; + attrsym_t **list; +} attrdict_t; +\fP +.fi +\f5agraphattr\fP, \f5agnodeattr\fP, and \f5agedgeattr\fP make new attributes. +\f5g\fP should be a main graph, or \f5NULL\fP for declarations +applying to all graphs subsequently read or created. +\f5agfindattr\fP searches for an existing attribute. +.PP +External attributes are accessed by \f5agget\fP and \f5agset\fP +These take a pointer to any graph, node, or edge, and an attribute name. +Also, each attribute has an integer index. For efficiency this index +may be passed instead of the name, by calling \f5agxget\fP and \f5agxset\fP. +The \f5printed\fP flag of an attribute may be set to 0 to skip it +when writing a graph file. +.PP +The \f5list\fP in an attribute dictionary is maintained in order of creation +and is NULL terminated. +Here is a program fragment to print node attribute names: +.nf + \f5attrsym_t *aptr; + for (i = 0; aptr = g\->univ\->nodedict\->list[i]; i++) puts(aptr\->name);\fP +.fi +.SH EXAMPLE GRAPH FILES +.nf +graph any_name { /* an undirected graph */ + a \-\- b; /* a simple edge */ + a \-\- x1 \-\- x2 \-\- x3; /* a chain of edges */ + "x3.a!" \-\- a; /* quotes protect special characters */ + b \-\- {q r s t}; /* edges that fan out */ + b [color="red",size=".5,.5"]; /* set various node attributes */ + node [color=blue]; /* set default attributes */ + b \-\- c [weight=25]; /* set edge attributes */ + subgraph sink_nodes {a b c}; /* make a subgraph */ +} + +digraph G { + size="8.5,11"; /* sets a graph attribute */ + a \-> b; /* makes a directed edge */ + chip12.pin1 \-> chip28.pin3; /* uses named node "ports" */ +} +.fi + +.SH SEE ALSO +.BR dot (1), +.BR neato (1), +.BR libdict (3) +.br +S. C. North and K. P. Vo, "Dictionary and Graph Libraries'' +1993 Winter USENIX Conference Proceedings, pp. 1\(hy11. + +.SH AUTHOR +Stephen North (north@ulysses.att.com), AT&T Bell Laboratories. diff --git a/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/gvc.3 b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/gvc.3 new file mode 100644 index 0000000..f35385f --- /dev/null +++ b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/gvc.3 @@ -0,0 +1,66 @@ +.TH LIBGVC 3 +.SH NAME +\fBlibgvc\fR \- Graphviz context library +.SH SYNOPSIS +.ta .75i 1.5i 2.25i 3i 3.75i 4.5i 5.25i 6i +.PP +.nf +\f5 +#include <graphviz/gvc.h> + +/* set up a graphviz context */ +extern GVC_t *gvNEWcontext(char **info, char *user); +extern char *gvUsername(void); + +/* set up a graphviz context \(hy alternative */ +/* (wraps the above two functions using info built into libgvc) */ +extern GVC_t *gvContext(void); + +/* parse command line args \(hy minimally argv[0] sets layout engine */ +extern int gvParseArgs(GVC_t *gvc, int argc, char **argv); +extern graph_t *gvNextInputGraph(GVC_t *gvc); + +/* Compute a layout using a specified engine */ +extern int gvLayout(GVC_t *gvc, graph_t *g, char *engine); + +/* Compute a layout using layout engine from command line args */ +extern int gvLayoutJobs(GVC_t *gvc, graph_t *g); + +/* Render layout into string attributes of the graph */ +extern void attach_attrs(graph_t *g); + +/* Parse an html string */ +extern char *agstrdup_html(char *s); +extern int aghtmlstr(char *s); + +/* Render layout in a specified format to an open FILE */ +extern int gvRender(GVC_t *gvc, graph_t *g, char *format, FILE *out); + +/* Render layout in a specified format to an open FILE */ +extern int gvRenderFilename(GVC_t *gvc, graph_t *g, char *format, char *filename); + +/* Render layout according to \-T and \-o options found by gvParseArgs */ +extern int gvRenderJobs(GVC_t *gvc, graph_t *g); + +/* Clean up layout data structures \(hy layouts are not nestable (yet) */ +extern int gvFreeLayout(GVC_t *gvc, graph_t *g); + +/* Clean up graphviz context */ +extern int gvFreeContext(GVC_t *gvc); + +\fP +.fi +.SH DESCRIPTION +\fIlibgvc\fP provides a context for applications wishing to manipulate +and render graphs. It provides a command line parsing, common rendering code, +and a plugin mechanism for renderers. + +.SH SEE ALSO +.BR dot (1), +.BR neato (1), +.BR libcdt (3) +.BR libgraph (3) +.br + +.SH AUTHOR +John Ellson (ellson@research.att.com), AT&T diff --git a/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/pathplan.3 b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/pathplan.3 new file mode 100644 index 0000000..90591b8 --- /dev/null +++ b/Master/Agile Software Development/TestApp/dist/lib/graphviz/share/man/man3/pathplan.3 @@ -0,0 +1,97 @@ +.TH LIBPATH 3 "01 APRIL 1997" +.SH NAME +\fBlibpathplan\fR \- finds and smooths shortest paths +.SH SYNOPSIS +.ta .75i 1.5i 2.25i 3i 3.75i 4.5i 5.25i 6i +.PP +.nf +\f5 +#include <graphviz/pathplan.h> + +typedef struct Pxy_t { + double x, y; +} Pxy_t; + +typedef struct Pxy_t Ppoint_t; +typedef struct Pxy_t Pvector_t; + +typedef struct Ppoly_t { + Ppoint_t *ps; + int pn; +} Ppoly_t; + +typedef Ppoly_t Ppolyline_t; + +typedef struct Pedge_t { + Ppoint_t a, b; +} Pedge_t; + +typedef struct vconfig_s vconfig_t; + +#define POLYID_NONE +#define POLYID_UNKNOWN + +\fP +.fi +.SH FUNCTIONS + +.nf +\f5 +int Pshortestpath(Ppoly_t *boundary, Ppoint_t endpoints[2], Ppolyline_t *output_route); +\fP +.fi +Finds a shortest path between two points in a simple polygon. +You pass endpoints interior to the polygon boundary. +A shortest path connecting the points that remains in the polygon +is returned in output_route. If either endpoint does not lie in +the polygon, an error code is returned. (what code!!) + +.nf +\f5 +vconfig_t *Pobsopen(Ppoly_t **obstacles, int n_obstacles); +.br +int Pobspath(vconfig_t *config, Ppoint_t p0, int poly0, Ppoint_t p1, int poly1, Ppolyline_t *output_route); +.br +void Pobsclose(vconfig_t *config); +\fP +.fi +These functions find a shortest path between two points in a +simple polygon that possibly contains polygonal obstacles (holes). +\f5Pobsopen\fP creates a configuration (an opaque struct of type +\f5vconfig_t\fP) on a set of obstacles. \f5Pobspath\fP finds +a shortest path between the endpoints that remains outside the +obstacles. If the endpoints are known to lie inside obstacles, +\f5poly0\fP or \f5poly1\fP should be set to the index in the +\f5obstacles\fP array. If an endpoint is definitely not inside +an obstacle, then \f5POLYID_NONE\fP should be passed. If the +caller has not checked, then \f5POLYID_UNKNOWN\fP should be passed, +and the path library will perform the test. + +(!! there is no boundary polygon in this model?!!!) + +.nf +\f5 +int Proutespline (Pedge_t *barriers, int n_barriers, Ppolyline_t input_route, Pvector_t endpoint_slopes[2], + Ppolyline_t *output_route); +\fP +.fi + +This function fits a Bezier curve to a polyline path. +The curve must avoid a set of barrier segments. The polyline +is usually the \f5output_route\fP of one of the shortest path +finders, but it can be any simple path that doesn't cross +any obstacles. The input also includes endpoint slopes and +0,0 means unconstrained slope. + +Finally, this utility function converts an input list of polygons +into an output list of barrier segments: +.nf +\f5 +int Ppolybarriers(Ppoly_t **polys, int n_polys, Pedge_t **barriers, int *n_barriers); +\fP +.fi + +.SH AUTHORS +David Dobkin (dpd@cs.princeton.edu), +Eleftherios Koutsofios (ek@research.att.com), +Emden Gansner (erg@research.att.com). |
