You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.1 KiB
C++

/********************************************************************************
*
* Copyright (C) 1999-2000 SCADA Technology Control Co., Ltd. All rights reserved.
*
* 读配置文件的调用接口函数 之
* 修改/添加一个新的配置项
*
* 创建日期: 2002/01/21
*
*
*
* $Name: $
*
* $Revision: 1.2 $
*
* $Date: 2006/08/04 03:37:33 $
*
* $State: Exp $
*
* $Log: conf_write_key.cpp,v $
* Revision 1.2 2006/08/04 03:37:33 zhuzhenhua
* no message
*
* Revision 1.1.2.1 2006/07/28 07:54:02 zhuzhenhua
* no message
*
* Revision 1.2 2003/01/02 03:14:51 scada
* trim substitution line
*
* Revision 1.1.1.1 2002/08/21 07:16:39 harold
* temporarily import
*
* Revision 1.5 2002/03/20 03:40:22 harold
* no message
*
* Revision 1.1.1.1 2002/03/15 13:43:21 harold
* no message
*
* Revision 1.1.1.1 2002/03/15 08:17:11 harold
* no message
*
* Revision 1.4 2002/01/23 05:41:06 harold
* no message
*
* Revision 1.3 2002/01/23 03:35:41 harold
* no message
*
* Revision 1.2 2002/01/23 03:26:24 harold
* no message
*
* Revision 1.1 2002/01/21 02:46:53 harold
* no message
*
*
*
********************************************************************************/
//#include <util/util.h>
#include "confrw_errno.h"
#include "confrw.h"
#include "_confrw.h"
#include "typedef.h"
#include "Profile_Hash.h"
/*
* 修改/添加一个新的配置项
*
* 参数
* handle -- 配置文件句柄
* pszsec_name -- 段名
* pszkey_name -- 键名
* pszkey_value -- 键的值
* force_insert -- 如果(段, 键)不存在, 是否需要插入该(段, 键)的配置值,
* 如果该参数等于0, 则不插入该配置项, 否则, 插入该配置项.
*
* 返回值
* SUCCESS -- 成功
* 其它 -- 失败代码
*
*/
int conf_write_key ( void * handle,
const char * pszsec_name,
const char * pszkey_name,
const char * pszkey_value,
int force_insert )
{
return write_pgcprofile_string ( pszsec_name,
pszkey_name,
pszkey_value,
force_insert ? PGCTRUE : PGCFALSE,
(HPROFILE)*(int *)handle );
}