1 /*****************************************************************************
2 * This is the header file for versions 2.7 of naututil.c and dreadnaut.c.    *
3 * naututil.h.  Generated from naututil-h.in by configure.
4 *****************************************************************************/
5 
6 /* The parts between the ==== lines are modified by configure when
7 creating naututil.h out of naututil-h.in.  If configure is not being
8 used, it is necessary to check they are correct.
9 ====================================================================*/
10 
11 /* Check whether various headers are available */
12 
13 #define HAVE_ISATTY  1     /* if isatty() is available */
14 #define HAVE_TIMES  1      /* if times() is available */
15 #define HAVE_TIME  1      /* if time() is available */
16 #define HAVE_GETRUSAGE 1  /* if getrusage() is available */
17 #define HAVE_GETTIMEOFDAY  1  /* if gettimeofday() */
18 
19 /*==================================================================*/
20 
21 /*****************************************************************************
22 *                                                                            *
23 *   Copyright (1984-2018) Brendan McKay.  All rights reserved.               *
24 *   Subject to the waivers and disclaimers in nauty.h.                       *
25 *                                                                            *
26 *   CHANGE HISTORY                                                           *
27 *       10-Nov-87 : final changes for version 1.2                            *
28 *        5-Dec-87 : changes for version 1.3 :                                *
29 *                   - added declarations of readinteger() and readstring()   *
30 *                   - added definition of DEFEXT : default file-name         *
31 *                     extension for dreadnaut input files                    *
32 *       28-Sep-88 : changes for version 1.4 :                                *
33 *                   - added support for PC Turbo C                           *
34 *       29-Nov-88 : - added getc macro for AZTEC C on MAC                    *
35 *       23-Mar-89 : changes for version 1.5 :                                *
36 *                   - added DREADVERSION macro                               *
37 *                   - added optional ANSI function prototypes                *
38 *                   - changed file name to naututil.h                        *
39 *                   - moved ALLOCS to nauty.h and defined DYNALLOC           *
40 *       25-Mar-89 : - added declaration of twopaths()                        *
41 *       29-Mar-89 : - added declaration of putmapping()                      *
42 *        4-Apr-89 : - added declarations of triples, quadruples, adjtriang   *
43 *                   - only define ERRFILE if not in nauty.h                  *
44 *       25-Apr-89 : - added declarations of cellquads,distances,getbigcells  *
45 *       26-Apr-89 : - added declarations of indsets,cliques,cellquins        *
46 *                   - removed declarations of ptncode and equitable          *
47 *       27-Apr-89 : - added declaration of putquotient                       *
48 *       18-Aug-89 : - added new arg to putset, and changed mathon            *
49 *        2-Mar-90 : - added declarations of celltrips, cellcliq, cellind     *
50 *                   - changed declarations to use EXTPROC                    *
51 *       12-Mar-90 : - added changes for Cray version                         *
52 *       20-Mar-90 : - added changes for THINK version                        *
53 *       27-Mar-90 : - split SYS_MSDOS into SYS_PCMS4 and SYS_PCMS5           *
54 *       13-Oct-90 : changes for version 1.6 :                                *
55 *                   - changed CPUTIME to use HZ on Unix for times()          *
56 *       14-Oct-90 : - added SYS_APOLLO variant                               *
57 *       19-Oct-90 : - changed CPUTIME defs for BSDUNIX to avoid conficting   *
58 *                     declarations of size_t and ptrdiff_t in gcc            *
59 *       27-Aug-92 : changes for version 1.7 :                                *
60 *                   - added SYS_IBMC variant                                 *
61 *                   - removed workaround for bad gcc installation            *
62 *        5-Jun-93 : changes for version 1.8 :                                *
63 *                   - changed CRAY version of CPUTIME to use CLK_TCK         *
64 *                     if HZ could not be found (making 1.7+)                 *
65 *       30-Jul-93 : - added SYS_ALPHA variant                                *
66 *       17-Sep-93 : changes for version 1.9 :                                *
67 *                   - declared adjacencies()                                 *
68 *       24-Feb-94 : changes for version 1.10 :                               *
69 *                   - added version SYS_AMIGAAZT (making 1.9+)               *
70 *       19-Apr-95 : - added C++ prototype wrapper                            *
71 *        6-Mar-96 : - added SYS_ALPHA32 code                                 *
72 *       23-Jul-96 : changes for version 2.0 :                                *
73 *                   - changed readstring() declaration                       *
74 *                   - removed DYNALLOC definition                            *
75 *                   - added sublabel() definition                            *
76 *       15-Aug-96 : - added sethash() definition                             *
77 *       30-Aug-96 : - added KRAN and D. Knuth routines                       *
78 *       16-Sep-96 : - fixed the above!                                       *
79 *        7-Feb-96 : - declared nautinv_null() and setnbhd()                  *
80 *        4-Sep-97 : - arg of time() is type time_t*, was long*               *
81 *       22-Sep-97 : - defined fileno() and time_t for SYS_PCTURBO            *
82 *       10-Dec-97 : - revised KRAN for new rng.c from Knuth                  *
83 *       18-Feb-98 : - changed time() to time_t for Unix                      *
84 *       21-Oct-98 : - changed short to shortish as needed                    *
85 *        9-Jan-00 : - declared nautinv_check() and naututil_check()          *
86 *       16-Nov-00 : - applied changes logged in nauty.h                      *
87 *       22-Apr-01 : changes for version 2.1 :                                *
88 *                   - prototypes for nautinv.c are now in nautinv.h          *
89 *                   - CPUTIME for UNIX uses CLK_TCK (needs revision!)        *
90 *        2-Jun-01 : - prototype for converse()                               *
91 *       18-Oct-01 : - complete revision; sysdeps in separate files           *
92 *       28-Aug-02 : changes for version 2.2 :                                *
93 *                   - revised for autoconf                                   *
94 *       17-Nov-02 : added explicit "extern" where it was implicit before     *
95 *       11-Apr-02 : added rangraph2()                                        *
96 *       10-Sep-07 : Define CPUTIME=0.0 for hosts that don't provide it       *
97 *        4-Nov-09 : added readgraph_sg(), putgraph_sg(), putcanon_sg()       *
98 *       10-Nov-09 : removed types shortish and permutation                   *
99 *       14-Nov-09 : added relabel_sg(), copy_sg(), putdegs_sg(),             *
100 *                    sublabel_sg()                                           *
101 *       19-Nov-09 : added individualise()                                    *
102 *       20-Nov-09 : added hashgraph_sg(), listhash(), hashgraph()            *
103 *       19-Dec-09 : added ranreg(), rangraph2_sg()                           *
104 *        5-Jun-10 : added mathon_sg() and converse_sg()                      *
105 *       10-Jun-10 : added putquotient_sg() and complement_sg()               *
106 *       15-Jan-12 : added TLS_ATTR to static declarations                    *
107 *        3-Mar-12 : added putorbitsplus() and putset_firstbold()             *
108 *       17-Mar-12 : include naurng.h and remove redundant lines              *
109 *        1-Nov-15 : changes for version 2.6 :                                *
110 *                 - prototypes for putdegseq(), putdegseq_sg()               *
111 *       17-Dec-15 : prototype for readgraph_swg()                            *
112 *        6-Apr-16 : prototype for countcells()                               *
113 *       27-Aug-16 : added REALTIMEDEFS and NAUTYREALTIME                     *
114 *                                                                            *
115 * ++++++ This file is automatically generated, don't edit it by hand! ++++++
116 *                                                                            *
117 *****************************************************************************/
118 
119 #include "nauty.h"              /* which includes stdio.h */
120 #include "nausparse.h"
121 #include "naurng.h"
122 /* At this point we can assume that <sys/types.h>, <unistd.h>, <stddef.h>,
123    <stdlib.h>, <string.h> or <strings.h> and <malloc.h> if necessary have
124    been included if they exist. */
125 
126 #ifdef __cplusplus
127 extern "C" {
128 #endif
129 
130 extern void complement(graph*,int,int);
131 extern void converse(graph*,int,int);
132 extern void converse_sg(sparsegraph*, sparsegraph*);
133 extern void copycomment(FILE*,FILE*,int);
134 extern void complement_sg(sparsegraph*, sparsegraph*);
135 extern int countcells(int*,int,int);
136 extern void flushline(FILE*);
137 extern void fixit(int*,int*,int*,int,int);
138 extern int getint(FILE*);
139 extern int getint_sl(FILE*);
140 extern long hash(set*,long,int);
141 extern long hashgraph(graph*,int,int,long);
142 extern long hashgraph_sg(sparsegraph*,long);
143 extern void individualise(int*,int*,int,int,int*,int*,int);
144 extern long listhash(int*,int,long);
145 extern void mathon(graph*,int,int,graph*,int,int);
146 extern void mathon_sg(sparsegraph*,sparsegraph*);
147 extern void naututil_check(int,int,int,int);
148 extern void naututil_freedyn(void);
149 extern void putcanon(FILE*,int*,graph*,int,int,int);
150 extern void putcanon_sg(FILE*,int*,sparsegraph*,int);
151 extern void putdegs(FILE*,graph*,int,int,int);
152 extern void putdegs_sg(FILE*,sparsegraph*,int);
153 extern void putdegseq(FILE*,graph*,int,int,int);
154 extern void putdegseq_sg(FILE*,sparsegraph*,int);
155 extern void putgraph(FILE*,graph*,int,int,int);
156 extern void putgraph_sg(FILE*,sparsegraph*,int);
157 extern void putmapping(FILE*,int*,int,int*,int,int,int);
158 extern void putorbits(FILE*,int*,int,int);
159 extern void putorbitsplus(FILE*,int*,int,int);
160 extern void putptn(FILE*,int*,int*,int,int,int);
161 extern void putquotient(FILE*,graph*,int*,int*,int,int,int,int);
162 extern void putquotient_sg(FILE*,sparsegraph*,int*,int*,int,int);
163 extern void putset(FILE*,set*,int*,int,int,boolean);
164 extern void putset_firstbold(FILE*,set*,int*,int,int,boolean);
165 extern void rangraph(graph*,boolean,int,int,int);
166 extern void rangraph2(graph*,boolean,int,int,int,int);
167 extern void rangraph2_sg(sparsegraph*,boolean,int,int,int);
168 extern void ranreg_sg(sparsegraph *sg, int degree, int n);
169 extern void ranperm(int*,int);
170 extern void readgraph(FILE*,graph*,boolean,boolean,boolean,int,int,int);
171 extern void readgraph_sg(FILE*,sparsegraph*,boolean,boolean,int,int);
172 extern void readgraph_swg(FILE*,sparsegraph*,boolean,boolean,int,int);
173 extern boolean readinteger(FILE*,int*);
174 extern boolean readinteger_sl(FILE*,int*);
175 extern void readperm(FILE*,int*,boolean,int);
176 extern void readptn(FILE*,int*,int*,int*,boolean,int);
177 extern void readvperm(FILE*,int*,boolean,int,int*);
178 extern boolean readstring(FILE*,char*,int);
179 extern void relabel(graph*,int*,int*,graph*,int,int);
180 extern void relabel_sg(sparsegraph*,int*,int*,sparsegraph*);
181 extern long sethash(set*,int,long,int);
182 extern int setinter(set*,set*,int);
183 extern int setsize(set*,int);
184 extern void sublabel(graph*,int*,int,graph*,int,int);
185 extern void sublabel_sg(sparsegraph*,int*,int,sparsegraph*);
186 extern int subpartition(int*,int*,int,int*,int);
187 extern void unitptn(int*,int*,int*,int);
188 
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 #define MAXREG 8    /* Used to limit ranreg_sg() degree */
194 
195 #define PROMPTFILE stdout    /* where to write prompts */
196 #ifndef ERRFILE
197 #define ERRFILE stderr       /* where to write error messages */
198 #endif
199 #define MAXIFILES 10         /* how many input files can be open at once */
200 #define EXIT exit(0)         /* how to stop normally */
201 #define DEFEXT ".dre"        /* extension for dreadnaut files */
202 
203 /*************************************************************************
204  The following macros may represent differences between system.  This
205  file contains the UNIX/POSIX editions.  For other systems, a separate
206  file of definitions is read in first.  That file should define the
207  variables NAUTY_*_DEFINED for sections that are to replace the UNIX
208  versions.  See the provided examples for more details.
209 
210  If your system does not have a predefined macro you can use to cause
211  a definitions file to be read, you have to make up one and arrange for
212  it to be defined when this file is read.
213 
214  The system-dependent files can also redefine the macros just ahead of
215  this comment.
216 **************************************************************************/
217 
218 #ifdef __weirdmachine__
219 #include "weird.h"  /* Some weird machine (ILLUSTRATION ONLY) */
220 #endif
221 
222 /*************************************************************************/
223 
224 #ifndef NAUTY_PROMPT_DEFINED
225 #if HAVE_ISATTY
226 #define DOPROMPT(fp) (isatty(fileno(fp)) && isatty(fileno(PROMPTFILE)))
227 #else
228 #define DOPROMPT(fp) (curfile==0)
229 #endif
230 #endif /*NAUTY_PROMPT_DEFINED*/
231 
232 /*************************************************************************/
233 
234 #ifndef NAUTY_OPEN_DEFINED
235 #define OPENOUT(fp,name,append) fp = fopen(name,(append)?"a":"w")
236 #endif /*NAUTY_OPEN_DEFINED*/
237 
238 /*************************************************************************/
239 
240 #ifndef NAUTY_CPU_DEFINED
241 #if HAVE_TIMES
242 #include <sys/times.h>
243 #define CPUDEFS static TLS_ATTR struct tms timebuffer;
244 #ifndef CLK_TCK
245 #include <time.h>
246 #endif
247 #if !defined(CLK_TCK) && defined(_SC_CLK_TCK)
248 #define CLK_TCK sysconf(_SC_CLK_TCK)
249 #endif
250 #ifndef CLK_TCK
251 #define CLK_TCK 60
252 #endif
253 #define CPUTIME (times(&timebuffer),\
254               (double)(timebuffer.tms_utime + timebuffer.tms_stime) / CLK_TCK)
255 #else
256 #if HAVE_GETRUSAGE
257 #include <sys/time.h>
258 #include <sys/resource.h>
259 #define CPUDEFS struct rusage ruse;
260 #define CPUTIME (getrusage(RUSAGE_SELF,&ruse),\
261   ruse.ru_utime.tv_sec + ruse.ru_stime.tv_sec + \
262   1e-6 * (ruse.ru_utime.tv_usec + ruse.ru_stime.tv_usec))
263 #endif
264 #endif
265 
266 #ifndef CPUTIME
267 #define CPUTIME 0.0
268 #endif
269 
270 #endif /*NAUTY_CPU_DEFINED*/
271 
272 /*************************************************************************/
273 
274 #ifndef NAUTY_SEED_DEFINED
275 #if HAVE_GETTIMEOFDAY
276 #include <sys/time.h>
277 #define INITSEED \
278 {struct timeval nauty_tv; \
279  gettimeofday(&nauty_tv,NULL); \
280  seed = ((nauty_tv.tv_sec<<10) + (nauty_tv.tv_usec>>10)) & 0x7FFFFFFFL;}
281 #else
282 #if HAVE_TIME
283 #include <time.h>
284 #define INITSEED  seed = ((time((time_t*)NULL)<<1) | 1) & 0x7FFFFFFFL
285 #endif
286 #endif
287 #endif /*NAUTY_SEED_DEFINED*/
288 
289 /*************************************************************************/
290 
291 #ifndef NAUTY_REALTIME_DEFINED
292 #if HAVE_GETTIMEOFDAY
293 #include <sys/time.h>
294 #define REALTIMEDEFS struct timeval nauty_rtv;
295 #define NAUTYREALTIME (gettimeofday(&nauty_rtv,NULL), \
296  (double)(nauty_rtv.tv_sec + 1e-6 * nauty_rtv.tv_usec))
297 #else
298 #if HAVE_TIME
299 #include <time.h>
300 #define REALTIMEDEFS
301 #define NAUTYREALTIME ((double)time(NULL))
302 #endif
303 #endif
304 
305 #ifndef NAUTYREALTIME
306 #define NAUTYREALTIME 0.0
307 #endif
308 
309 #endif /*NAUTY_REALTIME_DEFINED*/
310 
311 /* ++++++ This file is automatically generated, don't edit it by hand! ++++++ */
312