nucm-logo

NUCM-2.0 Documentation
Interface: Attribute: nc_getattributevalue


[Query | Attribute | Removal]

[nc_testandsetattribute | nc_getattributevalue | nc_removeattribute]

Signature

int  nc_getattributevalue(const char*  path,
		          const char*  p_cwd,
		          const char*  attrname,
			  char*  value)

Functionality

Returns the value of the parameter attrname for the NUCM artifact determined by the interpretation of the parameters path and p_cwd. It is assumed that the parameter value holds enough space to place the value of the attribute in. The resulting value is NULL-terminated.

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 examine the context of the latest changes made to "2", the following code fragment can be used:
   #include "nc.h"

   char  value[1024 + 1];

   nc_getattributevalue("my_project/2",
			"/home/bigtime/andre/workspace",
			"author",
			value);
   printf("The author was: %s", value);
   nc_getattributevalue("my_project/2",
			"/home/bigtime/andre/workspace",
			"comments",
			value);
   printf("The comments were: %s", value);
   nc_getattributevalue("my_project/2",
			"/home/bigtime/andre/workspace",
			"date",
			value);
   printf("The date was: %s", value);

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>