]> granicus.if.org Git - graphviz/commitdiff
make lib/cgraph/*.c #includes unambiguous
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 14 Aug 2020 03:38:52 +0000 (20:38 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 10 Sep 2020 02:26:50 +0000 (19:26 -0700)
Related to #1785.

23 files changed:
lib/cgraph/CMakeLists.txt
lib/cgraph/Makefile.am
lib/cgraph/agerror.c
lib/cgraph/agxbuf.c
lib/cgraph/apply.c
lib/cgraph/attr.c
lib/cgraph/cgraph.vcxproj
lib/cgraph/cmpnd.c
lib/cgraph/edge.c
lib/cgraph/flatten.c
lib/cgraph/graph.c
lib/cgraph/id.c
lib/cgraph/imap.c
lib/cgraph/io.c
lib/cgraph/mem.c
lib/cgraph/node.c
lib/cgraph/obj.c
lib/cgraph/pend.c
lib/cgraph/rec.c
lib/cgraph/refstr.c
lib/cgraph/subg.c
lib/cgraph/utils.c
lib/cgraph/write.c

index b81230b1e3a0af0eebf19965144c1fd3cf31902f..8c1d22990f2e02ee3a36826db6a3aad8fdb08b06 100644 (file)
@@ -4,12 +4,6 @@ ADD_FLEX_BISON_DEPENDENCY(Scan Grammar)
 
 add_definitions(-DEXPORT_CGRAPH -DEXPORT_AGXBUF -DEXPORT_CGHDR -DYY_NO_UNISTD_H)
 
-include_directories(
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CMAKE_CURRENT_BINARY_DIR}
-    ${GRAPHVIZ_LIB_DIR}/cdt
-)
-
 add_library(cgraph SHARED
     # Header files
     agxbuf.h
@@ -43,6 +37,13 @@ add_library(cgraph SHARED
     ${FLEX_Scan_OUTPUTS}
 )
 
+target_include_directories(cgraph PRIVATE
+    ${GRAPHVIZ_LIB_DIR}
+    ${GRAPHVIZ_LIB_DIR}/cdt
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_BINARY_DIR}
+)
+
 target_link_libraries(cgraph cdt)
 
 # Installation location of library files
index 6c01f41528bb2e964fb0c83b9d6dc03a6d9bb6d3..688498093db2a398cf9a78bc58dfd7ba2f29aa7d 100644 (file)
@@ -6,7 +6,7 @@ CGRAPH_VERSION="6:0:0"
 pdfdir = $(pkgdatadir)/doc/pdf
 pkgconfigdir = $(libdir)/pkgconfig
 
-AM_CPPFLAGS = -I$(top_srcdir)/lib/cdt
+AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/lib/cdt
 
 pkginclude_HEADERS = cgraph.h strcasecmp.h
 noinst_HEADERS = agxbuf.h cghdr.h
index d458f8f726855c23bf4151cfe45199113ad454d7..865e3919827ea6e869122d0ca8c8cb12b9eecb6c 100644 (file)
@@ -12,7 +12,7 @@
  *************************************************************************/
 
 #include <stdio.h>
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 #define MAX(a,b)       ((a)>(b)?(a):(b))
 static agerrlevel_t agerrno;           /* Last error level */
index 6c5bfeecbc70caf2b46c191c4df6c82fd7122369..3f2c809a6b3d684001c10d04d0b3dfdf1fb863d9 100644 (file)
@@ -15,7 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <agxbuf.h>
+#include <cgraph/agxbuf.h>
 
 #define N_GNEW(n,t)     (t*)calloc((n),sizeof(t))
 
