aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/utils/make_driver_tab
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/utils/make_driver_tab')
-rwxr-xr-xerts/emulator/utils/make_driver_tab24
1 files changed, 12 insertions, 12 deletions
diff --git a/erts/emulator/utils/make_driver_tab b/erts/emulator/utils/make_driver_tab
index 3eedef21a7..5c68143d58 100755
--- a/erts/emulator/utils/make_driver_tab
+++ b/erts/emulator/utils/make_driver_tab
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2013. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
@@ -88,7 +88,7 @@ foreach (@static_drivers) {
}
# The array itself
-print "\nErlDrvEntry *driver_tab[DRIVER_TAB_SIZE] =\n{\n";
+print "\nErlDrvEntry *driver_tab[] =\n{\n";
foreach (@emu_drivers) {
print " &${_}driver_entry,\n";
@@ -126,7 +126,7 @@ foreach (@nifs) {
}
# The array itself
-print "static ErtsStaticNifEntry static_nif_tab[DRIVER_TAB_SIZE] =\n{\n";
+print "static ErtsStaticNifEntry static_nif_tab[] =\n{\n";
foreach (@nifs) {
my $d = ${_};
@@ -137,19 +137,19 @@ foreach (@nifs) {
print " {NULL,NULL}\n};\n";
print <<EOF;
-ErtsStaticNifInitFPtr erts_static_nif_get_nif_init(const char *name) {
- int i;
- for (i = 0; static_nif_tab[i].nif_name != NULL; i++)
- if (strcmp(name,static_nif_tab[i].nif_name) == 0)
- return static_nif_tab[i].nif_init;
+ErtsStaticNifInitFPtr erts_static_nif_get_nif_init(const char *name, int len) {
+ ErtsStaticNifEntry* p;
+ for (p = static_nif_tab; p->nif_name != NULL; p++)
+ if (strncmp(p->nif_name, name, len) == 0 && p->nif_name[len] == 0)
+ return p->nif_init;
return NULL;
}
int erts_is_static_nif(void *handle) {
- int i;
- for (i = 0; static_nif_tab[i].nif_name != NULL; i++)
- if (((void*)static_nif_tab[i].nif_init) == handle)
- return 1;
+ ErtsStaticNifEntry* p;
+ for (p = static_nif_tab; p->nif_name != NULL; p++)
+ if (((void*)p->nif_init) == handle)
+ return 1;
return 0;
}