nucm-logo

NUCM-2.0 Documentation
Interface: Query: nc_version


[Collection | Query | Attribute]

[nc_list | nc_gettype | nc_version | nc_lastversion | nc_existsversion | nc_isinitiated]

Signature

int  nc_version(const char*  path,
                const char*  p_cwd,
                char*  version)

Functionality

Sets the value of the parameter version to the version number of the artifact determined by the interpretation of the parameters path and p_cwd. It is assumed that the parameter version holds enough space to place the version number in, i.e., is at least MAX_VERSION_LENGTH in size. 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
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", "2", "3", "4", and "5" have been opened in a workspace. The workspace looks as follows:
   /home/bigtime/andre/workspace/my_project/1
					    2
					    3
					    4
					    5
To determine the version of each of the artifacts "1", "2", "3", "4", and "5", the following code fragment can be used:
   #include "nc.h"
   
   t_memberlist*  memberlist;
   t_memberlist*  member;
   char  version[MAX_VERSION_LENGTH + 1];

   nc_list("my_project",
	   "/home/bigtime/andre/workspace",
	   &memberlist);
   member = memberlist;
   while (member != NULL) {
      nc_version(member->name,
		 "/home/bigtime/andre/workspace/my_project",
		 version);
      printf("%s: version %s", member->name, version);
      member = member->next;
   }

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>