| 5438 | char *title; |
| 5439 | } agent_session_list_item; |
| 5440 | |
| 5441 | static int agent_session_list_cmp_recent(const void *a, const void *b) { |
| 5442 | const agent_session_list_item *sa = a, *sb = b; |
| 5443 | uint64_t ta = sa->entry.last_used ? sa->entry.last_used : sa->entry.created_at; |
| 5444 | uint64_t tb = sb->entry.last_used ? sb->entry.last_used : sb->entry.created_at; |
| 5445 | if (ta < tb) return 1; |
| 5446 | if (ta > tb) return -1; |
| 5447 | return strcmp(sa->entry.sha, sb->entry.sha); |
| 5448 | } |
| 5449 | |
| 5450 | static void agent_session_list_free(agent_session_list_item *v, int n) { |
| 5451 | for (int i = 0; i < n; i++) { |
| 5452 | ds4_kvstore_entry_free(&v[i].entry); |
| 5453 | free(v[i].title); |
no outgoing calls
no test coverage detected