#include "mod_blackhole.h"

static uint8_t status;

int mod_init ()
{
	return 1;
}

int mod_connect (void *handle)
{
	if(handle == NULL)
		return 0;

	return 1;
}

int mod_disconnect (void *handle)
{
	if (handle == NULL)
		return 0;

	return 1;
}

void mod_reconnect (void __attribute__((__unused__)) *handle)
{
}

int mod_getlasterror (void *handle)
{
	if (handle == NULL)
		return -1;

	return 0;
}

char *mod_geterrorstring (void __attribute__((__unused__)) *handle)
{
	return NULL;
}

void mod_freeresult (void __attribute__((__unused__))*handle)
{
	return;
}

void *mod_querysql (void __attribute__((__unused__)) *handle,char __attribute__((__unused__)) *query, int __attribute__((__unused__)) *returncode)
{
	return NULL;
}

int mod_executesql (void *handle, char __attribute__((__unused__)) *query)
{
	if (handle == NULL)
		return -1;

	return 1;
}

int mod_exit ()
{
	return 1;
}

char *mod_add_value (void *handle,char __attribute__((__unused__)) *value, size_t __attribute__((__unused__)) maxlen)
{
	static char string[2] = "";

	if (handle == NULL)
		return NULL;

	return string;
}

void *mod_create (mod_config __attribute__((__unused__)) *cfg)
{
	return (void *)1;
}

int mod_destroy (void __attribute__((__unused__)) *handle)
{
	return 1;
}

uint8_t	mod_get_status (void __attribute__((__unused__)) *handle)
{
	return	status;
}

void mod_set_status (void __attribute__((__unused__)) *handle, uint8_t newstatus)
{
	status = newstatus;
	return;
}

uint8_t mod_add_column (void *handle, char __attribute__((__unused__)) *tablename, char __attribute__((__unused__)) *columnname, char __attribute__((__unused__)) *type, char __attribute__((__unused__)) *len, uint8_t __attribute__((__unused__)) nullable, int __attribute__((__unused__)) _unsigned, int __attribute__((__unused__)) command)
{
	if (handle == NULL)
		return 0;

	return 1;

}

int mod_get_info (void __attribute__((__unused__)) *handle, mod_info __attribute__((__unused__)) *modinfo, int __attribute__((__unused__)) modinfolen)
{
	return -1;
}

Databaseinfo *mod_get_databaseinfo (void __attribute__((__unused__)) *handle)
{
	return NULL;
}

void mod_free_databaseinfo (Databaseinfo __attribute__((__unused__)) *dbinfo)
{
}
