# Calling functions defined a custom module when embeded in C

**URL:** <https://discourse.julialang.org/t/calling-functions-defined-a-custom-module-when-embeded-in-c/8918>\
**Category:** Community\
**Tags:** question\
**Created:** [February 8, 2018, 6:45am UTC](https://discourse.julialang.org/t/calling-functions-defined-a-custom-module-when-embeded-in-c/8918 "2018-02-08T06:45:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [February 8, 2018, 6:46pm UTC](https://discourse.julialang.org/t/calling-functions-defined-a-custom-module-when-embeded-in-c/8918/3 "2018-02-08T18:46:49Z")

</div>

> [@pemryan](#):
>
> always returns null. What’s the correct way to express ‘using mymodule’ in C functions?

`jl_eval_string("using mymodule")` basically.

I don’t think there’s an API for it. There could be, though given how easy it is to construct this kind of API yourself it certainly won’t be a high priority.

Like `pypy`, the recommended way to use julia functions in julia is to make your own API. You can create a julia function `using_module(name) = eval(:(using $name))` (e.g. with `jl_eval_string`) and just call that function in C. You can also construct the `Expr` (i.e. `jl_expr_t*`) and eval that.

---

_[View the full topic](https://discourse.julialang.org/t/calling-functions-defined-a-custom-module-when-embeded-in-c/8918)._
