summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/haskell-bind/utils.c')
-rw-r--r--src/runtime/haskell-bind/utils.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/runtime/haskell-bind/utils.c b/src/runtime/haskell-bind/utils.c
index 8ab1e53e3..8bdb99038 100644
--- a/src/runtime/haskell-bind/utils.c
+++ b/src/runtime/haskell-bind/utils.c
@@ -17,13 +17,15 @@ hspgf_literal_callback_fin(GuFinalizer* self)
hs_free_fun_ptr((HsFunPtr) callback->callback.predict);
}
-PgfLiteralCallback*
-hspgf_new_literal_callback(PgfConcr* concr) {
- GuPool* pool = pgf_concr_get_pool(concr);
+void
+hspgf_callbacks_map_add_literal(PgfConcr* concr, PgfCallbacksMap* callbacks,
+ PgfCId cat, HsFunPtr match, HsFunPtr predict,
+ GuPool* pool)
+{
HSPgfLiteralCallback* callback = gu_new(HSPgfLiteralCallback, pool);
- callback->callback.match = NULL;
- callback->callback.predict = NULL;
+ callback->callback.match = (void*) match;
+ callback->callback.predict = (void*) predict;
callback->fin.fn = hspgf_literal_callback_fin;
gu_pool_finally(pool, &callback->fin);
- return &callback->callback;
+ pgf_callbacks_map_add_literal(concr, callbacks, cat, &callback->callback);
}