Sorting/ValueBased/Linux-2.6.11-rc5-lib-qsort.c File Reference

#include <linux/types.h>
#include <linux/kernel.h>

Classes

struct  stack_node

Defines

#define min(x, y)   (x) < (y) ? (x):(y)
#define SWAP(a, b, size)
#define MAX_THRESH   4
#define CHAR_BIT   8
#define STACK_SIZE   (CHAR_BIT * sizeof(size_t))
#define PUSH(low, high)   ((void) ((top->lo = (low)), (top->hi = (high)), ++top))
#define POP(low, high)   ((void) (--top, (low = top->lo), (high = top->hi)))
#define STACK_NOT_EMPTY   (stack < top)

Functions

void sortValues (void *const pbase, size_t total_elems, size_t size, int(*cmp)(const void *, const void *))

Define Documentation

#define CHAR_BIT   8

#define MAX_THRESH   4

#define min ( x,
 )     (x) < (y) ? (x):(y)

#define POP ( low,
high   )     ((void) (--top, (low = top->lo), (high = top->hi)))

#define PUSH ( low,
high   )     ((void) ((top->lo = (low)), (top->hi = (high)), ++top))

#define STACK_NOT_EMPTY   (stack < top)

#define STACK_SIZE   (CHAR_BIT * sizeof(size_t))

#define SWAP ( a,
b,
size   ) 

Value:

do \
 { \
 register size_t __size = (size); \
 register char *__a = (a), *__b = (b); \
 do \
 { \
 char __tmp = *__a; \
 *__a++ = *__b; \
 *__b++ = __tmp; \
 } while (--__size > 0); \
 } while (0)


Function Documentation

void sortValues ( void *const   pbase,
size_t  total_elems,
size_t  size,
int(*)(const void *, const void *)  cmp 
)

Algorithm Development Kit 1.0