NISysCfgRenameResource
- Updated2023-02-21
- 2 minute(s) read
NISysCfgStatus NISysCfgRenameResource( NISysCfgResourceHandle resourceHandle, const char newName[], NISysCfgBool overwriteConflict, NISysCfgBool updateDependencies, NISysCfgBool * nameAlreadyExisted, NISysCfgResourceHandle * overwrittenResourceHandle );
Purpose
Changes the display name of a resource.
Parameters
| Input | ||||
| Name | Type | Description | ||
| resourceHandle | NISysCfgResourceHandle | The resource object handle returned from NISysCfgFindHardware. | ||
| newName | const char [] | The user-specified new name for the resource. | ||
| overwriteConflict | NISysCfgBool | Allows resource name changes to occur if there are any naming conflicts. If this value is TRUE, the resource name change occurs even if another resource with the same name already exists. If this value is FALSE (default), this function returns an error if another resource with the same name already exists. If this value is TRUE and you choose a name that is already assigned to an existing resource, this function also changes the name of the existing resource. If not NULL, you can query the overwrittenResourceHandle to determine the new name of that resource. | ||
| updateDependencies | NISysCfgBool |
Updates dependencies (for example: a task or channel) if the resource being renamed has them. Dependencies will be updated to refer to the new name by default. Select FALSE if you do not want to update these dependencies.
|
||
| Output | ||||
| Name | Type | Description | ||
| nameAlreadyExisted | NISysCfgBool * | Specifies whether or not a name overwrite took place. If TRUE, an overwrite occurred. If FALSE, an overwrite did not occur. | ||
| overwrittenResourceHandle | NISysCfgResourceHandle * |
Returns a reference to the resource whose name was overwritten. This will be NULL if no other resource was overwritten (for example, if nameAlreadyExisted is FALSE). When it is no longer needed, this handle must be discarded using NISysCfgCloseHandle. |
||
Return Value
| Name | Type | Description |
| returnValue | NISysCfgStatus | The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error. Refer to Status Codes or nisyscfg_errors.h for details regarding error codes. |
