novalib_h

/*
** Copyright 2013, Fermi Research Alliance, LLC.  All rights reserved.
*/
/******************************************************************************/
/* novalib.h
**
**	function prototypes and defined constants for argument values for
**	ul_nova routines
**
**	V0.0	B S Hendricks / Accelerator Controls		27-Feb-13
**	Created
**
*/
/******************************************************************************/

#ifndef NOVALIB_DEFINED		/* do this only once */
#define	NOVALIB_DEFINED

#include <libpq-fe.h>

#define	NOVA_MAX_ERROR_STRING_LEN	1024	/* maximum error string length */

#define	NOVA_MAX_SCHEMA_NAME_LEN	32	/* maximum database schema name length */


/******************************************************************************/
/*
**	function prototypes for ul_nova routines
*/
/******************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

int nova_archive_add_db_channel_id(char const *device_name,
				   int *channel_id,
				   char *error_string);
int nova_archive_db_connect(PGconn **connection, char *error_string);
int nova_archive_dump_db_channel_ids(int *num_channel_ids, char **device_names,
				     int **channel_ids);
int nova_archive_get_db_channel_id(char const *device_name, int *channel_id,
				   char *error_string);
int nova_archive_get_db_channel_id_list_c(int num_devices,
					  char const *device_names,
					  int *channel_ids,
					  char *error_string);
int nova_archive_get_db_schema(char *schema_name);

#ifdef __cplusplus
}
#endif


/******************************************************************************/
/*
**	equivalent name definitions
*/
/******************************************************************************/

#define	NOVA_ARCHIVE_ADD_DB_CHANNEL_ID	nova_archive_add_db_channel_id
#define	NOVA_ARCHIVE_DB_CONNECT		nova_archive_db_connect
#define	NOVA_ARCHIVE_GET_DB_CHANNEL_ID	nova_archive_get_db_channel_id
#define	NOVA_ARCHIVE_GET_DB_SCHEMA	nova_archive_get_db_schema

#endif