diff options
| author | Alex Marshall <SquidMan72@gmail.com> | 2009-04-19 22:39:15 -0700 |
|---|---|---|
| committer | Alex Marshall <SquidMan72@gmail.com> | 2009-04-19 22:39:15 -0700 |
| commit | 8182882e78fec04d159ae979d365eeffe4915ce6 (patch) | |
| tree | 2cc5ef4adfd86b7e1c5e97035e394dafea978521 /laichzeit/c_oop.c | |
| parent | ed79fc076c74ee2de4cc6ef626b545a5a03a7bef (diff) | |
Added Laichzeit. Everything should work, just gotta get compiling of BRLYTs and BRLANs added, then it should be COMPLETE =D
Diffstat (limited to '')
| -rw-r--r-- | laichzeit/c_oop.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/laichzeit/c_oop.c b/laichzeit/c_oop.c new file mode 100644 index 0000000..95c1083 --- /dev/null +++ b/laichzeit/c_oop.c @@ -0,0 +1,32 @@ +/*****************************************************************************/ +/* Laichzeit */ +/* Part of the Benzin Project */ +/* Copyright (c)2009 HACKERCHANNEL. Protected under the GNU GPLv2. */ +/* ------------------------------------------------------------------------- */ +/* c_oop.c */ +/* Object orientation shit for C. Compile this! */ +/* ------------------------------------------------------------------------- */ +/* Code contributed by: */ +/* SquidMan */ +/*****************************************************************************/ + +#include <stdlib.h> +#include <string.h> + +#include "types.h" +#include "c_oop.h" + +int AddObjectToList(u8** listv, u32* listcnt, u8* object, u32 size) +{ + *listcnt++; + u8* list = *(u8**)listv; + u8* entries = calloc(size, *listcnt); + if(list != NULL) { + memcpy(entries, list, size * (*listcnt - 1)); + free(list); + } + memcpy(&entries[(*listcnt - 1) * size], object, size); + *(u8**)listv = entries; + return *listcnt - 1; +} + |
