nucm-logo

NUCM-2.0 Documentation
Interface: Query: nc_list


[Collection | Query | Attribute]

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

Signature

int  nc_list(const char*  path,
             const char*  p_cwd,
             t_memberlist**  memberlist)

Functionality

Sets the value of the parameter memberlist to the list of artifacts contained in the NUCM collection determined by the interpretation of the parameters path and p_cwd. Each member in the list contains the name and version of an artifact contained in the NUCM collection. The list of members is allocated for the caller, but needs to be de-allocated by the caller.

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
NdbAtomList:the artifact is an atom and can not be listed
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. To obtain a list of projects that are available in the repository, the following code fragment can be used:
   #include "nc.h"

   t_memberlist*  memberlist;
   t_memberlist*  member;

   nc_list("//serl.cs.colorado.edu:1234/nucm_root",
	   "",
	   &memberlist);
   member = memberlist;
   while (member != NULL) {
      printf("%s, %s\n", member->name, member->version);
      member = member->next;
   }

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>