/*
 ******************************************************************************
 *  Copyright 1984-1996 United States Data Corporation. All Rights Reserved.
 ******************************************************************************
 *                                - NOTICE -
 *
 *  The information contained herein is confidential information of United
 *  States Data Corporation, a Delaware corporation, and is protected by
 *  United States copyright and trade secret law and international treaties.
 *  This information is not to be disclosed, used or copied by or transferred
 *  to any individual, corporation, company or other person without the
 *  express written permission of United States Data Corporation.
 ******************************************************************************
 */

#ifndef _FLCFG_INCLUDED
#define _FLCFG_INCLUDED

/*
 ************************************************************************
 *                            Constants                                 *
 ************************************************************************
 */

/* Error codes */
#define FLCFG_E_GOOD      (0)
#define FLCFG_E_INTERNAL  (-1)
#define FLCFG_E_INVARG    (-2)
#define FLCFG_E_MEMORY    (-3)
#define FLCFG_E_MULTSESS  (-4)
#define FLCFG_E_NOFILE    (-5)
#define FLCFG_E_NOACLOAD  (-6)
#define FLCFG_E_CDBCLOSED (-7)
#define FLCFG_E_ENDOFSEL  (-8)
#define FLCFG_E_NOTFOUND  (-9)
#define FLCFG_E_ISOPEN    (-10)
#define FLCFG_E_ACLOAD    (-11)
#define FLCFG_E_ACMAP     (-12)
#define FLCFG_E_APPOPEN   (-13)
#define FLCFG_E_BADRELATE (-14)
#define FLCFG_E_DBERROR   (-15)
#define FLCFG_E_DBLOCK    (-16)
#define FLCFG_E_VALERR    (-17)
#define FLCFG_E_SELBEGUN  (-18)
#define FLCFG_E_NOSELBGN  (-19)
#define FLCFG_E_NOSEL1ST  (-20)
#define FLCFG_E_INVUPD    (-21)
#define FLCFG_E_RSVDTBL   (-22)
#define FLCFG_E_REFEXIST  (-23)
#define FLCFG_E_TAGEDIT   (-24)
#define FLCFG_E_TEXTONE   (-25)
#define FLCFG_E_BADEXPR   (-26)
#define FLCFG_E_NOEXPRMATCH (-27)
#define FLCFG_E_NOTCOMP   (-28)
#define FLCFG_E_CDBOPEN   (-29)
#define FLCFG_E_NEEDDOMAIN (-30)

/* TAG attribute IDs */
#define FLCFGTAG_ATTR_IDSEQ    (0x0100)
#define FLCFGTAG_ATTR_NAME     ((1L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_DOMAIN   ((2L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_DIMEN    ((3L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_TYPE     ((4L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_DESCR    ((5L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_DFLTVAL  ((6L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_MSGLEN   ((7L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_PERWHEN  ((8L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_CHGBITS  ((9L) + FLCFGTAG_ATTR_IDSEQ)
#define FLCFGTAG_ATTR_FLAGS    ((10L) + FLCFGTAG_ATTR_IDSEQ)

/* field types */
#define FLCFGFLD_FLAG_IDSEQ      (0x0200)
#define FLCFGFLD_FLAG_BLANK      ((1L) + FLCFGFLD_FLAG_IDSEQ)
#define FLCFGFLD_FLAG_READONLY   ((2L) + FLCFGFLD_FLAG_IDSEQ)
#define FLCFGFLD_FLAG_RANGE      ((3L) + FLCFGFLD_FLAG_IDSEQ)
#define FLCFGFLD_FLAG_OCTAL      ((4L) + FLCFGFLD_FLAG_IDSEQ)
#define FLCFGFLD_FLAG_HEX        ((5L) + FLCFGFLD_FLAG_IDSEQ)
#define FLCFGFLD_FLAG_UPPERCASE  ((6L) + FLCFGFLD_FLAG_IDSEQ)

/* field flags */
#define FLCFGFLD_TYPE_IDSEQ      (0x0300)
#define FLCFGFLD_TYPE_CHARACTER  ((1L) + FLCFGFLD_TYPE_IDSEQ)
#define FLCFGFLD_TYPE_NUMBER     ((2L) + FLCFGFLD_TYPE_IDSEQ)
#define FLCFGFLD_TYPE_KEY        ((3L) + FLCFGFLD_TYPE_IDSEQ)
#define FLCFGFLD_TYPE_TAG        ((4L) + FLCFGFLD_TYPE_IDSEQ)
#define FLCFGFLD_TYPE_TAGCHAR    ((5L) + FLCFGFLD_TYPE_IDSEQ)
#define FLCFGFLD_TYPE_TAGNUM     ((6L) + FLCFGFLD_TYPE_IDSEQ)
#define FLCFGFLD_TYPE_TAGKEY     ((7L) + FLCFGFLD_TYPE_IDSEQ)

