File: common.h

package info (click to toggle)
mydumper 0.9.1-5
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 396 kB
  • ctags: 274
  • sloc: ansic: 3,404; makefile: 3; cpp: 3
file content (45 lines) | stat: -rw-r--r-- 2,081 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Authors:        Andrew Hutchings, SkySQL (andrew at skysql dot com)
*/
#ifndef _common_h
#define _common_h

char *hostname=NULL;
char *username=NULL;
char *password=NULL;
char *socket_path=NULL;
char *db=NULL;
guint port=3306;
guint num_threads= 4;
guint verbose=2;
gboolean compress_protocol= FALSE;
gboolean program_version= FALSE;

GOptionEntry common_entries[] =
{
        { "host", 'h', 0, G_OPTION_ARG_STRING, &hostname, "The host to connect to", NULL },
        { "user", 'u', 0, G_OPTION_ARG_STRING, &username, "Username with privileges to run the dump", NULL },
        { "password", 'p', 0, G_OPTION_ARG_STRING, &password, "User password", NULL },
        { "port", 'P', 0, G_OPTION_ARG_INT, &port, "TCP/IP port to connect to", NULL },
        { "socket", 'S', 0, G_OPTION_ARG_STRING, &socket_path, "UNIX domain socket file to use for connection", NULL },
        { "threads", 't', 0, G_OPTION_ARG_INT, &num_threads, "Number of threads to use, default 4", NULL },
        { "compress-protocol", 'C', 0, G_OPTION_ARG_NONE, &compress_protocol, "Use compression on the MySQL connection", NULL },
	{ "version", 'V', 0, G_OPTION_ARG_NONE, &program_version, "Show the program version and exit", NULL },
	{ "verbose", 'v', 0, G_OPTION_ARG_INT, &verbose, "Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2", NULL },
        { NULL, 0, 0, G_OPTION_ARG_NONE,   NULL, NULL, NULL }
};

#endif