api refactoring
[m6w6/ext-psi] / src / types / impl_def_val.h
diff --git a/src/types/impl_def_val.h b/src/types/impl_def_val.h
new file mode 100644 (file)
index 0000000..189e349
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _PSI_TYPES_IMPL_DEF_VAL_H
+#define _PSI_TYPES_IMPL_DEF_VAL_H
+
+typedef struct impl_def_val {
+       token_t type;
+       char *text;
+} impl_def_val;
+
+static inline impl_def_val *init_impl_def_val(token_t t, const char *text) {
+       impl_def_val *def = calloc(1, sizeof(*def));
+       def->type = t;
+       def->text = strdup(text);
+       return def;
+}
+
+static inline void free_impl_def_val(impl_def_val *def) {
+       free(def->text);
+       free(def);
+}
+
+#endif