|
1 | | -#ifndef GRAPH_H |
2 | | -#define GRAPH_H |
| 1 | +#ifndef HELPERSTUB_GRAPH_H |
| 2 | +#define HELPERSTUB_GRAPH_H |
3 | 3 |
|
4 | 4 | /* |
5 | 5 | Copyright (c) 1997-2025, John M. Boyer |
6 | 6 | All rights reserved. |
7 | 7 | See the LICENSE.TXT file for licensing information. |
8 | 8 | */ |
9 | 9 |
|
| 10 | +// NOTE: This helper stub has been added for backwards compatibility to |
| 11 | +// support downstream consumers who expect graph.h to be at the |
| 12 | +// root of the installed planarity headers directory. Future downstream |
| 13 | +// consumers are advised to include the graphLib.h helper stub instead |
| 14 | +// because it offers access to all features in the graph library of |
| 15 | +// the planarity project. |
| 16 | + |
10 | 17 | #ifdef __cplusplus |
11 | 18 | extern "C" |
12 | 19 | { |
13 | 20 | #endif |
14 | 21 |
|
15 | | -#include "graphStructures.h" |
16 | | - |
17 | | -#include "io/g6-read-iterator.h" |
18 | | -#include "io/g6-write-iterator.h" |
19 | | -#include "io/strbuf.h" |
20 | | -#include "io/strOrFile.h" |
21 | | - |
22 | | -#include "extensionSystem/graphExtensions.h" |
23 | | - |
24 | | - /////////////////////////////////////////////////////////////////////////////// |
25 | | - // Definitions for higher-order operations at the vertex, edge and graph levels |
26 | | - /////////////////////////////////////////////////////////////////////////////// |
27 | | - |
28 | | - graphP gp_New(void); |
29 | | - |
30 | | - int gp_InitGraph(graphP theGraph, int N); |
31 | | - void gp_ReinitializeGraph(graphP theGraph); |
32 | | - int gp_CopyAdjacencyLists(graphP dstGraph, graphP srcGraph); |
33 | | - int gp_CopyGraph(graphP dstGraph, graphP srcGraph); |
34 | | - graphP gp_DupGraph(graphP theGraph); |
35 | | - |
36 | | - int gp_CreateRandomGraph(graphP theGraph); |
37 | | - int gp_CreateRandomGraphEx(graphP theGraph, int numEdges); |
38 | | - |
39 | | - void gp_Free(graphP *pGraph); |
40 | | - |
41 | | - int gp_Read(graphP theGraph, char const *FileName); |
42 | | - int gp_ReadFromString(graphP theGraph, char *inputStr); |
43 | | - |
44 | | -#define WRITE_ADJLIST 1 |
45 | | -#define WRITE_ADJMATRIX 2 |
46 | | -#define WRITE_DEBUGINFO 3 |
47 | | -#define WRITE_G6 4 |
48 | | - |
49 | | - int gp_Write(graphP theGraph, char const *FileName, int Mode); |
50 | | - int gp_WriteToString(graphP theGraph, char **pOutputStr, int Mode); |
51 | | - |
52 | | - int gp_IsNeighbor(graphP theGraph, int u, int v); |
53 | | - int gp_GetNeighborEdgeRecord(graphP theGraph, int u, int v); |
54 | | - int gp_GetVertexDegree(graphP theGraph, int v); |
55 | | - int gp_GetVertexInDegree(graphP theGraph, int v); |
56 | | - int gp_GetVertexOutDegree(graphP theGraph, int v); |
57 | | - |
58 | | - int gp_GetArcCapacity(graphP theGraph); |
59 | | - int gp_EnsureArcCapacity(graphP theGraph, int requiredArcCapacity); |
60 | | - |
61 | | - int gp_AddEdge(graphP theGraph, int u, int ulink, int v, int vlink); |
62 | | - int gp_DynamicAddEdge(graphP theGraph, int u, int ulink, int v, int vlink); |
63 | | - int gp_InsertEdge(graphP theGraph, int u, int e_u, int e_ulink, |
64 | | - int v, int e_v, int e_vlink); |
65 | | - |
66 | | - void gp_HideEdge(graphP theGraph, int e); |
67 | | - void gp_RestoreEdge(graphP theGraph, int e); |
68 | | - int gp_HideVertex(graphP theGraph, int vertex); |
69 | | - int gp_RestoreVertex(graphP theGraph); |
70 | | - int gp_DeleteEdge(graphP theGraph, int e, int nextLink); |
71 | | - |
72 | | - int gp_ContractEdge(graphP theGraph, int e); |
73 | | - int gp_IdentifyVertices(graphP theGraph, int u, int v, int eBefore); |
74 | | - int gp_RestoreVertices(graphP theGraph); |
75 | | - |
76 | | - int gp_CreateDFSTree(graphP theGraph); |
77 | | - int gp_SortVertices(graphP theGraph); |
78 | | - int gp_LowpointAndLeastAncestor(graphP theGraph); |
79 | | - int gp_LeastAncestor(graphP theGraph); |
80 | | - int gp_PreprocessForEmbedding(graphP theGraph); |
81 | | - |
82 | | - int gp_Embed(graphP theGraph, int embedFlags); |
83 | | - int gp_TestEmbedResultIntegrity(graphP theGraph, graphP origGraph, int embedResult); |
84 | | - |
85 | | - /* Possible Flags for gp_Embed. The planar and outerplanar settings are supported |
86 | | - natively. The rest require extension modules. */ |
87 | | - |
88 | | -#define EMBEDFLAGS_PLANAR 1 |
89 | | -#define EMBEDFLAGS_OUTERPLANAR 2 |
90 | | - |
91 | | -#define EMBEDFLAGS_DRAWPLANAR (4 | EMBEDFLAGS_PLANAR) |
92 | | - |
93 | | -#define EMBEDFLAGS_SEARCHFORK23 (16 | EMBEDFLAGS_OUTERPLANAR) |
94 | | -#define EMBEDFLAGS_SEARCHFORK4 (32 | EMBEDFLAGS_OUTERPLANAR) |
95 | | -#define EMBEDFLAGS_SEARCHFORK33 (64 | EMBEDFLAGS_PLANAR) |
96 | | - |
97 | | -#define EMBEDFLAGS_SEARCHFORK5 (128 | EMBEDFLAGS_PLANAR) |
98 | | - |
99 | | -#define EMBEDFLAGS_MAXIMALPLANARSUBGRAPH 256 |
100 | | -#define EMBEDFLAGS_PROJECTIVEPLANAR 512 |
101 | | -#define EMBEDFLAGS_TOROIDAL 1024 |
102 | | - |
103 | | -/* If LOGGING is defined, then write to the log, otherwise no-op |
104 | | - By default, neither release nor DEBUG builds including LOGGING. |
105 | | - Logging is useful for seeing details of how various algorithms |
106 | | - handle a particular graph. */ |
107 | | - |
108 | | -// #define LOGGING |
109 | | -#ifdef LOGGING |
110 | | - |
111 | | -#define gp_LogLine _LogLine |
112 | | -#define gp_Log _Log |
113 | | - |
114 | | - void _LogLine(const char *Line); |
115 | | - void _Log(const char *Line); |
116 | | - |
117 | | -#define gp_MakeLogStr1 _MakeLogStr1 |
118 | | -#define gp_MakeLogStr2 _MakeLogStr2 |
119 | | -#define gp_MakeLogStr3 _MakeLogStr3 |
120 | | -#define gp_MakeLogStr4 _MakeLogStr4 |
121 | | -#define gp_MakeLogStr5 _MakeLogStr5 |
122 | | - |
123 | | - char *_MakeLogStr1(char *format, int); |
124 | | - char *_MakeLogStr2(char *format, int, int); |
125 | | - char *_MakeLogStr3(char *format, int, int, int); |
126 | | - char *_MakeLogStr4(char *format, int, int, int, int); |
127 | | - char *_MakeLogStr5(char *format, int, int, int, int, int); |
128 | | - |
129 | | -#else |
130 | | -#define gp_LogLine(Line) |
131 | | -#define gp_Log(Line) |
132 | | -#define gp_MakeLogStr1(format, one) |
133 | | -#define gp_MakeLogStr2(format, one, two) |
134 | | -#define gp_MakeLogStr3(format, one, two, three) |
135 | | -#define gp_MakeLogStr4(format, one, two, three, four) |
136 | | -#define gp_MakeLogStr5(format, one, two, three, four, five) |
137 | | -#endif |
| 22 | +#include "c/graphLib/graph.h" |
138 | 23 |
|
139 | 24 | #ifdef __cplusplus |
140 | 25 | } |
|
0 commit comments