}
}
-static void connection_release(struct bt_object *obj)
+static void connection_release(bt_object *obj)
{
struct bt_live_viewer_connection *conn =
container_of(obj, struct bt_live_viewer_connection, obj);
}
static
-enum bt_value_status list_update_session(struct bt_value *results,
+enum bt_value_status list_update_session(bt_value *results,
const struct lttng_viewer_session *session,
bool *_found)
{
enum bt_value_status ret = BT_VALUE_STATUS_OK;
- struct bt_value *map = NULL;
- struct bt_value *hostname = NULL;
- struct bt_value *session_name = NULL;
- struct bt_value *btval = NULL;
+ bt_value *map = NULL;
+ bt_value *hostname = NULL;
+ bt_value *session_name = NULL;
+ bt_value *btval = NULL;
int i, len;
bool found = false;
ret = BT_VALUE_STATUS_ERROR;
goto end;
}
- ret = bt_value_string_get(hostname, &hostname_str);
- if (ret != BT_VALUE_STATUS_OK) {
- goto end;
- }
- ret = bt_value_string_get(session_name, &session_name_str);
- if (ret != BT_VALUE_STATUS_OK) {
- goto end;
- }
+ hostname_str = bt_value_string_get(hostname);
+ session_name_str = bt_value_string_get(session_name);
if (!strcmp(session->hostname, hostname_str)
&& !strcmp(session->session_name,
ret = BT_VALUE_STATUS_ERROR;
goto end;
}
- ret = bt_value_integer_get(btval, &val);
- if (ret != BT_VALUE_STATUS_OK) {
- goto end;
- }
+ val = bt_value_integer_get(btval);
/* sum */
val += streams;
ret = bt_private_integer_bool_set(btval, val);
if (ret != BT_VALUE_STATUS_OK) {
goto end;
}
- BT_OBJECT_PUT_REF_AND_RESET(btval);
+ BT_VALUE_PUT_REF_AND_RESET(btval);
btval = bt_value_map_get(map, "client-count");
if (!btval) {
ret = BT_VALUE_STATUS_ERROR;
goto end;
}
- ret = bt_value_integer_get(btval, &val);
- if (ret != BT_VALUE_STATUS_OK) {
- goto end;
- }
+ val = bt_value_integer_get(btval);
/* max */
val = max_t(int64_t, clients, val);
ret = bt_private_integer_bool_set(btval, val);
if (ret != BT_VALUE_STATUS_OK) {
goto end;
}
- BT_OBJECT_PUT_REF_AND_RESET(btval);
+ BT_VALUE_PUT_REF_AND_RESET(btval);
}
- BT_OBJECT_PUT_REF_AND_RESET(hostname);
- BT_OBJECT_PUT_REF_AND_RESET(session_name);
- BT_OBJECT_PUT_REF_AND_RESET(map);
+ BT_VALUE_PUT_REF_AND_RESET(hostname);
+ BT_VALUE_PUT_REF_AND_RESET(session_name);
+ BT_VALUE_PUT_REF_AND_RESET(map);
if (found) {
break;
}
}
end:
- BT_OBJECT_PUT_REF_AND_RESET(btval);
- BT_OBJECT_PUT_REF_AND_RESET(hostname);
- BT_OBJECT_PUT_REF_AND_RESET(session_name);
- BT_OBJECT_PUT_REF_AND_RESET(map);
+ BT_VALUE_PUT_REF_AND_RESET(btval);
+ BT_VALUE_PUT_REF_AND_RESET(hostname);
+ BT_VALUE_PUT_REF_AND_RESET(session_name);
+ BT_VALUE_PUT_REF_AND_RESET(map);
*_found = found;
return ret;
}
static
-enum bt_value_status list_append_session(struct bt_value *results,
+enum bt_value_status list_append_session(bt_value *results,
GString *base_url,
const struct lttng_viewer_session *session)
{
enum bt_value_status ret = BT_VALUE_STATUS_OK;
- struct bt_value *map = NULL;
+ bt_value *map = NULL;
GString *url = NULL;
bool found = false;
if (url) {
g_string_free(url, TRUE);
}
- BT_OBJECT_PUT_REF_AND_RESET(map);
+ BT_VALUE_PUT_REF_AND_RESET(map);
return ret;
}
*/
BT_HIDDEN
-struct bt_value *bt_live_viewer_connection_list_sessions(struct bt_live_viewer_connection *viewer_connection)
+bt_value *bt_live_viewer_connection_list_sessions(struct bt_live_viewer_connection *viewer_connection)
{
- struct bt_value *results = NULL;
+ bt_value *results = NULL;
struct lttng_viewer_cmd cmd;
struct lttng_viewer_list_sessions list;
uint32_t i, sessions_count;
}
goto end;
error:
- BT_OBJECT_PUT_REF_AND_RESET(results);
+ BT_VALUE_PUT_REF_AND_RESET(results);
end:
return results;
}