From 0a56172712a70ac5fcfc3ddcf725d78045c599d3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 11 Jul 2016 00:03:48 +0200 Subject: Sort outputs by name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/output.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/output.h') diff --git a/src/output.h b/src/output.h index b27059f..6e0c4d5 100644 --- a/src/output.h +++ b/src/output.h @@ -139,3 +139,15 @@ size_t output_marshal(const struct output* this, char* buf); */ size_t output_unmarshal(struct output* this, const char* buf); +/** + * Compare to outputs by the names of their respective CRTC:s + * + * @param a Return -1 if this one is lower + * @param b Return +1 if this one is higher + * @return See description of `a` and `b`, + * 0 if returned if they are the same + */ +#if defined(__GNUC__) +__attribute__((pure)) +#endif +int output_cmp_by_name(const void* a, const void* b); -- cgit v1.2.3-70-g09d2