42sh 1.0.0
Create a shell in C
|
The header file of the libmymemory. More...
#include "mylist.h"
Go to the source code of this file.
Macros | |
#define | CALLOC(elt_count, elt_size) my_calloc(elt_count, elt_size, 1) |
#define | MALLOC(size) my_malloc(size, 1) |
#define | REALLOC(ptr, size) my_realloc(ptr, size, 1) |
Functions | |
void * | my_calloc (size_t element_count, size_t element_size, int type) |
Allocates memory for an array of elements (element_count) of bytes (element_size) each and initializes the memory to zero. | |
void | my_free (void) |
Free allocated memory with my_calloc, my_malloc and my_realloc. | |
void * | my_malloc (size_t size, int type) |
Allocates memory for an array of bytes (size) | |
char * | my_malloc_strdup (char const *src) |
Duplicates a string with my_malloc. | |
char ** | my_malloc_strdup_word_array (char **array) |
Duplicates a word array (array) with my_malloc. | |
char * | my_malloc_strndup (char const *src, int n) |
Duplicates a string with a defined size with my_malloc. | |
void * | my_memchr (const void *memory_block, int searched_char, size_t size) |
Copies bytes (size) from memory area (source) to memory area (destination) | |
void * | my_memcpy (void *destination, const void *source, size_t size) |
Copies bytes (size) from memory area (source) to memory area (destination) | |
int | my_memcmp (const void *pointer1, const void *pointer2, size_t size) |
Compares the first (size) bytes of the two memory areas (pointer1 and pointer2) | |
void * | my_memmove (void *destination, const void *source, size_t size) |
Moves bytes (size) from memory area (source) to memory area (destination) | |
void * | my_memset (void *pointer, int value, size_t size) |
Fill bytes (size) of memory area (pointer) with a value (value) | |
void * | my_realloc (void *pointer, size_t size, int type) |
Reallocates memory for an array of bytes (size) | |
The header file of the libmymemory.
void * my_calloc | ( | size_t | element_count, |
size_t | element_size, | ||
int | type ) |
Allocates memory for an array of elements (element_count) of bytes (element_size) each and initializes the memory to zero.
element_count | The number of elements |
element_size | The size of each element |
type | The type of the usage |
void my_free | ( | void | ) |
Free allocated memory with my_calloc, my_malloc and my_realloc.
void * my_malloc | ( | size_t | size, |
int | type ) |
Allocates memory for an array of bytes (size)
size | The size of the memory to allocate |
type | The type of the usage |
char * my_malloc_strdup | ( | char const * | src | ) |
Duplicates a string with my_malloc.
src | The string to duplicate |
char ** my_malloc_strdup_word_array | ( | char ** | array | ) |
Duplicates a word array (array) with my_malloc.
array | The word array to duplicate |
char * my_malloc_strndup | ( | char const * | src, |
int | n ) |
Duplicates a string with a defined size with my_malloc.
src | The string to duplicate |
n | The size of the string |
void * my_memchr | ( | const void * | memory_block, |
int | searched_char, | ||
size_t | size ) |
Copies bytes (size) from memory area (source) to memory area (destination)
destination | The destination memory area |
source | The source memory area |
size | The number of bytes to copy |
int my_memcmp | ( | const void * | pointer1, |
const void * | pointer2, | ||
size_t | size ) |
Compares the first (size) bytes of the two memory areas (pointer1 and pointer2)
pointer1 | The first memory area |
pointer2 | The second memory area |
size | The number of bytes to compare |
void * my_memcpy | ( | void * | destination, |
const void * | source, | ||
size_t | size ) |
Copies bytes (size) from memory area (source) to memory area (destination)
destination | The destination memory area |
source | The source memory area |
size | The number of bytes to copy |
void * my_memmove | ( | void * | destination, |
const void * | source, | ||
size_t | size ) |
Moves bytes (size) from memory area (source) to memory area (destination)
destination | The destination memory area |
source | The source memory area |
size | The number of bytes to copy |
void * my_memset | ( | void * | pointer, |
int | value, | ||
size_t | size ) |
Fill bytes (size) of memory area (pointer) with a value (value)
pointer | The memory area to fill |
value | The value to fill the memory area with |
size | The number of bytes to fill |
void * my_realloc | ( | void * | pointer, |
size_t | size, | ||
int | type ) |
Reallocates memory for an array of bytes (size)
pointer | The pointer to the memory to reallocate |
size | The size of the memory to reallocate |
type | The type of the usage |