libdatatypes 0.3.2
Abstract datatypes for C.
Loading...
Searching...
No Matches
compare.h
Go to the documentation of this file.
1/***************************************************************************
2 begin........: June 2012
3 copyright....: Sebastian Fedrau
4 email........: sebastian.fedrau@gmail.com
5 ***************************************************************************/
6
7/***************************************************************************
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License v3 as published by
10 the Free Software Foundation.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License v3 for more details.
16 ***************************************************************************/
22#ifndef COMPARE_H
23#define COMPARE_H
24
25#include <stdbool.h>
26#include <stdint.h>
27#include <string.h>
28
30typedef int32_t (*CompareFunc)(const void *a, const void *b);
31
33typedef bool (*EqualFunc)(const void *a, const void *b);
34
36#define str_compare (CompareFunc)strcmp
37
45bool str_equal(const void *a, const void *b);
46
54int32_t direct_compare(const void *a, const void *b);
55
63bool direct_equal(const void *a, const void *b);
64
65#endif
66
bool direct_equal(const void *a, const void *b)
Definition compare.c:60
bool str_equal(const void *a, const void *b)
Definition compare.c:31
int32_t direct_compare(const void *a, const void *b)
Definition compare.c:51
int32_t(* CompareFunc)(const void *a, const void *b)
Definition compare.h:30
bool(* EqualFunc)(const void *a, const void *b)
Definition compare.h:33