1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /* Lefteris Koutsofios - AT&T Labs Research */
19 
20 #ifndef _COMMON_H
21 #define _COMMON_H
22 
23 /* some config and conversion definitions from graphviz distribution */
24 #include "config.h"
25 /* we set some parameters which graphviz assumes.
26  * At some point, we could consider allowing these to be set in configure
27  * See Makefile.old for others.
28  */
29 #define FEATURE_MINTSIZE 1
30 #define FEATURE_DOT 1
31 #if defined(_WIN32)
32 #ifndef FEATURE_WIN32
33 #define FEATURE_WIN32 1
34 #endif
35 #ifndef FEATURE_MS
36 #define FEATURE_MS 1
37 #endif
38 #else
39 #define FEATURE_X11 1
40 #endif
41 
42 #include <stdlib.h>
43 #include <stdarg.h>
44 #include <string.h>
45 #include <limits.h>
46 #include <sys/types.h>
47 #include <sys/stat.h>
48 #ifndef _WIN32
49 #include <sys/time.h>
50 #endif
51 #ifdef HAVE_SYS_SELECT_H
52 #include <sys/select.h>
53 #endif
54 
55 #include <inttypes.h>
56 #include <math.h>
57 #include <stdio.h>
58 #include <setjmp.h>
59 #include <ctype.h>
60 
61 #ifdef FEATURE_WIN32
62 #include <windows.h>
63 #include <commdlg.h>
64 #endif
65 
66 #ifdef FEATURE_MS
67 #include <malloc.h>
68 #define printf gprintf
69 #endif
70 
71 #define POS __FILE__, __LINE__
72 
73 #ifndef TRUE
74 #define TRUE  1
75 #define FALSE 0
76 #endif
77 
78 #ifndef L_SUCCESS
79 #define L_SUCCESS 1
80 #define L_FAILURE 0
81 #endif
82 
83 #define CHARSRC 0
84 #define FILESRC 1
85 
86 #ifndef M_PI
87 #define M_PI 3.14159265358979323846
88 #endif
89 
90 extern int warnflag;
91 extern char *leftypath, *leftyoptions, *shellpath;
92 extern jmp_buf exitljbuf;
93 extern int idlerunmode;
94 extern fd_set inputfds;
95 
96 int init (char *);
97 void term (void);
98 char *buildpath (char *, int);
99 char *buildcommand (char *, char *, int, int, char *);
100 void warning (char *, int, char *, char *, ...);
101 void panic1 (char *, int, char *, char *, ...);
102 void panic2 (char *, int, char *, char *, ...);
103 #endif /* _COMMON_H */
104 
105 #ifdef __cplusplus
106 }
107 #endif
108