man3cf/SaveCONFIG_TBL

Table of Contents

Name

SaveCONFIG_TBL - save a configuration table to a file

Description

SaveCONFIG_TBL creates a new configuration file. It reads name entries from an old file and looks for a match in a CONFIG_TBL array.

If a match is found the value field from the CONFIG_TBL array is written to the new file.

Lines starting with a # are treated as comments and written to the output file without change. Lines that don’t have a matching entry in the program’s CONFIG_TBL are also written to the output file without change.

This function is part of libconfig.

Syntax

int SaveCONFIG_TBL(
   CONFIG_TBL CFTpnt[],

   int Size,

   char *FNold,

   char *FNnew

   );

Arguments

CFTpnt

pointer to the CONFIG_TBL array.

Size

size of the CONFIG_TBL array.

FNold

pathname of the old file

FNnew

pathname of the new file

Return Value

0 is returned on success, -1 is returned on errors and a message is printed to stderr. It is left to the program using this function to decide what the error is and create the config file if necessary.

See Also

BldCONFIG_TBLfn(3cf) , ClearCONFIG_TBL(3cf) , CopyCONFIG_TBL(3cf) , CreateCONFIG_TBL(3cf) , FindCONFIG_TBL(3cf) , LoadCONFIG_TBL(3cf) , PrintCONFIG_TBL(3cf) , libconfigtbl(3cf)

Notes

It’s possible some of the error msgs with be eliminated in the future because they can be annoying.

Manual page revision

$Id: SaveCONFIG_TBL.3,v 1.2 2002/04/07 18:46:04 kitchen Exp $


Table of Contents