41 #include <sys/types.h>
48 #include <qb/qbipcc.h>
58 qb_ipcc_connection_t *
c;
65 qb_ipcc_connection_t *
c;
69 static void cmap_inst_free (
void *inst);
96 goto error_no_destroy;
100 if (error !=
CS_OK) {
109 goto error_put_destroy;
112 (void)hdb_handle_put(&cmap_handle_t_db, *handle);
117 (void)hdb_handle_put(&cmap_handle_t_db, *handle);
119 (void)hdb_handle_destroy(&cmap_handle_t_db, *handle);
131 struct qb_ipc_response_header res_lib_cmap_set_current_map;
135 if (error ==
CS_OK) {
137 if (error !=
CS_OK) {
153 &res_lib_cmap_set_current_map,
156 if (error ==
CS_OK) {
157 error = res_lib_cmap_set_current_map.error;
160 (void)hdb_handle_put (&cmap_handle_t_db, *handle);
167 static void cmap_inst_free (
void *inst)
181 if (error !=
CS_OK) {
186 (void)hdb_handle_put (&cmap_handle_t_db, handle);
194 hdb_iterator_reset(&cmap_track_handle_t_db);
195 while (hdb_iterator_next(&cmap_track_handle_t_db,
199 (void)hdb_handle_destroy(&cmap_track_handle_t_db, track_inst_handle);
202 (void)hdb_handle_put (&cmap_track_handle_t_db, track_inst_handle);
205 (void)hdb_handle_destroy(&cmap_handle_t_db, handle);
207 (void)hdb_handle_put(&cmap_handle_t_db, handle);
218 if (error !=
CS_OK) {
224 (void)hdb_handle_put (&cmap_handle_t_db, handle);
237 struct qb_ipc_response_header *dispatch_data;
245 if (error !=
CS_OK) {
257 dispatch_data = (
struct qb_ipc_response_header *)dispatch_buf;
284 if (error !=
CS_OK) {
291 switch (dispatch_data->id) {
304 if (error !=
CS_OK) {
347 (void)hdb_handle_put (&cmap_handle_t_db, handle);
354 const void **context)
360 if (error !=
CS_OK) {
366 (void)hdb_handle_put (&cmap_handle_t_db, handle);
379 if (error !=
CS_OK) {
385 (void)hdb_handle_put (&cmap_handle_t_db, handle);
392 const char *key_name,
403 if (key_name == NULL ||
value == NULL) {
412 if (error !=
CS_OK) {
428 iov[1].iov_base = (
void *)
value;
429 iov[1].iov_len = value_len;
438 if (error ==
CS_OK) {
442 (void)hdb_handle_put (&cmap_handle_t_db, handle);
515 if (key_name == NULL) {
523 if (error !=
CS_OK) {
544 if (error ==
CS_OK) {
548 (void)hdb_handle_put (&cmap_handle_t_db, handle);
555 const char *key_name,
567 if (key_name == NULL) {
574 if (
value != NULL && value_len == NULL) {
579 if (error !=
CS_OK) {
590 if (
value != NULL && value_len != NULL) {
613 if (error ==
CS_OK) {
617 if (error ==
CS_OK) {
622 if (value_len != NULL) {
626 if (
value != NULL && value_len != NULL) {
633 (void)hdb_handle_put (&cmap_handle_t_db, handle);
640 const char *key_name,
651 key_size =
sizeof(key_value);
652 memset(key_value, 0, key_size);
654 err =
cmap_get(handle, key_name, key_value, &key_size, &key_type);
658 if (key_type !=
type) {
662 memcpy(
value, key_value, value_size);
733 res =
cmap_get(handle, key_name, NULL, &str_len, &
type);
743 *str = malloc(str_len);
750 res =
cmap_get(handle, key_name, *str, &str_len, &
type);
771 if (key_name == NULL) {
779 if (error !=
CS_OK) {
802 if (error ==
CS_OK) {
806 (void)hdb_handle_put (&cmap_handle_t_db, handle);
814 return (cmap_adjust_int(handle, key_name, 1));
820 return (cmap_adjust_int(handle, key_name, -1));
834 if (cmap_iter_handle == NULL) {
839 if (error !=
CS_OK) {
865 if (error ==
CS_OK) {
869 if (error ==
CS_OK) {
873 (void)hdb_handle_put (&cmap_handle_t_db, handle);
891 if (key_name == NULL) {
896 if (error !=
CS_OK) {
915 if (error ==
CS_OK) {
919 if (error ==
CS_OK) {
924 if (value_len != NULL) {
933 (void)hdb_handle_put (&cmap_handle_t_db, handle);
949 if (error !=
CS_OK) {
968 if (error ==
CS_OK) {
972 (void)hdb_handle_put (&cmap_handle_t_db, handle);
979 const char *key_name,
993 if (cmap_track_handle == NULL ||
notify_fn == NULL) {
998 if (error !=
CS_OK) {
1004 if (error !=
CS_OK) {
1010 if (error !=
CS_OK) {
1011 goto error_put_destroy;
1043 if (error ==
CS_OK) {
1047 if (error ==
CS_OK) {
1052 (void)hdb_handle_put (&cmap_track_handle_t_db, cmap_track_inst_handle);
1054 (void)hdb_handle_put (&cmap_handle_t_db, handle);
1059 (void)hdb_handle_put (&cmap_track_handle_t_db, cmap_track_inst_handle);
1060 (void)hdb_handle_destroy (&cmap_track_handle_t_db, cmap_track_inst_handle);
1063 (void)hdb_handle_put (&cmap_handle_t_db, handle);
1080 if (error !=
CS_OK) {
1099 if (error ==
CS_OK) {
1103 if (error ==
CS_OK) {
1107 if (error !=
CS_OK) {
1116 (void)hdb_handle_put (&cmap_handle_t_db, handle);