/* XREF attribute ID's */
#define FLCFGXREF_TYPE_IDSEQ     (0x0400)
#define FLCFGXREF_ATTR_NAME              ((1L) + FLCFGXREF_TYPE_IDSEQ)
#define FLCFGXREF_ATTR_DIMEN     ((2L) + FLCFGXREF_TYPE_IDSEQ)
#define FLCFGXREF_ATTR_DOMAIN    ((3L) + FLCFGXREF_TYPE_IDSEQ)
#define FLCFGXREF_ATTR_TASK      ((4L) + FLCFGXREF_TYPE_IDSEQ)
#define FLCFGXREF_ATTR_CTNAME    ((5L) + FLCFGXREF_TYPE_IDSEQ)
#define FLCFGXREF_ATTR_TBLNAM    ((6L) + FLCFGXREF_TYPE_IDSEQ)
#define FLCFGXREF_ATTR_RECID     ((7L) + FLCFGXREF_TYPE_IDSEQ)
#define FLCFGXREF_ATTR_COLUMN    ((8L) + FLCFGXREF_TYPE_IDSEQ)
#define FLCFGXREF_ATTR_SUBRID    ((9L) + FLCFGXREF_TYPE_IDSEQ)

/*
 ************************************************************************
 *                              Types                                   *
 ************************************************************************
 */

/*
 *  To keep the internal FLCM structures opaque, define them as void
 *  if the AC/TAGEDIT header has not been included.
 */
#ifdef _AC_INCLUDED
typedef  ACMGR   vACMGR;
typedef  ACMREC  flCfgAC;
typedef  CT      flCfgCDB;
typedef  CTDOM   flCfgDom;
typedef  SELECT  flCfgSel;
typedef  CTFLD   flCfgFld;
typedef  CTSEQ   flCfgSeq;
typedef  CTKLST  flCfgKey;
typedef  CT      flCfgText;
typedef  CDBEXPR flCfgCDBExpr;
typedef  CTRLFLD flCfgCtrl;
#else
typedef  struct {void *opaque;} vACMGR;
typedef  struct {void *opaque;} flCfgAC;
typedef  struct {void *opaque;} flCfgCDB;
typedef  struct {void *opaque;} flCfgDom;
typedef  struct {void *opaque;} flCfgSel;
typedef  struct {void *opaque;} flCfgFld;
typedef  struct {void *opaque;} flCfgSeq;
typedef  struct {void *opaque;} flCfgKey;
typedef  struct {void *opaque;} flCfgText;
typedef  struct {void *opaque;} flCfgCDBExpr;
typedef  struct {void *opaque;} flCfgCtrl;
#endif

#ifdef _TAGEDIT_INCLUDED
typedef  TG_DEF  flCfgTag;
typedef  XREFSTRUCT flCfgXREF;
#else
typedef  struct {void *opaque;} flCfgTag;
typedef  struct {void *opaque;} flCfgXREF;
#endif

/*
 *  FLINK/FLAPP session handle.  
 */
typedef struct
{
	char    *flink;
	char    *flapp;
	vACMGR  *acmgr;

} flCfgSess;

/*
 * flcfg_msgbox_handler() button bit mask.
 */
#define FLCFG_MBOX_OK        0x0000  /* Message box types */
#define FLCFG_MBOX_OKCANCEL  0x0001

#define FLCFG_MBID_OK        0x0000  /* Button return codes */
#define FLCFG_MBID_CANCEL    0x0001

/* Message box callback routine - user can override printf's */
typedef int (*FLCFG_MBH)(char *title, char *msg, int boxtype);  

/*
 *  Validation error description structure.
 */
#define MAXLEN_CTNAME   16
#define MAXLEN_FLDNAME  16
#define MAXLEN_FLDVALUE 256
#define MAXLEN_ERRMSG   128
typedef struct
{
	char    ctname[MAXLEN_CTNAME+1];
	char    fldname[MAXLEN_FLDNAME+1];
	char    fldvalue[MAXLEN_FLDVALUE+1];
	char    valmsg[MAXLEN_ERRMSG+1];
} flCfgValErr;

