My library
Library for common tasks
utility.h
Go to the documentation of this file.
1
7#ifndef SEEN_UTILITY
8#define SEEN_UTILITY
9
10#include "types.h"
11
22int chooseCmp(const spec_t spec, const void *a, const void *b);
23
28int charCmp(const void *a, const void *b);
29
34int byteCmp(const void *a, const void *b);
35
40int intCmp(const void *a, const void *b);
41
46int floatCmp(const void *a, const void *b);
47
52int doubleCmp(const void *a, const void *b);
53
58int ptrCmp(const void *a, const void *b);
59
66void *saferMalloc(unsigned int bytes);
67
75void *saferRealloc(void *pointer, unsigned int bytes);
76
77#endif
Collection of useful types.
char * spec_t
Used to specify type of argument passed in functions that require a type specifier.
Definition: types.h:20
int chooseCmp(const spec_t spec, const void *a, const void *b)
Compare two values.
int doubleCmp(const void *a, const void *b)
Compare two doubles.
void * saferRealloc(void *pointer, unsigned int bytes)
Reallocate a space in memory.
int byteCmp(const void *a, const void *b)
Compare two bytes.
int floatCmp(const void *a, const void *b)
Compare two floats.
int charCmp(const void *a, const void *b)
Compare two chars.
int intCmp(const void *a, const void *b)
Compare two ints.
void * saferMalloc(unsigned int bytes)
Return a pointer to a space in memory of specified size.
int ptrCmp(const void *a, const void *b)
Compare two pointers.