diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-10 18:58:35 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-15 20:03:43 +0100 |
commit | f865f1554dec3d6fb71eab9c02ecbb6f0bfcb821 (patch) | |
tree | cecc4eda62b8892828d67253b411ae5c1c79803f /pair.h | |
parent | Merge strbuf copy functions. (diff) | |
download | calp-f865f1554dec3d6fb71eab9c02ecbb6f0bfcb821.tar.gz calp-f865f1554dec3d6fb71eab9c02ecbb6f0bfcb821.tar.xz |
Replace key_val type with templatized PAIR(T, V).
Diffstat (limited to '')
-rw-r--r-- | pair.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +#ifndef PAIR_H +#define PAIR_H + +#define PAIR(T, V) TEMPL2(pair, T, V) + +#endif /* PAIR_H */ +#if defined(T) && defined(V) + +typedef struct { + T left; + V right; +} PAIR(T, V); + +INIT_F(PAIR(T, V)); +FREE_F(PAIR(T, V)); +FMT_F(PAIR(T, V)); +int DEEP_COPY(PAIR(T, V)) (PAIR(T, V)* dest, PAIR(T, V)* src); + +#endif |