/* GtkCAD - A free modular CAD/CAE/CAM software
 *
 * Copyright (C) 2000-2002 H. James Parker <hopeye@cfl.rr.com>
 *
 * 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; either
 * version 2 of the License, or (at your option) any later 
 * version.
 *
 * 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; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

/* --- test.h ---
 *
 * Change Log:
 *
 * 13 Mar 02 - Created file;
 */

/*
 * --- Include files
 */
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <gtk/gtk.h>


/*
 * --- Define Statements
 */
#define SUCCESS 0
#define FAILURE 1

#define SMALL   1.0
#define NORMAL  2.0
#define BIG     3.0

/*
 * --- Data structures
 */

typedef struct {
   int        color;
   int        size;
   int        part;
   int        group;
   int        layer;
} typCurrent;

typedef struct {
  int    id;
  float  x;
  float  y;
  float  z;
  int    saved;
  int    modified;
  int    deleted;
} typPoint;


/*
 * --- Function prototypes
 */
 
int     db_get_points          (void);
int     db_process_point_query (void);
int     db_find_point          (int point_id);
int     db_add_point           (typPoint *point);
int     db_edit_point          (typPoint *point);
int     db_delete_point        (int point_id);
int     db_connect_ecpg        (char *database);
int     db_cleanup             (void);
int     db_createdb            (char *dbname);
int     db_save                (void);
int     db_selectdb            (void);

GSList *insert_point  (GSList *list, gint id , gfloat x, gfloat y, gfloat z,
		       int saved, int modified, int deleted);



/*
 * --- Internal Global Variables
 */

extern typPoint   point;
extern typCurrent currentType;

extern GSList    *points;
extern GSList    *pnode;
extern typPoint  *point_t;

extern char server[50];
extern char database[25];
extern char connection[25];
extern char login[25];
extern char password[25];