index 467c57b0a71d5bc7397e59dc17fd44b21a099593..923089ec7e08b15cb9cbf341ed13c54ea41e520b 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include       <cghdr.h>
+#include       <cgraph/cghdr.h>
 
 /* The following functions take a graph and a template (node/edge/graph)
  * and return the object representing the template within the local graph.
index a223ac1cd67a0f8acbc2e8728cefa22d5453ea06..9211a0034ad4b5cd56c3f3a6faa47fa034a09dc8 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include       <cghdr.h>
+#include       <cgraph/cghdr.h>
 
 /*
  * dynamic attributes
index fff37f5f879bc793ba364b47b9ca8a1c6b16144c..35455dbdc51120dc66016195276bcda4d0411795 100644 (file)
@@ -51,7 +51,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib\cdt</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib;$(SolutionDir)lib\cdt</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>EXPORT_CGRAPH;EXPORT_AGXBUF;EXPORT_CGHDR;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -76,7 +76,7 @@ win_flex -oscan.c scan.l</Command>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib\cdt</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib;$(SolutionDir)lib\cdt</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>EXPORT_CGRAPH;EXPORT_AGXBUF;EXPORT_CGHDR;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PrecompiledHeader />
       <WarningLevel>Level4</WarningLevel>
index ab75fb11e31d92b3ac67a4b8116ad0c02152d7c6..bebcae8e597530838811f5db0d4de5a2fdc9e613 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 /*
  * provides "compound nodes" on top of base Libgraph.
index c0c1af4b844c6104b558a085a25ce9507b555c07..91ac5ffc3f5001aefba2c171a81eca078bdc5ae3 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 #define IN_SET FALSE
 #define OUT_SET TRUE
index 7e14772eb16aca3ef3ba0ccd21705e9d402f4b15..0928be8b81b00903430c9dfd3298809609f596aa 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include "cghdr.h"
+#include <cgraph/cghdr.h>
 
 static void agflatten_elist(Dict_t * d, Dtlink_t ** lptr, int flag)
 {
index 0d9dbac378c38691f79d7be05b3f3de1ed451a41..dde4e35f5505f343f65dc4ecab8ea074084b0a04 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 Agraph_t *Ag_G_global;
 
index bef71a16e2c694f3fe2c5405d0d2d76a2144ff8d..9146177ee2b3b10e5c88a0cae14ea40e145614a4 100644 (file)
@@ -12,7 +12,7 @@
  *************************************************************************/
 
 #include <stdio.h>
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 /* a default ID allocator that works off the shared string lib */
 
index 7b006e1fb67ececd32bef8de7e0e38cdd53e61e3..6ba271c65b498d9d96dc9c5f9d12c725fa6d3fc0 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 typedef struct IMapEntry_s {
     Dtlink_t namedict_link;
index 544e76948b99550a6416c3886a874b97594918bf..1080a029208684715a96675733224bfee3c5c357 100644 (file)
@@ -12,7 +12,7 @@
  *************************************************************************/
 
 #include <stdio.h>
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 #if defined(_WIN32)
 #include <io.h>
 #endif
index 62542c778b2356477d95a2857a79ace33c7a3fee..765bb5832b58478d45771f8366537cad53de943c 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 /* memory management discipline and entry points */
 static void *memopen(Agdisc_t* disc)
index 3fc3a5da3de3995d730f1eb7bd27ed078b8079ce..35e99b505d24692af678b39d2f59fddb0e4ef5aa 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 Agnode_t *agfindnode_by_id(Agraph_t * g, IDTYPE id)
 {
index 709774e3db42e9069d17b90f855390b19ae8beb2..430c7482ce07b35f0642beba82a3d33f2692268e 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 int agdelete(Agraph_t * g, void *obj)
 {
index ac91938f9c51847ac99cf1d51cbb81097dc418f5..cb8c311b901769ccd25b6b1920ad921d4ad7731b 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 static char DRName[] = "_AG_pending";
 
index c0839da5d707769333ba28f516604ecc792c74b6..faef776a874557bd6acc03b0a08f3c60d9d4fa5f 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include       <cghdr.h>
+#include       <cgraph/cghdr.h>
 
 /*
  * run time records
index 0aaa7032464b28af2905d000c86146cf90759a9e..8c52b4742eaadfb520e909844b0fcb4650d60ff7 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 /*
  * reference counted strings.
index 0e9acb18c90c811a87fadbce3b830a0221b31acf..3fb06bde80cab53b3506b326a419fcb987a85242 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 static Agraph_t *agfindsubg_by_id(Agraph_t * g, IDTYPE id)
 {
index bdfa84efc3f486e50f053ebb21a3eeaf45fb3c7b..245d6b8197d20144067ad5442a4c2195d33d720b 100644 (file)
@@ -11,7 +11,7 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
-#include <cghdr.h>
+#include <cgraph/cghdr.h>
 
 static Agraph_t *Ag_dictop_G;
 
index 5b00304beae86930c424d996c61765d4b6a515fe..e3d45cf3c9b686a59859defcf82af23eed051da0 100644 (file)
@@ -13,8 +13,8 @@
 
 #include <stdio.h>             /* need sprintf() */
 #include <ctype.h>
-#include "cghdr.h"
-#include "strcasecmp.h"
+#include <cgraph/cghdr.h>
+#include <cgraph/strcasecmp.h>
 
 #define EMPTY(s)               ((s == 0) || (s)[0] == '\0')
 #define MAX(a,b)     ((a)>(b)?(a):(b))