Skip to content

organize lib/cgraph files

Costa Shulyupin requested to merge makelinux/graphviz:240303+174352 into main

There are 50 source files in lib/cgraph. It's hard to comprehend so many files. Splitting the files into subgroups makes the source code much more understandable.

To split the files into the groups I've build undefined-defined dependency graph with script:

obj-deps()
{
        declare -A D
        echo 'digraph { graph [concentrate=true]; node [fontname=Ubuntu,shape=plaintext]';
        for f in "$@";do
                for d in $(nm --defined-only $f | awk '{print$3}'); do
                        D[$d]=$f
                done
        done
        for f in "$@";do
                for u in $(nm --undefined-only $f | awk '{print$2}'); do
                        [[ $D[$u] ]] && echo "\"$f\"" '->' "\"$D[$u]\""
                done
        done | sort -u
        echo '}'
}

The arrows indicate that the file is using functions defined in another file.

cgraph

Merge request reports