36 typedef const char *(*CSQL_GET_MESSAGE) (
int message_index);
53 if (util_sa_library ==
NULL)
59 if (csql_get_message ==
NULL)
78 typedef const char *(*GET_MESSAGE) (
int message_index);
82 GET_MESSAGE get_message_fn;
85 if (util_sa_library ==
NULL)
97 get_message_fn = (GET_MESSAGE) symbol;
102 va_start (ap, message_num);
103 vfprintf (stderr, get_message_fn (message_num), ap);
116 char option_string[64];
121 int check_output_style = 0;
122 bool explicit_single_line =
false;
168 int option_index = 0;
171 option_key =
getopt_long (argc, argv, option_string, csql_option, &option_index);
172 if (option_key == -1)
198 free ((
void *) csql_arg.
passwd);
225 explicit_single_line =
true;
235 free ((
void *) csql_arg.
command);
266 int string_width = 0, result;
270 if (result != 0 || string_width < 0)
307 else if (len >= 2 &&
optarg[0] ==
'\\')
313 else if (
optarg[1] ==
'n')
378 check_output_style++;
392 check_output_style++;
404 check_output_style++;
407 if (check_output_style > 1)
449 if (util_library ==
NULL)
462 error = (*csql) (argv[0], &csql_arg);
471 free ((
void *) csql_arg.
passwd);
483 free ((
void *) csql_arg.
command);
490 error = EXIT_FAILURE;
const char * csql_get_message(int message_index)
static void utility_csql_usage(void)
#define CSQL_INPUT_FILE_S
#define CSQL_SKIP_VACUUM_L
#define CSQL_NO_TRIGGER_ACTION_L
#define CSQL_LINE_OUTPUT_L
int utility_load_symbol(DSO_HANDLE library_handle, DSO_HANDLE *symbol_handle, const char *symbol_name)
int parse_int(int *ret_p, const char *str_p, int base)
#define CSQL_NO_SINGLE_LINE_L
#define CSQL_OUTPUT_FILE_S
void util_hide_password(char *arg)
#define CSQL_OUTPUT_FILE_L
#define CSQL_NO_AUTO_COMMIT_S
#define CSQL_NO_AUTO_COMMIT_L
int getopt_long(int, char *const *, const char *, const struct option *, int *)
void utility_load_print_error(FILE *fp)
#define CSQL_INPUT_FILE_L
static void utility_csql_print(void)
int utility_load_library(DSO_HANDLE *handle, const char *path)
int(* CSQL)(const char *argv0, CSQL_ARGUMENT *csql_arg)
int main(int argc, char *argv[])
#define CSQL_LINE_OUTPUT_S
#define CSQL_WRITE_ON_STANDBY_S
#define CSQL_SINGLE_LINE_L
const char * out_file_name
#define CSQL_QUERY_COLUMN_DELIMITER_L
#define CSQL_NO_SINGLE_LINE_S
#define CSQL_QUERY_COLUMN_ENCLOSURE_S
#define CSQL_SKIP_VACUUM_S
char * utility_make_getopt_optstring(const GETOPT_LONG *opt_array, char *buf)
#define CSQL_NO_TRIGGER_ACTION_S
#define CSQL_LOADDB_OUTPUT_L
#define CSQL_QUERY_COLUMN_ENCLOSURE_L
#define CSQL_QUERY_OUTPUT_L
bool single_line_execution
int csql(const char *argv0, CSQL_ARGUMENT *csql_arg)
const char *(* CSQL_GET_MESSAGE)(int message_index)
#define CSQL_SINGLE_LINE_S
static void error(const char *msg)
#define CSQL_LOADDB_OUTPUT_S
#define CSQL_PLAIN_OUTPUT_S
#define CSQL_ERROR_CONTINUE_S
#define CSQL_SKIP_COL_NAMES_L
static void print_usage(void)
#define CSQL_QUERY_COLUMN_DELIMITER_S
#define CSQL_SKIP_COL_NAMES_S
#define CSQL_STRING_WIDTH_S
#define CSQL_WRITE_ON_STANDBY_L
char * strdup(const char *str)
#define CSQL_STRING_WIDTH_L
const char * in_file_name
#define CSQL_QUERY_OUTPUT_S
#define UTILITY_GENERIC_MSG_FUNC_NAME
#define CSQL_ERROR_CONTINUE_L
#define CSQL_PLAIN_OUTPUT_L