| 513 | } |
| 514 | |
| 515 | static void wd_resource_created_cb( |
| 516 | int32_t event, |
| 517 | const char *key_name, |
| 518 | struct icmap_notify_value new_val, |
| 519 | struct icmap_notify_value old_val, |
| 520 | void *user_data) |
| 521 | { |
| 522 | char res_name[ICMAP_KEYNAME_MAXLEN]; |
| 523 | char res_type[ICMAP_KEYNAME_MAXLEN]; |
| 524 | char tmp_key[ICMAP_KEYNAME_MAXLEN]; |
| 525 | int res; |
| 526 | |
| 527 | if (event != ICMAP_TRACK_ADD) { |
| 528 | return ; |
| 529 | } |
| 530 | |
| 531 | res = sscanf(key_name, "resources.%[^.].%[^.].%[^.]", res_type, res_name, tmp_key); |
| 532 | if (res != 3) { |
| 533 | return ; |
| 534 | } |
| 535 | |
| 536 | if (strcmp(tmp_key, "state") != 0) { |
| 537 | return ; |
| 538 | } |
| 539 | |
| 540 | snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "resources.%s.%s.", res_type, res_name); |
| 541 | wd_resource_create (tmp_key, res_name); |
| 542 | } |
| 543 | |
| 544 | static void wd_scan_resources (void) |
| 545 | { |
nothing calls this directly
no test coverage detected