nucm-logo

NUCM-2.0 Documentation
Interface: Query: nc_isinitiated


[Collection | Query | Attribute]

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

Signature

int  nc_isinitiated(const char*  target,
                    const char*  t_cwd)

Functionality

Determines whether the artifact determined by the interpretation of the parameters target and t_cwd is initiated.

Return Values

1: everything went ok and the artifact is initiated
0: everything went ok and the artifact is not initiated
-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

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 examine which artifacts in the workspace have been initiated, the following code fragment can be used:
   #include "nc.h"
   
   t_memberlist*  memberlist;
   t_memberlist*  member;
   int  result;

   nc_list("my_project",
	   "/home/bigtime/andre/workspace",
	   &memberlist);
   member = memberlist;
   while (member != NULL) {
      result = nc_isinitiated(member->name,
		              "/home/bigtime/andre/workspace/my_project");
      if (result == -1) {
	 printf("Error during examination of %s\n", member->name);
      } else if (result == 0) {
	 printf("%s not initiated\n", member->name);
      } else {
	 printf("%s initiated\n", member->name);
      }
      member = member->next;
   }

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>