// DbiCfg Interface Unit
// Copyright Borland International, 1997

function DbiOpenConfigFile (            { Open/Create configuration }
      pszDirPath    : PChar;            { Directory }
      bCreate       : Bool;             { TRUE to create/overwrite }
var   hCfg          : hDBICfg           { Handle to config }
   ): DBIResult stdcall;

function DbiCloseConfigFile (           { Close the config file }
var   hCfg          : hDBICfg;          { Handle }
      bSave         : Bool;             { To save the changes }
      bDefault      : Bool;             { To make this file the default }
      bSaveAs16     : Bool              { To save as a 16-bit config file }
   ): DBIResult stdcall;

function DbiCfgSave (                   { Save current configuration }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszNewFile    : PChar;            { (Optional): Save as this file }
      bSaveAs16     : Bool              { To save as a 16-bit config file }
   ): DBIResult stdcall;

function DbiCfgBuildPath (              { Build a path for accessing config. }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszCategory   : PChar;            { NULL for root }
      pszGroup      : PChar;            { NULL for no group }
      pszSection    : PChar;            { NULL fro no section }
      pszCfgPath    : PChar             { Returned path }
   ): DBIResult stdcall;

function DbiCfgPosition (               { Position the config path }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszCfgPath    : PChar             { Path }
   ): DBIResult stdcall;

function DbiCfgGetNextNode (            { Get next defined node }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszNodeName   : PChar             { Node name (Returned) }
   ): DBIResult stdcall;

function DbiCfgGetRecord (              { Get a record }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszCfgPath    : PChar;            { Path }
var   iFields       : Word;             { Returned nbr of fields }
      pfldDesc      : pFLDDesc;         { Field descriptors }
      pRec          : Pointer           { Field values }
   ): DBIResult stdcall;

function DbiCfgAddRecord (              { Add a record }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszCfgPath    : PChar;            { Path }
      iFields       : Word;             { No of fields }
      pfldDesc      : pFLDDesc;         { Field descriptors }
      pRec          : Pointer           { Data values }
   ): DBIResult stdcall;

function DbiCfgModifyRecord (           { Modify a record }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszCfgPath    : PChar;            { Path }
      iFields       : Word;             { Nbr of fields }
      pfldDesc      : pFLDDesc;         { Field descriptors }
      pRec          : Pointer           { Data values }
   ): DBIResult stdcall;

function DbiCfgDropRecord (             { Delete a record }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszCfgPath    : PChar             { Path }
   ): DBIResult stdcall;

function DbiCfgTranslate (              { Translate configuration string }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszConfigPath : PChar;            { configuration path }
      pszTrans      : PChar;            { translated path }
      iFields       : Word;             { number of fields, 0 if path only }
      pfldDesc      : pFLDDesc;         { field descriptors, NULL if path only }
      pRec          : Pointer           { record buffer, NULL if path only }
   ): DBIResult stdcall;

function DbiCfgGetHelp (                { Get help message }
      hCfg          : hDBICfg;          { Config Handle/NULL }
      pszConfigPath : PChar;            { configuration path }
      pszFldName    : PChar;            { field name  ( optional ) }
      pszHelpString : PChar             { help string ( returned ) }
   ): DBIResult stdcall;

function DbiCfgMerge (                  { Merge config files }
      hCfgDest      : hDBICfg;          { Destination Cfg handle/ NULL }
      hCfgSrc       : hDBICfg;          { Source Cfg handle/ NULL }
      pszSrcPath    : PChar             { Source Path / NULL }
   ): DBIResult stdcall;
