#ifndef TRAITS_H__ #define TRAITS_H__ struct pl; struct object; struct mapstruct; struct archt; struct region; struct party; struct mapstruct; // could have used templates, but a more traditional C api // uses more explicit typing which is ok for this purpose. enum data_type { DT_END, // no further arguments DT_AV, // perl-only av that needs to be flattened out DT_INT, DT_INT64, DT_DOUBLE, DT_STRING, // 0-terminated string DT_DATA, // string + length DT_OBJECT, DT_MAP, DT_PLAYER, DT_ARCH, DT_PARTY, DT_REGION, NUM_DATA_TYPES }; template struct cftype { }; template<> struct cftype { enum { dt = DT_INT }; }; template<> struct cftype { enum { dt = DT_INT64 }; }; template<> struct cftype { enum { dt = DT_DOUBLE }; }; template<> struct cftype { enum { dt = DT_STRING }; }; template<> struct cftype { enum { dt = DT_OBJECT }; }; template<> struct cftype { enum { dt = DT_PLAYER }; }; template<> struct cftype { enum { dt = DT_MAP }; }; template<> struct cftype { enum { dt = DT_ARCH }; }; template<> struct cftype { enum { dt = DT_PARTY }; }; template<> struct cftype { enum { dt = DT_REGION }; }; #endif