api refactoring
[m6w6/ext-psi] / src / types / impl_type.h
diff --git a/src/types/impl_type.h b/src/types/impl_type.h
new file mode 100644 (file)
index 0000000..9f7e894
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _PSI_TYPES_IMPL_TYPE_H
+#define _PSI_TYPES_IMPL_TYPE_H
+
+typedef struct impl_type {
+       char *name;
+       token_t type;
+} impl_type;
+
+static inline impl_type *init_impl_type(token_t type, const char *name) {
+       impl_type *t = calloc(1, sizeof(*t));
+
+       t->type = type;
+       t->name = strdup(name);
+       return t;
+}
+
+static inline void free_impl_type(impl_type *type) {
+       free(type->name);
+       free(type);
+}
+
+#endif