1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00
systemd/src/sysupdate/sysupdate-update-set.c
Lennart Poettering b7120388f8 terminal-util: split out color macros/helpers into its own header
This is a lot of stuff, and sometimes quite wild, let's turn this into
its own header.

All stuff color-related that just generates sequences is now in
ansi-color.h (no .c file!), and everything more complex that
probes/ineracts with terminals remains in termina-util.[ch]
2024-07-19 11:44:04 +02:00

29 lines
733 B
C

/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "ansi-color.h"
#include "alloc-util.h"
#include "string-util.h"
#include "sysupdate-update-set.h"
UpdateSet* update_set_free(UpdateSet *us) {
if (!us)
return NULL;
free(us->version);
free(us->instances); /* The objects referenced by this array are freed via resource_free(), not us */
return mfree(us);
}
int update_set_cmp(UpdateSet *const*a, UpdateSet *const*b) {
assert(a);
assert(b);
assert(*a);
assert(*b);
assert((*a)->version);
assert((*b)->version);
/* Newest version at the beginning */
return -strverscmp_improved((*a)->version, (*b)->version);
}