nucm-logo

NUCM-2.0 Documentation
Interface: Distribution: nc_getlocation


[Removal | Distribution | Miscellaneous]

[nc_move | nc_getlocation | nc_setmyserver]

Signature

int  nc_getlocation(const char*  path,
                    const char*  p_cwd,
                    t_server*  server)

Functionality

Determines the address of the NUCM server where the history of the NUCM artifact determined by the interpretation of the parameters path and p_cwd is physically located, and places the resulting server address in the parameter server.

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 workspace has been opened that contains a project "my_project" and its members "1", "2", "3", "4", and "5". The workspace looks as follows:
   /home/bigtime/andre/workspace/my_project/1
					    2
					    3
					    4
					    5
To obtain the physical location of "my_project" and members "2" and "3", the following code fragment can be used:
   #include "nc."h

   t_server  server;

   nc_getlocation("my_project/2",
                  "/home/bigtime/andre/workspace/",
		  &server);
   printf("location: %s, %s", server.host, server.port);
   nc_getlocation("3",
                  "/home/bigtime/andre/workspace/my_project",
		  &server);
   printf("location: %s, %s", server.host, server.port);
   nc_getlocation("my_project",
                  "/home/bigtime/andre/workspace/",
		  &server);
   printf("location: %s, %s", server.host, server.port);

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>