1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#ifndef COMMON_H
#define COMMON_H
#include <stddef.h>
#include <stdint.h>
typedef int (*cmpfun)(const void *, const void *);
typedef void (*sorterfn)(void *, size_t, size_t, cmpfun);
void assert_sorted(char *, size_t, size_t, cmpfun);
size_t binary_search(const char *, char *, size_t, size_t, cmpfun);
void distribute_buffer(char *, size_t, size_t, size_t, cmpfun);
void swap(char *, char *, size_t);
void rotate(char *, size_t, size_t);
void sorting_network(char *, size_t, size_t, cmpfun);
#define MAX_SORTNET 8
#endif
|