/*
Copyright (C) 2003 Eike Lange
 
Author: Eike Lange <eike@gnu.de>

Support routine for mysql.pas, a unit for accessing MySQL

This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation, version 2.

This library 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 Library General Public
License for more details.

You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB.  If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
*/
#include <mysql/mysql.h>
#include <mysql/errmsg.h>
#include <string.h>

/* mysql_option */
const int _p_MYSQL_OPT_CONNECT_TIMEOUT = MYSQL_OPT_CONNECT_TIMEOUT;
const int _p_MYSQL_OPT_COMPRESS = MYSQL_OPT_COMPRESS;
const int _p_MYSQL_OPT_NAMED_PIPE = MYSQL_OPT_NAMED_PIPE;
const int _p_MYSQL_INIT_COMMAND = MYSQL_INIT_COMMAND;
const int _p_MYSQL_READ_DEFAULT_FILE = MYSQL_READ_DEFAULT_FILE;
const int _p_MYSQL_READ_DEFAULT_GROUP = MYSQL_READ_DEFAULT_GROUP;
const int _p_MYSQL_SET_CHARSET_DIR = MYSQL_SET_CHARSET_DIR;
const int _p_MYSQL_SET_CHARSET_NAME = MYSQL_SET_CHARSET_NAME;
const int _p_MYSQL_OPT_LOCAL_INFILE = MYSQL_OPT_LOCAL_INFILE;

/* mysql_status */
const int _p_MYSQL_STATUS_READY = MYSQL_STATUS_READY;
const int _p_MYSQL_STATUS_GET_RESULT = MYSQL_STATUS_GET_RESULT;
const int _p_MYSQL_STATUS_USE_RESULT = MYSQL_STATUS_USE_RESULT;

/* Error Codes from errmsg.h */
const int _p_CR_MIN_ERROR = CR_MIN_ERROR;
const int _p_CR_MAX_ERROR = CR_MAX_ERROR;
const int _p_CR_UNKNOWN_ERROR = CR_UNKNOWN_ERROR;
const int _p_CR_SOCKET_CREATE_ERROR = CR_SOCKET_CREATE_ERROR;
const int _p_CR_CONNECTION_ERROR = CR_CONNECTION_ERROR;
const int _p_CR_CONN_HOST_ERROR = CR_CONN_HOST_ERROR;
const int _p_CR_IPSOCK_ERROR = CR_IPSOCK_ERROR;
const int _p_CR_UNKNOWN_HOST = CR_UNKNOWN_HOST;
const int _p_CR_SERVER_GONE_ERROR = CR_SERVER_GONE_ERROR;
const int _p_CR_VERSION_ERROR = CR_VERSION_ERROR;
const int _p_CR_OUT_OF_MEMORY = CR_OUT_OF_MEMORY;
const int _p_CR_WRONG_HOST_INFO = CR_WRONG_HOST_INFO;
const int _p_CR_LOCALHOST_CONNECTION = CR_LOCALHOST_CONNECTION;
const int _p_CR_TCP_CONNECTION = CR_TCP_CONNECTION;
const int _p_CR_SERVER_HANDSHAKE_ERR = CR_SERVER_HANDSHAKE_ERR;
const int _p_CR_SERVER_LOST = CR_SERVER_LOST;
const int _p_CR_COMMANDS_OUT_OF_SYNC = CR_COMMANDS_OUT_OF_SYNC;
const int _p_CR_NAMEDPIPE_CONNECTION = CR_NAMEDPIPE_CONNECTION;
const int _p_CR_NAMEDPIPEWAIT_ERROR = CR_NAMEDPIPEWAIT_ERROR;
const int _p_CR_NAMEDPIPEOPEN_ERROR = CR_NAMEDPIPEOPEN_ERROR;
const int _p_CR_NAMEDPIPESETSTATE_ERROR = CR_NAMEDPIPESETSTATE_ERROR;
const int _p_CR_CANT_READ_CHARSET = CR_CANT_READ_CHARSET;
const int _p_CR_NET_PACKET_TOO_LARGE = CR_NET_PACKET_TOO_LARGE;
const int _p_CR_EMBEDDED_CONNECTION = CR_EMBEDDED_CONNECTION;
const int _p_CR_PROBE_SLAVE_STATUS = CR_PROBE_SLAVE_STATUS;
const int _p_CR_PROBE_SLAVE_HOSTS = CR_PROBE_SLAVE_HOSTS;
const int _p_CR_PROBE_SLAVE_CONNECT = CR_PROBE_SLAVE_CONNECT;
const int _p_CR_PROBE_MASTER_CONNECT = CR_PROBE_MASTER_CONNECT;
const int _p_CR_SSL_CONNECTION_ERROR = CR_SSL_CONNECTION_ERROR;
const int _p_CR_MALFORMED_PACKET = CR_MALFORMED_PACKET;

/* unsorted */
const int _p_MAX_MYSQL_MANAGER_ERR = MAX_MYSQL_MANAGER_ERR;
const int _p_MAX_MYSQL_MANAGER_MSG = MAX_MYSQL_MANAGER_MSG;
const int _p_MANAGER_OK = MANAGER_OK;
const int _p_MANAGER_INFO = MANAGER_INFO;
const int _p_MANAGER_ACCESS = MANAGER_ACCESS;
const int _p_MANAGER_CLIENT_ERR = MANAGER_CLIENT_ERR;
const int _p_MANAGER_INTERNAL_ERR = MANAGER_INTERNAL_ERR;

/* Functions */
char *_p_mysql_character_set_name (MYSQL *mysql)
{
  return strdup (mysql_character_set_name (mysql));
}
