nucm-logo

NUCM-2.0 Documentation
Interface: Attribute: nc_removeattribute


[Query | Attribute | Removal]

[nc_testandsetattribute | nc_getattributevalue | nc_removeattribute]

Signature

int  nc_removeattribute(const char*  path,
		         const char*  p_cwd,
		         const char*  attrname)

Functionality

Physically removes the attribute determined by the parameter attrname for the NUCM artifact determined by the interpretation of the parameters path and p_cwd from a NUCM logical repository.

Return Values

0: everything went ok
-1: an error occurred

NdbErrno Codes

NdbOk :everything went ok
NdbUnknown :the path does not represent a NUCM artifact
NdbNotOpen :the NUCM artifact has not been opened in the workspace
NdbNonExist:the attribute does not exist
NdbConnect :the server is down or not reachable
NdbComm :a communication error occurred
NdbProtocol:a failure occurred in the NUCM protocol
NdbNotAvail:service is not available

Example

Assuming a repository is filled with projects, and in particular contains a project "my_project" that has members "1", "2", "3", "4", and "5". Furthermore, "my_project" and its members "1" and "2" have been opened in a workspace. The workspace looks as follows:
   /home/bigtime/andre/workspace/my_project/1
					    2
To update the context of the changes made to the current version of "2", the following code fragment can be used:
   #include "nc.h"

   char  value[1024 + 1];

   nc_getattributevalue("my_project/2",
			"/home/bigtime/andre/workspace",
			"comments",
			&value);
   nc_removeattribute("my_project/2",
		      "/home/bigtime/andre/workspace",
		      "comments");
   sprintf(value, "%s\n%s", value,
	   "Forgot to demonstrate that attributes can be removed too");
   nc_testandsetattribute("my_project/2",
			  "/home/bigtime/andre/workspace",
			  "comments",
			  value);

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>