Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / src / test / regress / pg_regress.h
blob6db8dde3e190bff84b773df5b280ce8e48b9bbe5
1 /*-------------------------------------------------------------------------
2 * pg_regress.h --- regression test driver
4 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
5 * Portions Copyright (c) 1994, Regents of the University of California
7 * $PostgreSQL$
8 *-------------------------------------------------------------------------
9 */
11 #include "postgres_fe.h"
12 #include <unistd.h>
14 #ifndef WIN32
15 #define PID_TYPE pid_t
16 #define INVALID_PID (-1)
17 #else
18 #define PID_TYPE HANDLE
19 #define INVALID_PID INVALID_HANDLE_VALUE
20 #endif
22 /* simple list of strings */
23 typedef struct _stringlist
25 char *str;
26 struct _stringlist *next;
27 } _stringlist;
29 typedef PID_TYPE(*test_function) (const char *,
30 _stringlist **,
31 _stringlist **,
32 _stringlist **);
33 typedef void (*init_function) (void);
35 extern char *bindir;
36 extern char *libdir;
37 extern char *datadir;
38 extern char *host_platform;
40 extern _stringlist *dblist;
41 extern bool debug;
42 extern char *inputdir;
43 extern char *outputdir;
46 * This should not be global but every module should be able to read command
47 * line parameters.
49 extern char *psqldir;
51 extern const char *basic_diff_opts;
52 extern const char *pretty_diff_opts;
54 int regression_main(int argc, char *argv[],
55 init_function ifunc, test_function tfunc);
56 void add_stringlist_item(_stringlist ** listhead, const char *str);
57 PID_TYPE spawn_process(const char *cmdline);
58 void exit_nicely(int code);
59 void replace_string(char *string, char *replace, char *replacement);
60 bool file_exists(const char *file);