Red de conocimiento informático - Conocimiento informático - Cómo leer el código fuente de erlang bif

Cómo leer el código fuente de erlang bif

1. Ejecute configure

2. Agregue sus bifs a erts/emulator/beam/bif.tab

bif re:grep/2 bif re :compile. /1

3.Cree un archivo de código C

erts/ emulator/beam/erl_bif_re.c

4. Agregue un archivo de código C a erts /emulator/. /Makefile

RUN_OBJS = $(OBJDIR)/erl_bif_re.o\

5. Implementado robando bits de archivos erl_bif_*.c existentes. Tus bifs

<. p> Consulte el resto de los archivos erl_bif_*.c y agregue el siguiente código BIF_RETTYPE?re_grep_2(BIF_ALIST_2 ){?Eterm?result;?result = magic_function();?BIF_RET(result);}

6. Ejecute make; make install