/* Database import/export header.
   Rick Smereka, Copyright (C) 2003

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

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

   You should have received a copy of the GNU General Public License
   along with this program; if not, get a copy via the Internet at
   http://gnu.org/copyleft/gpl.html or write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
   MA 02111-1307 USA

   You can contact the author via email at rsmereka@future-lab.com

   Original Linux version Mar/2003, Rick Smereka */

/* name of 'Bbuuzzb' IEX config table */

#define IEX_CONFIG_TABLE_NAME "iex.config"

/* any element of the config table that may
   have multiple parameters will be delimited
   by this character */

#define IEXLIB_CONFIG_SPEC_SEP ','

/* IEX config table layout */

#define IEX_CONFIG_FIELD_PROFILE_NAME 1
#define IEX_CONFIG_FIELD_COMMENT 2
#define IEX_CONFIG_FIELD_TYPE 3
#define IEX_CONFIG_FIELD_FORMAT 4
#define IEX_CONFIG_FIELD_SPECS 5
#define IEX_CONFIG_FIELD_AUTO_REC 6
#define IEX_CONFIG_FIELD_MATCH 7 /* optional */
#define IEX_CONFIG_FIELD_NULL 8  /* optional */
#define IEX_CONFIG_MIN_ALLOW_FIELDS 6

/* specs subsubfield layout */

#define IEX_CONFIG_SUBSUBFIELD_SOURCE 1
#define IEX_CONFIG_SUBSUBFIELD_CONV 2
#define IEX_CONFIG_SUBSUBFIELD_DEST 3

/* conversion types */
/* import */

#define IEX_CONV_TYPE_IFXP 0
#define IEX_CONV_TYPE_ITIME 1
#define IEX_CONV_TYPE_IINT 2
#define IEX_CONV_TYPE_IWINDDIR 3
#define IEX_CONV_TYPE_IMONTH 4
#define IEX_CONV_TYPE_IPINT 5
#define IEX_CONV_TYPE_UNKNOWN -1
#define IEX_CONV_IMAXTYPE 6

/* import/export spec structure */

struct iex_spec
   {
   int source;
   int source_add1;
   int source_add2;
   int conversion;
   int conversion_parm;
   int dest;
   int dest_add1;
   int dest_add2;
   struct iex_spec *next;
   };

/* NULL link list */

#define IEX_OT_NULL ((struct iex_spec *)NULL)
#define IEXLIB_SCALE_WIND_DIR 1
#define IEXLIB_LL_PARM_NULL -1

#ifdef __cplusplus
extern "C"
{
#endif

int iexlib_import(char *, char *, char *);
int iexlib_start(char *);
void iexlib_stop(void);
int iexlib_active(void);
void iexlib_dump(void);
int iexlib_import_do_line(int, char *);

#ifdef __cplusplus
}
#endif
