1 /*
2  * sqsh_global.c - Where globals are defined
3  *
4  * Copyright (C) 1995, 1996 by Scott C. Gray
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, write to the Free Software
18  * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  * You may contact the author :
21  *   e-mail:  gray@voicenet.com
22  *            grays@xtend-tech.com
23  *            gray@xenotropic.com
24  */
25 #include <stdio.h>
26 #include "sqsh_config.h"
27 #include "sqsh_global.h"
28 
29 /*-- Current Version --*/
30 #if !defined(lint) && !defined(__LINT__)
31 static char RCS_Id[] = "$Id: sqsh_global.c,v 1.11 2014/01/19 10:26:00 mwesdorp Exp $" ;
32 USE(RCS_Id)
33 #endif /* !defined(lint) */
34 
35 /*-- Global Initialization --*/
36 CS_CONTEXT         *g_context    = NULL;
37 CS_CONNECTION      *g_connection = NULL;
38 
39 CS_INT      g_cs_ver       = CS_VERSION_100;
40 
41 env_t      *g_env          = NULL;
42 env_t      *g_buf          = NULL;
43 env_t      *g_internal_env = NULL;
44 varbuf_t   *g_sqlbuf       = NULL;
45 cmdset_t   *g_cmdset       = NULL;
46 funcset_t  *g_funcset      = NULL;
47 jobset_t   *g_jobset       = NULL;
48 history_t  *g_history      = NULL;
49 alias_t    *g_alias        = NULL;
50 char       *g_password     = NULL;
51 int         g_password_set = False;
52 char       *g_lock         = NULL;
53 char       *g_copyright    = "Copyright (C) 1995-2001 Scott C. Gray\nPortions Copyright (C) 2004-2014 Michael Peppler and Martin Wesdorp";
54 char       *g_version      = SQSH_VERSION;
55 dsp_desc_t *g_do_cols[64];
56 int         g_do_ncols     = 0;
57 funcarg_t   g_func_args[64];
58 int         g_func_nargs   = 0;
59 int         g_interactive  = False;
60 
61 #if defined(HAVE_LOCALE_H)
62     struct lconv  *g_lconv = NULL;
63 #else
64     void *g_lconv = NULL;
65 #endif
66 
67 /*
68  * sqsh-2.5 - Initialize variables for p2f feature.
69  */
70 FILE       *g_p2f_fp       = NULL;
71 int         g_p2fc         = 0;
72 
73