src/ucx/utils.h

branch
feature/array
changeset 349
05957b1d10a5
parent 328
2bf1da3c411e
     1.1 --- a/src/ucx/utils.h	Wed Aug 07 23:23:58 2019 +0200
     1.2 +++ b/src/ucx/utils.h	Sat Aug 10 08:44:36 2019 +0200
     1.3 @@ -184,6 +184,105 @@
     1.4   */
     1.5  int ucx_cmp_longint(const void *i1, const void *i2, void *data);
     1.6  
     1.7 +/**
     1.8 + * Compares two integers of type long long.
     1.9 + * @param i1 pointer to long long one
    1.10 + * @param i2 pointer to long long two
    1.11 + * @param data omitted
    1.12 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.13 + * 1 if *i1 is greater than *i2
    1.14 + */
    1.15 +int ucx_cmp_longlong(const void *i1, const void *i2, void *data);
    1.16 +
    1.17 +/**
    1.18 + * Compares two integers of type int16_t.
    1.19 + * @param i1 pointer to int16_t one
    1.20 + * @param i2 pointer to int16_t two
    1.21 + * @param data omitted
    1.22 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.23 + * 1 if *i1 is greater than *i2
    1.24 + */
    1.25 +int ucx_cmp_int16(const void *i1, const void *i2, void *data);
    1.26 +
    1.27 +/**
    1.28 + * Compares two integers of type int32_t.
    1.29 + * @param i1 pointer to int32_t one
    1.30 + * @param i2 pointer to int32_t two
    1.31 + * @param data omitted
    1.32 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.33 + * 1 if *i1 is greater than *i2
    1.34 + */
    1.35 +int ucx_cmp_int32(const void *i1, const void *i2, void *data);
    1.36 +
    1.37 +/**
    1.38 + * Compares two integers of type int64_t.
    1.39 + * @param i1 pointer to int64_t one
    1.40 + * @param i2 pointer to int64_t two
    1.41 + * @param data omitted
    1.42 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.43 + * 1 if *i1 is greater than *i2
    1.44 + */
    1.45 +int ucx_cmp_int64(const void *i1, const void *i2, void *data);
    1.46 +
    1.47 +/**
    1.48 + * Compares two integers of type unsigned int.
    1.49 + * @param i1 pointer to unsigned integer one
    1.50 + * @param i2 pointer to unsigned integer two
    1.51 + * @param data omitted
    1.52 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.53 + * 1 if *i1 is greater than *i2
    1.54 + */
    1.55 +int ucx_cmp_uint(const void *i1, const void *i2, void *data);
    1.56 +
    1.57 +/**
    1.58 + * Compares two integers of type unsigned long int.
    1.59 + * @param i1 pointer to unsigned long integer one
    1.60 + * @param i2 pointer to unsigned long integer two
    1.61 + * @param data omitted
    1.62 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.63 + * 1 if *i1 is greater than *i2
    1.64 + */
    1.65 +int ucx_cmp_ulongint(const void *i1, const void *i2, void *data);
    1.66 +
    1.67 +/**
    1.68 + * Compares two integers of type unsigned long long.
    1.69 + * @param i1 pointer to unsigned long long one
    1.70 + * @param i2 pointer to unsigned long long two
    1.71 + * @param data omitted
    1.72 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.73 + * 1 if *i1 is greater than *i2
    1.74 + */
    1.75 +int ucx_cmp_ulonglong(const void *i1, const void *i2, void *data);
    1.76 +
    1.77 +/**
    1.78 + * Compares two integers of type uint16_t.
    1.79 + * @param i1 pointer to uint16_t one
    1.80 + * @param i2 pointer to uint16_t two
    1.81 + * @param data omitted
    1.82 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.83 + * 1 if *i1 is greater than *i2
    1.84 + */
    1.85 +int ucx_cmp_uint16(const void *i1, const void *i2, void *data);
    1.86 +
    1.87 +/**
    1.88 + * Compares two integers of type uint32_t.
    1.89 + * @param i1 pointer to uint32_t one
    1.90 + * @param i2 pointer to uint32_t two
    1.91 + * @param data omitted
    1.92 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
    1.93 + * 1 if *i1 is greater than *i2
    1.94 + */
    1.95 +int ucx_cmp_uint32(const void *i1, const void *i2, void *data);
    1.96 +
    1.97 +/**
    1.98 + * Compares two integers of type uint64_t.
    1.99 + * @param i1 pointer to uint64_t one
   1.100 + * @param i2 pointer to uint64_t two
   1.101 + * @param data omitted
   1.102 + * @return -1, if *i1 is less than *i2, 0 if both are equal,
   1.103 + * 1 if *i1 is greater than *i2
   1.104 + */
   1.105 +int ucx_cmp_uint64(const void *i1, const void *i2, void *data);
   1.106  
   1.107  /**
   1.108   * Distance function for integers of type int.
   1.109 @@ -204,6 +303,96 @@
   1.110  intmax_t ucx_dist_longint(const void *i1, const void *i2, void *data);
   1.111  
   1.112  /**
   1.113 + * Distance function for integers of type long long.
   1.114 + * @param i1 pointer to long long one
   1.115 + * @param i2 pointer to long long two
   1.116 + * @param data omitted
   1.117 + * @return i1 minus i2
   1.118 + */
   1.119 +intmax_t ucx_dist_longlong(const void *i1, const void *i2, void *data);
   1.120 +
   1.121 +/**
   1.122 + * Distance function for integers of type int16_t.
   1.123 + * @param i1 pointer to int16_t one
   1.124 + * @param i2 pointer to int16_t two
   1.125 + * @param data omitted
   1.126 + * @return i1 minus i2
   1.127 + */
   1.128 +intmax_t ucx_dist_int16(const void *i1, const void *i2, void *data);
   1.129 +
   1.130 +/**
   1.131 + * Distance function for integers of type int32_t.
   1.132 + * @param i1 pointer to int32_t one
   1.133 + * @param i2 pointer to int32_t two
   1.134 + * @param data omitted
   1.135 + * @return i1 minus i2
   1.136 + */
   1.137 +intmax_t ucx_dist_int32(const void *i1, const void *i2, void *data);
   1.138 +
   1.139 +/**
   1.140 + * Distance function for integers of type int64_t.
   1.141 + * @param i1 pointer to int64_t one
   1.142 + * @param i2 pointer to int64_t two
   1.143 + * @param data omitted
   1.144 + * @return i1 minus i2
   1.145 + */
   1.146 +intmax_t ucx_dist_int64(const void *i1, const void *i2, void *data);
   1.147 +
   1.148 +/**
   1.149 + * Distance function for integers of type unsigned int.
   1.150 + * @param i1 pointer to unsigned integer one
   1.151 + * @param i2 pointer to unsigned integer two
   1.152 + * @param data omitted
   1.153 + * @return i1 minus i2
   1.154 + */
   1.155 +intmax_t ucx_dist_uint(const void *i1, const void *i2, void *data);
   1.156 +
   1.157 +/**
   1.158 + * Distance function for integers of type unsigned long int.
   1.159 + * @param i1 pointer to unsigned long integer one
   1.160 + * @param i2 pointer to unsigned long integer two
   1.161 + * @param data omitted
   1.162 + * @return i1 minus i2
   1.163 + */
   1.164 +intmax_t ucx_dist_ulongint(const void *i1, const void *i2, void *data);
   1.165 +
   1.166 +/**
   1.167 + * Distance function for integers of type unsigned long long.
   1.168 + * @param i1 pointer to unsigned long long one
   1.169 + * @param i2 pointer to unsigned long long two
   1.170 + * @param data omitted
   1.171 + * @return i1 minus i2
   1.172 + */
   1.173 +intmax_t ucx_dist_ulonglong(const void *i1, const void *i2, void *data);
   1.174 +
   1.175 +/**
   1.176 + * Distance function for integers of type uint16_t.
   1.177 + * @param i1 pointer to uint16_t one
   1.178 + * @param i2 pointer to uint16_t two
   1.179 + * @param data omitted
   1.180 + * @return i1 minus i2
   1.181 + */
   1.182 +intmax_t ucx_dist_uint16(const void *i1, const void *i2, void *data);
   1.183 +
   1.184 +/**
   1.185 + * Distance function for integers of type uint32_t.
   1.186 + * @param i1 pointer to uint32_t one
   1.187 + * @param i2 pointer to uint32_t two
   1.188 + * @param data omitted
   1.189 + * @return i1 minus i2
   1.190 + */
   1.191 +intmax_t ucx_dist_uint32(const void *i1, const void *i2, void *data);
   1.192 +
   1.193 +/**
   1.194 + * Distance function for integers of type uint64_t.
   1.195 + * @param i1 pointer to uint64_t one
   1.196 + * @param i2 pointer to uint64_t two
   1.197 + * @param data omitted
   1.198 + * @return i1 minus i2
   1.199 + */
   1.200 +intmax_t ucx_dist_uint64(const void *i1, const void *i2, void *data);
   1.201 +
   1.202 +/**
   1.203   * Compares two real numbers of type float.
   1.204   * @param f1 pointer to float one
   1.205   * @param f2 pointer to float two

mercurial