3 XBT_LOG_NEW_DEFAULT_CATEGORY(property,"Simple Property example");
6 int client(int argc, char *argv[]) {
9 /* Get the properties */
10 xbt_dict_t props = gras_process_properties();
11 xbt_dict_cursor_t cursor = NULL;
14 /* Print the properties of the workstation 1 */
15 xbt_dict_foreach(props,cursor,key,data) {
16 INFO2("Process property: %s has value: %s",key,data);
19 /* Try to get a property that does not exist */
20 char *noexist=xbt_strdup("Nonexisent");
21 const char *value = gras_process_property_value(noexist);
23 INFO1("Process property: %s is undefined", noexist);
25 INFO2("Process property: %s has value: %s", noexist, value);
31 int server(int argc, char *argv[]) {
32 gras_init(&argc,argv);
34 /* Get the properties */
35 xbt_dict_t props = gras_os_host_properties();
36 xbt_dict_cursor_t cursor = NULL;
39 /* Print the properties of the workstation 1 */
40 xbt_dict_foreach(props,cursor,key,data) {
41 INFO2("Host property: %s has value: %s",key,data);
44 /* Try to get a property that does not exist */
45 char *noexist=xbt_strdup("Nonexisent");
46 const char *value = gras_os_host_property_value(noexist);
48 INFO1("Host property: %s is undefined", noexist);
50 INFO2("Host property: %s has value: %s", noexist, value);