/****************************** Module Header ******************************* * * Module Name: deleteconfigtree.e * * E wrapper routine to access the NEPMD library DLL. * Include of nepmdlib.e. * * Copyright (c) Netlabs EPM Distribution Project 2002 * * $Id$ * * =========================================================================== * * This file is part of the Netlabs EPM Distribution package and 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, in version 2 as it comes in the "COPYING" file of the * Netlabs EPM Distribution. This library 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. * ****************************************************************************/ /* @@NepmdDeleteConfigTree@PROTOTYPE NepmdDeleteConfigTree( Handle, ConfPath) @@NepmdDeleteConfigTree@CATEGORY@CONFIG @@NepmdDeleteConfigTree@SYNTAX This function deletes a path and all subpaths of the configuration repository of the [=TITLE] installation. @@NepmdDeleteConfigTree@PARM@Handle This parameter determines the handle obtained by a previous call to [.IDPNL_EFUNC_NEPMDOPENCONFIG]. Use *-3* or *HINI__NEPMDPROFILE* to automatically insert the value of the universal var *nepmd__hini*. That's the handle returned by the initial opening of NEPMD.INI. You may pass an *empty string* or *-9* to [.IDPNL_REGISTRY_IMPLICITOPEN implicitely open and close] the configuration repository before and after this call. @@NepmdDeleteConfigTree@PARM@ConfPath This parameter specifies the [.IDPNL_REGISTRY_NAMESPACE path] that will be deleted. @@NepmdDeleteConfigTree@RETURNS *NepmdDeleteConfigTree* returns nothing. This procedure sets the implicit universal var *rc*. rc is set to an [inf:cp2 "Errors" OS/2 error code] or to zero for no error. @@NepmdDeleteConfigTree@TESTCASE You can test this function from the *EPM* commandline by executing: .sl - *NepmdDeleteConfigTree* [.IDPNL_EFUNC_NEPMDDELETECONFIGTREE_PARM ConfPath] For testing, you should better chose a path that can be rebuilt. *Example:* .fo text -- Ensure that keys exist CreateCodingStyleNameIndex -- Delete that tree NepmdDeleteConfigTree \NEPMD\Var\CodingStyles -- Recreate all keys CreateCodingStyleNameIndex .fo on @@ */ ; --------------------------------------------------------------------------- ; Allow editor command to call function ; --------------------------------------------------------------------------- compile if NEPMD_LIB_TEST defc NepmdDeleteConfigTree Handle = HINI_NEPMDPROFILE ConfPath = arg( 1) if (ConfPath = '') then sayerror 'No config path specified for deletion.' return endif call NepmdDeleteConfigTree( Handle, ConfPath) if rc then sayerror 'Config tree not deleted, rc = 'rc'.' else sayerror 'Config tree "'ConfPath'" successfully deleted.' endif compile endif ; --------------------------------------------------------------------------- ; Procedure: NepmdDeleteConfigTree ; --------------------------------------------------------------------------- ; E syntax: ; rc = NepmdDeleteConfigTree( Handle, ConfPath) ; --------------------------------------------------------------------------- ; C prototype: ; APIRET EXPENTRY NepmdDeleteConfigTree( HCONFIG hconfig, ; PSZ pszRegPath); ; --------------------------------------------------------------------------- defproc NepmdDeleteConfigTree( Handle, ConfPath) -- For -3, use the handle returned by the initial OpenConfig of NEPMD.INI. if Handle = HINI_NEPMDPROFILE then Handle = helperNepmdGetConfigHandle() elseif Handle = '' then Handle = -9 endif -- Prepare parameter for C routine ConfPath = ConfPath\0 -- Call C routine LibFile = helperNepmdGetlibfile() rc = dynalink32( LibFile, "NepmdDeleteConfigTree", atol( Handle) || address( ConfPath)) helperNepmdCheckliberror( LibFile, rc) return