标签:erlang
2. 将你的bifs添加至erts/emulator/beam/bif.tab
bif re:grep/2 bif re:compile/1
erts/emulator/beam/erl_bif_re.c
RUN_OBJS = $(OBJDIR)/erl_bif_re.o \
5. implement your bifs by stealing bits from existing erl_bif_*.c files
参考其余的erl_bif_*.c文件,加入下面这段代码
1 2 3 4 5 | BIF_RETTYPE re_grep_2( BIF_ALIST_2 ){ Eterm result; result = magic_function(); BIF_RET (result); } |
6. 运行make; make install
1 | bif re:grep /2 |
添加至bif.tab时,erl_bif_re.c文件要实现下面这个函数
1 | BIF_RETTYPE re_grep_2( BIF_ALIST_2 ); |
标签:erlang
原文地址:http://blog.csdn.net/erlib/article/details/46374505