Refactoring and renaming
This commit is contained in:
1 parent
e17e1ba240
commit
137e35d998
11 files changed
+325
-317
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file deque.h
|
||||
* deque.h
|
||||
*
|
||||
* Last Update: 22/03/2019
|
||||
*
|
||||
|
||||
+11
-11
@@ -8,15 +8,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define FOR_EACH(PFX, SNAME, K, T, TARGET, BODY) \
|
||||
do \
|
||||
{ \
|
||||
size_t index; \
|
||||
T var; \
|
||||
SNAME##_iter _iter_; \
|
||||
PFX##_iter(&_iter_, TARGET); \
|
||||
while (PFX##_iter_next(&_iter_, &var, &index)) \
|
||||
{ \
|
||||
BODY; \
|
||||
} \
|
||||
#define FOR_EACH(PFX, SNAME, K, T, TARGET, BODY) \
|
||||
do \
|
||||
{ \
|
||||
size_t index; \
|
||||
T var; \
|
||||
SNAME##_iter iter; \
|
||||
PFX##_iter(&iter, TARGET); \
|
||||
while (PFX##_iter_next(&iter, &var, &index)) \
|
||||
{ \
|
||||
BODY; \
|
||||
} \
|
||||
} while (0);
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file list.h
|
||||
* list.h
|
||||
*
|
||||
* Last Update: 22/03/2019
|
||||
*
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/**
|
||||
* @file macro_containers.h
|
||||
* macro_collections.h
|
||||
*
|
||||
* @author Leonardo Vencovsky (https://github.com/LeoVen)
|
||||
* @date 11/02/2019
|
||||
* Last Update: 22/03/2019
|
||||
*
|
||||
* Macro based generic containers.
|
||||
* Authors:
|
||||
* Leonardo Vencovsky (https://github.com/LeoVen)
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MACRO_CONTAINERS
|
||||
#define MACRO_CONTAINERS
|
||||
#ifndef CMC_MACRO_COLLECTIONS
|
||||
#define CMC_MACRO_COLLECTIONS
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
@@ -21,16 +21,16 @@
|
||||
#define CONCATC(C, P) CONCATC_(C, P)
|
||||
|
||||
#define CONTAINER_GENERATE(C, P, PFX, SNAME, FMOD, K, V) \
|
||||
CONTAINER_GENERATE_HEADER(C, P, PFX, SNAME, FMOD, K, V) \
|
||||
CONTAINER_GENERATE_SOURCE(C, P, PFX, SNAME, FMOD, K, V)
|
||||
CONTAINER_GENERATE_HEADER(C, P, PFX, SNAME, FMOD, K, V) \
|
||||
CONTAINER_GENERATE_SOURCE(C, P, PFX, SNAME, FMOD, K, V)
|
||||
|
||||
#define CONTAINER_GENERATE_HEADER(C, P, PFX, SNAME, FMOD, K, V) \
|
||||
CONCATH(C, P) \
|
||||
(PFX, SNAME, FMOD, K, V)
|
||||
CONCATH(C, P) \
|
||||
(PFX, SNAME, FMOD, K, V)
|
||||
|
||||
#define CONTAINER_GENERATE_SOURCE(C, P, PFX, SNAME, FMOD, K, V) \
|
||||
CONCATC(C, P) \
|
||||
(PFX, SNAME, FMOD, K, V)
|
||||
CONCATC(C, P) \
|
||||
(PFX, SNAME, FMOD, K, V)
|
||||
|
||||
#include "list.h"
|
||||
#include "stack.h"
|
||||
@@ -38,4 +38,4 @@
|
||||
#include "deque.h"
|
||||
#include "foreach.h"
|
||||
|
||||
#endif /* MACRO_CONTAINERS */
|
||||
#endif /* CMC_MACRO_COLLECTIONS */
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file queue.h
|
||||
* queue.h
|
||||
*
|
||||
* Last Update: 22/03/2019
|
||||
*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file stack.h
|
||||
* stack.h
|
||||
*
|
||||
* Last Update: 22/03/2019
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user