]> granicus.if.org Git - graphviz/commit
cgraph: implement a generic stack abstraction
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 3 Feb 2022 04:37:13 +0000 (15:37 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 12 Apr 2022 00:00:42 +0000 (17:00 -0700)
commit7341ae280d0331b32fe3d1f40dc276575110d706
tree3ee1d5f473a2648a8f2f14395d7b944ab9e24c5c
parent23cbf6b3a339293af7c5b869b23ad851c2c746fe
cgraph: implement a generic stack abstraction

Similar to prior abstractions like `bitarray_t`, this is implemented header-only
so as to be usable throughout the Graphviz tree, even by code that is not
linking against cgraph.

Given this implementation is header-only, it is natural to wonder why the type
needs a `gv_` prefix. The answer is that one of the macOS system headers flouts
the rule of `__` prefixing symbols that are part of the implementation and
defines a typedef of `__darwin_sigaltstack` under the name `stack_t`. Hence this
name is not usable by us.

Gitlab: #1793, #2222
lib/cgraph/CMakeLists.txt
lib/cgraph/Makefile.am
lib/cgraph/cgraph.vcxproj
lib/cgraph/cgraph.vcxproj.filters
lib/cgraph/stack.h [new file with mode: 0644]
lib/cgraph/test_stack.c [new file with mode: 0644]
rtest/test_c_utils.py