|
#include <fcntl.h>
#include <wsreg.h>
int main (int argc, char **argv)
{
char *uuid = "d6cf2869-1dd1-11b2-9fcb-080020b69971";
Wsreg_component *comp = NULL;
/* Initialize the registry */
wsreg_initialize(WSREG_INIT_NORMAL, NULL);
if (!wsreg_can_access_registry(O_RDWR)) {
printf("No permission to modify the registry.\n");
return 1;
}
/* Create a component */
comp = wsreg_create_component(uuid);
wsreg_set_unique_name(comp, "wsreg_example_1");
wsreg_set_version(comp, "1.0");
wsreg_add_display_name(comp, "en", "Example 1 component");
wsreg_set_type(comp, WSREG_COMPONENT);
wsreg_set_location(comp, "/usr/local/example1_component");
/* Register */
wsreg_register(comp);
printf("Instance %d was assigned\n", wsreg_get_instance(comp));
wsreg_free_component(comp);
return 0;
}
|