/* See the copyright notice (COPYRIGHT) in this directory. */

/*
 * NAME
 *	pg_link
 *
 * SYNOPSIS
 *	#include "libgendb.h"
 *
 * DESCRIPTION
 *	This file resolves public symbols.
 *
 * DIAGNOSTICS
 *	Functions which return pointers will return NULL if an error
 *	occurred.  Functions which return a non-negative int will return 
 *	-1 if an error occurred.
 *
 * FILES
 *	pg_link.c (this file)
 *
 * SEE ALSO
 *	libgendb.h
 *
 * AUTHOR
 *	Jean Anderson
 */

#ifndef	lint
static char SccsId[] = "@(#)pg_link.c	16.2 8/3/93 Copyright (c) 1992-1993 Science Applications International Corporation";
#endif

#include "gdi_postgres.h"

dbFuncs *
pg_link ()
{
     static dbFuncs pg_funcs;
     static int first = 1;

     if (first)
     {
	  bzero (&pg_funcs, sizeof (dbFuncs));
	  
	  pg_funcs.open            = pg_open;
	  pg_funcs.close           = pg_close;
	  pg_funcs.dead            = pg_dead;
	  pg_funcs.open_channel    = pg_open_channel;
	  pg_funcs.close_channel   = pg_close_channel;
	  pg_funcs.channel_is_open = pg_channel_is_open;
	  pg_funcs.flush           = pg_flush;
	  pg_funcs.abort           = pg_abort;
	  pg_funcs.error_get       = pg_error_get;
	  pg_funcs.begin_tran      = pg_begin_tran;
	  pg_funcs.commit          = pg_commit;
	  pg_funcs.rollback        = pg_rollback;
	  pg_funcs.savepoint       = pg_savepoint;
	  pg_funcs.submit          = pg_submit;
	  pg_funcs.create_table    = pg_create_table;
	  pg_funcs.insert          = pg_insert;
	  pg_funcs.get_counter     = pg_get_counter;
	  pg_funcs.describe_object = pg_describe_object;
	  pg_funcs.what_is_object  = pg_what_is_object;
	  pg_funcs.describe_query  = pg_describe_query;
	  pg_funcs.temp_name       = pg_temp_name;
	  pg_funcs.set_date_mask   = pg_set_date_mask;
	  pg_funcs.get_date_mask   = pg_get_date_mask;
	  pg_funcs.trace           = pg_trace;
	  pg_funcs.print_conn      = pg_print_conn;

	  first = 0;
     }
     return (&pg_funcs);
}