/*
 ************************************************************************
 *                            Prototypes                                *
 ************************************************************************
 */
#define DLLEXPORT _declspec(dllexport)

#ifdef __cplusplus
extern "C" {    
#endif

DLLEXPORT int   flCfg_get_define_name(long defval, char** defname);
DLLEXPORT int   flCfg_get_define_value(char* defname, long* defval);
DLLEXPORT void  flCfg_set_msgbox_handler(FLCFG_MBH mbh);

DLLEXPORT int   flCfgSess_open(char *flink, char *flapp, flCfgSess **sess);
DLLEXPORT int   flCfgSess_close(flCfgSess **sess);
DLLEXPORT int   flCfgSess_num_ac(flCfgSess *sess);
DLLEXPORT int   flCfgSess_nth_ac(flCfgSess *sess, int n, flCfgAC **cfgacp);

DLLEXPORT void  flCfgSess_set_fl6_compat(int val);

DLLEXPORT int   flCfgAC_open_cdbs(flCfgAC *cfgacp, int create);
DLLEXPORT int   flCfgAC_close_cdbs(flCfgAC *cfgacp);
DLLEXPORT char* flCfgAC_get_execstr(flCfgAC *cfgacp);
DLLEXPORT char* flCfgAC_get_filename(flCfgAC *cfgacp);
DLLEXPORT char* flCfgAC_get_guid(flCfgAC *cfgacp);
DLLEXPORT char* flCfgAC_get_task(flCfgAC *cfgacp);
DLLEXPORT char* flCfgAC_get_title(flCfgAC *cfgacp);
DLLEXPORT int   flCfgAC_num_hdrcdb(flCfgAC *cfgacp);
DLLEXPORT int   flCfgAC_nth_hdrcdb(flCfgAC *cfgacp, int n, flCfgCDB **cfgcdbp);
DLLEXPORT int   flCfgAC_num_text(flCfgAC *cfgacp);
DLLEXPORT int   flCfgAC_nth_text(flCfgAC *cfgacp, int n, flCfgText **cfgtxtp);

DLLEXPORT char* flCfgCDB_get_name(flCfgCDB *cfgcdbp);
DLLEXPORT char* flCfgCDB_get_title(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_num_relatecdb(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_nth_relatecdb(flCfgCDB *cfgcdbp, int n, flCfgCDB **relcdbp);
DLLEXPORT int   flCfgCDB_get_domfld(flCfgCDB *cfgcdbp, flCfgDom **cfgdomp);
DLLEXPORT int   flCfgCDB_num_selfld(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_nth_selfld(flCfgCDB *cfgcdbp, int n, flCfgSel **cfgselp);
DLLEXPORT int   flCfgCDB_find_selfld(flCfgCDB *cfgcdbp, char *fldname, flCfgSel **cfgselp);
DLLEXPORT int   flCfgCDB_num_fld(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_nth_fld(flCfgCDB *cfgcdbp, int n, flCfgFld **cfgfldp);
DLLEXPORT int   flCfgCDB_find_fld(flCfgCDB *cfgcdbp, char *fldname, flCfgFld **cfgfldp);
DLLEXPORT int   flCfgCDB_get_seqfld(flCfgCDB *cfgcdbp, flCfgSeq **cfgseqp);
DLLEXPORT int   flCfgCDB_get_RowIDfld(flCfgCDB *cfgcdbp, flCfgFld **cfgfldp);

DLLEXPORT int   flCfgCDB_select_begin(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_criteria(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_current(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_delete(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_end(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_first(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_last(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_next(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_previous(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_select_update(flCfgCDB *cfgcdbp, flCfgValErr *valerr);
DLLEXPORT int   flCfgCDB_select_skip(flCfgCDB *cfgcdbp, long offset);
DLLEXPORT int   flCfgCDB_select_last_ex(flCfgCDB *cfgcdbp, long offset);

DLLEXPORT int   flCfgCDB_rowno(flCfgCDB *cfgcdbp, long *rowno);
DLLEXPORT int   flCfgCDB_select_rowno(flCfgCDB *cfgcdbp, long rowno);

DLLEXPORT int   flCfgCDB_lock(flCfgCDB *cfgcdbp, int incl_relcdbs);
DLLEXPORT int   flCfgCDB_unlock(flCfgCDB *cfgcdbp, int incl_relcdbs);

DLLEXPORT int   flCfgCDB_create_expr(flCfgCDB *cfgcdbp, char *expr, flCfgCDBExpr *cfgexpr);
DLLEXPORT int   flCfgCDB_evaluate_expr(flCfgCDBExpr cfgexpr);
DLLEXPORT void  flCfgCDB_destroy_expr(flCfgCDBExpr *cfgexpr);

DLLEXPORT int   flCfgCDB_set_filter (flCfgCDB *cfgcdbp, char *filterstr);
DLLEXPORT int   flCfgCDB_reset_filter(flCfgCDB *cfgcdbp);

DLLEXPORT int   flCfgCDB_row_insert(flCfgCDB *cfgcdbp, flCfgValErr *valerr);
DLLEXPORT int   flCfgCDB_row_validate(flCfgCDB *cfgcdbp, flCfgValErr *valerr);

DLLEXPORT int   flCfgCDB_count (flCfgCDB *cfgcdbp, long *count);

DLLEXPORT char* flCfgCDB_get_dialog_name(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_get_dialog_id(flCfgCDB *cfgcdbp);

DLLEXPORT int   flCfgCDB_num_ctrlfld(flCfgCDB *cfgcdbp);
DLLEXPORT int   flCfgCDB_nth_ctrlfld(flCfgCDB *cfgcdbp, int n, flCfgCtrl **cfgctrlp);


DLLEXPORT int   flCfgCDB_select_rowid(flCfgCDB *cfgcdbp, char *rowid);
DLLEXPORT char* flCfgRowID_get_name(flCfgFld *cfgcdbp);
DLLEXPORT int   flCfgRowID_get_size(flCfgFld *cfgcdbp);
DLLEXPORT int   flCfgRowID_get_value(flCfgFld *cfgcdbp, char *value, long len);
DLLEXPORT int   flCfgRowID_set_value(flCfgFld *cfgcdbp, char *value);
DLLEXPORT int   flCfgRowID_set_autogen(flCfgFld *cfgcdbp, int val);

DLLEXPORT int   flCfgCDB_help_fld(flCfgCDB *cfgcdbp, flCfgFld *cfgfldp,
                                  char *hlptext, int len);
DLLEXPORT int   flCfgCDB_help_table(flCfgCDB *cfgcdbp, char *hlptext, int len);

DLLEXPORT int   flCfgCtrl_get_id(flCfgCtrl *cfgctrlp);
DLLEXPORT char* flCfgCtrl_get_name(flCfgCtrl *cfgctrlp);

DLLEXPORT char* flCfgDom_get_name(flCfgDom *cfgdomp);
DLLEXPORT int   flCfgDom_get_size(flCfgDom *cfgdomp);
DLLEXPORT int   flCfgDom_get_value(flCfgDom *cfgdomp, char *domval, int maxlen);
DLLEXPORT int   flCfgDom_set_value(flCfgDom *cfgdomp, char *domval);

DLLEXPORT char* flCfgSel_get_name(flCfgSel *cfgselp);
DLLEXPORT char* flCfgSel_get_title(flCfgSel *cfgselp);
DLLEXPORT int   flCfgSel_get_size(flCfgSel *cfgselp);
DLLEXPORT int   flCfgSel_get_value(flCfgSel *cfgselp, char *value, int maxlen);
DLLEXPORT int   flCfgSel_set_value(flCfgSel *cfgselp, char *value);

DLLEXPORT char* flCfgSel_get_rel_hdrname(flCfgSel *cfgselp);
DLLEXPORT int   flCfgSel_get_fldid(flCfgSel *cfgselp);
DLLEXPORT char* flCfgSel_get_rel_fldname(flCfgSel *cfgselp);

DLLEXPORT char* flCfgFld_get_default_tagtype(flCfgFld *cfgfldp); 
DLLEXPORT char* flCfgFld_get_default_value(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_get_flag(flCfgFld *cfgfldp, int id);
DLLEXPORT char* flCfgFld_get_high(flCfgFld *cfgfldp); 
DLLEXPORT int   flCfgFld_get_key_tagtypes(flCfgFld *cfgfldp, flCfgKey** cfgkeyp);
DLLEXPORT int   flCfgFld_get_key_values(flCfgFld *cfgfldp, flCfgKey** cfgkeyp);
DLLEXPORT char* flCfgFld_get_low(flCfgFld *cfgfldp);
DLLEXPORT char* flCfgFld_get_name(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_get_precision(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_get_size(flCfgFld *cfgfldp); 
DLLEXPORT char* flCfgFld_get_title(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_get_title_width(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_get_type(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_get_value(flCfgFld *cfgfldp, char *value, int maxlen);
DLLEXPORT int   flCfgFld_set_value(flCfgFld *cfgfldp, char *value);
DLLEXPORT char* flCfgFld_get_validlist_ctname(flCfgFld *cfgfldp);
DLLEXPORT char* flCfgFld_get_validlist_colname(flCfgFld *cfgfldp);
DLLEXPORT char* flCfgFld_get_validlist_comcolname(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_get_resid(flCfgFld *cfgfldp);
DLLEXPORT char* flCfgFld_get_structag_parent(flCfgFld *cfgfldp);
DLLEXPORT char* flCfgFld_get_structag_ext(flCfgFld *cfgfldp);
DLLEXPORT char* flCfgFld_get_structag_persist(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_get_disptype(flCfgFld *cfgfldp);
DLLEXPORT int   flCfgFld_is_ptag(flCfgFld *cfgfldp);

DLLEXPORT char* flCfgKey_get_filename(flCfgKey *cfgkeyp);
DLLEXPORT int   flCfgKey_num(flCfgKey *cfgkeyp);
DLLEXPORT int   flCfgKey_nth_label(flCfgKey *cfgkeyp, int n, char **label);
DLLEXPORT int   flCfgKey_nth_token(flCfgKey *cfgkeyp, int n, char **token);
DLLEXPORT int   flCfgKey_nth_id(flCfgKey *cfgkeyp, int n, long *id);

DLLEXPORT char* flCfgSeq_get_name(flCfgSeq *cfgseqp);
DLLEXPORT int   flCfgSeq_get_size(flCfgSeq *cfgseqp);
DLLEXPORT int   flCfgSeq_get_value(flCfgSeq *cfgseqp, long *value);
DLLEXPORT int   flCfgSeq_set_value(flCfgSeq *cfgseqp, long value);

DLLEXPORT int   flCfgObj_add(flCfgCDB *objp, flCfgTag *tagp, flCfgValErr *valerr);
DLLEXPORT int   flCfgObj_get_cdb(flCfgSess *sessp, flCfgCDB **objp);
DLLEXPORT int   flCfgObj_select_begin(flCfgCDB *objp);
DLLEXPORT int   flCfgObj_select_current(flCfgCDB *objp, flCfgTag *tagp);
DLLEXPORT int   flCfgObj_select_delete(flCfgCDB *objp);
DLLEXPORT int   flCfgObj_select_end(flCfgCDB *objp);
DLLEXPORT int   flCfgObj_select_first(flCfgCDB *objp, flCfgTag *tagp);
DLLEXPORT int   flCfgObj_select_last(flCfgCDB *objp, flCfgTag *tagp);
DLLEXPORT int   flCfgObj_select_next(flCfgCDB *objp, flCfgTag *tagp);
DLLEXPORT int   flCfgObj_select_previous(flCfgCDB *objp, flCfgTag *tagp);
DLLEXPORT int   flCfgObj_select_name(flCfgCDB *objp, char *name, flCfgTag *tagp);
DLLEXPORT int   flCfgObj_select_skip(flCfgCDB *objp, long offset);
DLLEXPORT int   flCfgObj_select_update(flCfgCDB *objp, flCfgTag *tagp, flCfgValErr *valerr);
DLLEXPORT int   flCfgObj_validate(flCfgCDB *objp, flCfgTag *tagp, flCfgValErr *valerr);

DLLEXPORT int   flCfgObj_create_expr(flCfgCDB *objp, char *expr, flCfgCDBExpr *cfgexpr);
DLLEXPORT int   flCfgObj_evaluate_expr(flCfgCDBExpr cfgexpr);
DLLEXPORT void  flCfgObj_destroy_expr(flCfgCDBExpr *cfgexpr);

DLLEXPORT int   flCfgObj_set_filter (flCfgCDB *objp, char *filterstr);
DLLEXPORT int   flCfgObj_reset_filter(flCfgCDB *objp);

DLLEXPORT int   flCfgObj_count (flCfgCDB *objp, long *count);

DLLEXPORT int   flCfgTag_create(flCfgTag **tagp);
DLLEXPORT int   flCfgTag_destroy(flCfgTag **tagp);
DLLEXPORT int   flCfgTag_clear_attrvals(flCfgTag *tagp);
DLLEXPORT int   flCfgTag_get_attrval(flCfgTag *tagp, int id, char *val, int mlen);
DLLEXPORT int   flCfgTag_get_attrvalp(flCfgTag *tagp, int id, char **val);
DLLEXPORT int   flCfgTag_set_attrval(flCfgTag *tagp, int id, char *val);

DLLEXPORT int   flCfgText_get_domain(flCfgText *cfgtxtp, char **domain);
DLLEXPORT int   flCfgText_get_filepath(flCfgText *cfgtxtp, char **fpath);
DLLEXPORT char* flCfgText_get_filespec(flCfgText *cfgtxtp);
DLLEXPORT char* flCfgText_get_title(flCfgText *cfgtxtp);
DLLEXPORT int   flCfgText_select_begin(flCfgText *cfgtxtp);
DLLEXPORT int   flCfgText_select_first(flCfgText *cfgtxtp);
DLLEXPORT int   flCfgText_select_next(flCfgText *cfgtxtp);
DLLEXPORT int   flCfgText_select_end(flCfgText *cfgtxtp);
DLLEXPORT int   flCfgText_set_domain(flCfgText *cfgtxtp, char *domain);
DLLEXPORT char*   flCfgText_get_name(flCfgText *cfgtxtp);

DLLEXPORT int   flCfgValErr_create(flCfgValErr **valerr);
DLLEXPORT int   flCfgValErr_clear(flCfgValErr *valerr);
DLLEXPORT int   flCfgValErr_destroy(flCfgValErr **valerr);
DLLEXPORT char* flCfgValErr_get_ctname(flCfgValErr *valerr);
DLLEXPORT char* flCfgValErr_get_fldname(flCfgValErr *valerr);
DLLEXPORT char* flCfgValErr_get_fldvalue(flCfgValErr *valerr);
DLLEXPORT char* flCfgValErr_get_valmsg(flCfgValErr *valerr);
DLLEXPORT void  flCfgValErr_set(flCfgValErr *valerr, char*, char*, char*, char*);
DLLEXPORT void  flCfgValErr_set_ctname(flCfgValErr *valerr, char *ctname);
DLLEXPORT void  flCfgValErr_set_fldname(flCfgValErr *valerr, char *fldname);
DLLEXPORT void  flCfgValErr_set_fldvalue(flCfgValErr *valerr, char *fldvalue);
DLLEXPORT void  flCfgValErr_set_valmsg(flCfgValErr *valerr, char *valmsg);

DLLEXPORT int   flCfgXREF_get_cdb(flCfgSess *sessp, flCfgCDB **objp);
DLLEXPORT int   flCfgXREF_select_begin(flCfgCDB *objp);
DLLEXPORT int   flCfgXREF_select_current(flCfgCDB *objp, flCfgXREF *xrefp);
DLLEXPORT int   flCfgXREF_select_end(flCfgCDB *objp);
DLLEXPORT int   flCfgXREF_select_first(flCfgCDB *objp, flCfgXREF *xrefp);
DLLEXPORT int   flCfgXREF_select_last(flCfgCDB *objp, flCfgXREF *xrefp);
DLLEXPORT int   flCfgXREF_select_next(flCfgCDB *objp, flCfgXREF *xrefp);
DLLEXPORT int   flCfgXREF_select_previous(flCfgCDB *objp, flCfgXREF *xrefp);
DLLEXPORT int   flCfgXREF_select_name(flCfgCDB *objp, char *name, flCfgXREF *xrefp);
DLLEXPORT int   flCfgXREF_select_skip(flCfgCDB *objp, long offset);

DLLEXPORT int   flCfgXREF_create(flCfgXREF **xrefp);
DLLEXPORT int   flCfgXREF_destroy(flCfgXREF **xrefp);
DLLEXPORT int   flCfgXREF_clear_attrvals(flCfgXREF *xrefp);
DLLEXPORT int   flCfgXREF_get_attrval(flCfgXREF *xrefp, int id, char *val, int mlen);
DLLEXPORT int   flCfgXREF_get_attrvalp(flCfgXREF *xrefp, int id, char **val);

DLLEXPORT int   flCfgXREF_create_expr(flCfgCDB *xrefp, char *expr, flCfgCDBExpr *cfgexpr);
DLLEXPORT int   flCfgXREF_evaluate_expr(flCfgCDBExpr cfgexpr);
DLLEXPORT void  flCfgXREF_destroy_expr(flCfgCDBExpr *cfgexpr);

DLLEXPORT int   flCfgXREF_set_filter (flCfgCDB *xrefp, char *filterstr);
DLLEXPORT int   flCfgXREF_reset_filter(flCfgCDB *xrefp);

DLLEXPORT int   flCfgXREF_count (flCfgCDB *xrefp, long *count);

#ifdef __cplusplus
}
#endif

#endif

