nucm-logo

NUCM-2.0 Documentation
Interface: Distribution: nc_setmyserver


[Removal | Distribution | Miscellaneous]

[nc_move | nc_getlocation | nc_setmyserver]

Signature

void  nc_setmyserver(const t_server*  server)

Functionality

Sets the default NUCM server that serves this client to the server addressed by the parameter server. The default NUCM server is the server where newly created artifacts are stored.

Return Values

None

NdbErrno Codes

None

Example

Assuming two access servers are running on two different machines: "serl.cs.colorado.edu" and "anchor.cs.colorado.edu" and both are listening to the default NUCM port. Assume a workspace exist in which a project "my_project" has been opened and initiated. The workspace looks as follows:
   /home/bigtime/andre/workspace/my_project
The following code fragment illustrates how different artifacts can be added to different repositories.
   #include "nc.h"

   t_server  server;

   strcpy(server.host, "serl.cs.colorado.edu");
   sprintf(server.port, NUCM_PORT);
   nc_setmyserver(&server);
   nc_add("/usr/include/stdio.h",
	  ""
	  "/home/bigtime/andre/workspace/my_project",
	  "");
   strcpy(server.host, "anchor.cs.colorado.edu");
   nc_setmyserver(&server);
   nc_add("/usr/include/malloc.h",
	  ""
	  "/home/bigtime/andre/workspace/my_project",
	  "");
Note that port "1234" is the default port a NUCM access server listens to, so we use the NUCM_PORT macro to set it in the variable server. After execution of this code fragment, "stdio.h" will physically be located at "serl.cs.colorado.edu" and "malloc.h" at "anchor.cs.colorado.edu".

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>