diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-11-03 14:46:28 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-11-03 14:46:28 +0100 |
commit | 0f65e75ec0f56d3067a15e3671d9250fd2c1637a (patch) | |
tree | 40ddc24f08b42c767e02b6482133e9f7efe4b524 /src/pair.inc.h | |
parent | Remove 'none' output. (diff) | |
parent | Add descirption to strbuf. (diff) | |
download | calp-0f65e75ec0f56d3067a15e3671d9250fd2c1637a.tar.gz calp-0f65e75ec0f56d3067a15e3671d9250fd2c1637a.tar.xz |
Merge branch 'restruct'
Diffstat (limited to 'src/pair.inc.h')
-rw-r--r-- | src/pair.inc.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/pair.inc.h b/src/pair.inc.h deleted file mode 100644 index c42b2dfd..00000000 --- a/src/pair.inc.h +++ /dev/null @@ -1,34 +0,0 @@ -#if ! (defined(T) && defined(V)) -#error "Both T and V must be defiend here" -#else - -INIT_F(PAIR(T, V)) { - INIT(T, &self->key); - INIT(V, &self->val); - - return 0; -} - -FREE_F(PAIR(T, V)) { - FREE(T)(&self->key); - FREE(V)(&self->val); - - return 0; -} - -FMT_F(PAIR(T, V)) { - char lbuf[0x100]; - char rbuf[0x1000]; - FMT(T)(&self->key, lbuf); - FMT(V)(&self->val, rbuf); - - return sprintf(buf, "<%s, %s>", lbuf, rbuf); -} - -int DEEP_COPY(PAIR(T, V)) (PAIR(T, V)* dest, PAIR(T, V)* src) { - DEEP_COPY(T)(&dest->key, &src->key); - DEEP_COPY(V)(&dest->val, &src->val); - return 0; -} - -#endif /* T & V */ |