+ const char *type;
+
+ for (int n = 0; n < talloc_array_length(query->dd_talloc_array); n++) {
+
+ type = talloc_get_name(query->dd_talloc_array[n]);
+
+ if (STRCMP(type, ==, "sl_array_t")) {
+ offset = sl_pack_array(query->dd_talloc_array[n], buf, offset, toc_buf, toc_idx);
+ } else if (STRCMP(type, ==, "sl_dict_t")) {
+ offset = sl_pack_dict(query->dd_talloc_array[n], buf, offset, toc_buf, toc_idx);
+ } else if (STRCMP(type, ==, "uint64_t")) {
+ uint64_t i;
+ memcpy(&i, query->dd_talloc_array[n], sizeof(uint64_t));
+ offset = sl_pack_uint64(i, buf, offset);
+ } else if (STRCMP(type, ==, "char *")) {
+ offset = sl_pack_string(query->dd_talloc_array[n], buf, offset, toc_buf, toc_idx);
+ } else if (STRCMP(type, ==, "sl_bool_t")) {
+ sl_bool_t bl;
+ memcpy(&bl, query->dd_talloc_array[n], sizeof(sl_bool_t));
+ offset = sl_pack_bool(bl, buf, offset);
+ } else if (STRCMP(type, ==, "double")) {
+ double d;
+ memcpy(&d, query->dd_talloc_array[n], sizeof(double));
+ offset = sl_pack_float(d, buf, offset);
+ } else if (STRCMP(type, ==, "sl_nil_t")) {
+ offset = sl_pack_nil(buf, offset);
+ } else if (STRCMP(type, ==, "sl_time_t")) {
+ sl_time_t t;
+ memcpy(&t, query->dd_talloc_array[n], sizeof(sl_time_t));
+ offset = sl_pack_date(t, buf, offset);
+ } else if (STRCMP(type, ==, "sl_uuid_t")) {
+ offset = sl_pack_uuid(query->dd_talloc_array[n], buf, offset);
+ } else if (STRCMP(type, ==, "sl_cnids_t")) {
+ offset = sl_pack_CNID(query->dd_talloc_array[n], buf, offset, toc_buf, toc_idx);
+ }
+ }
+