Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeremyletang/csml
Like C++ STL but with macros and C
https://github.com/jeremyletang/csml
Last synced: 25 days ago
JSON representation
Like C++ STL but with macros and C
- Host: GitHub
- URL: https://github.com/jeremyletang/csml
- Owner: jeremyletang
- License: mit
- Created: 2014-01-25T16:07:57.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-17T15:06:04.000Z (over 10 years ago)
- Last Synced: 2023-07-31T14:58:47.828Z (over 1 year ago)
- Language: C
- Size: 348 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
csml
====Like C++ STL but with macros and C
# Example
```C
/* import csml stuff */
#include "csml/csml.h"
/* include functions shortcuts macros */
#include "csml/method_macros.h"
/* call the macros with the givens types to implement a stack for this type */
impl_flist(int, int);int main() {
/* new forward list on the heap */
flist_t(int) *list = new(flist_t(int));/* push some elements in the list */
push_front(list, 42);
push_front(list, 84);
push_front(list, 21);
/* iterate over the list */
flist_iterator(int) *it = begin(list);
for (;!equals(it, end(list)); inc(it)) {
printf("List item: %d\n", *get(it));
}// delete the list
delete(list);
}
```