Lines Matching defs:names

39  * split <name,base,type,opts> from name into names
43 dllnames(const char* id, const char* name, Dllnames_t* names)
54 if (!names)
56 s = fmtbuf(sizeof(Dllnames_t*) + sizeof(names) - 1);
57 if (n = (s - (char*)0) % sizeof(names))
58 s += sizeof(names) - n;
59 names = (Dllnames_t*)s;
72 b = names->base = names->data;
73 e = b + sizeof(names->data) - 1;
85 names->name = b;
89 names->type = b;
96 names->name = (char*)name;
97 names->type = 0;
99 *(names->path = b) = 0;
100 names->opts = 0;
101 names->id = (char*)id;
102 return names;
106 * return method pointer for <id,version> in names
110 dll_lib(Dllnames_t* names, unsigned long version, Dllerror_f dllerrorf, void* disc)
120 if (!names)
128 if (streq(names->base, lib->base))
138 if (!(dll = dllplugin(names->id, names->name, NiL, version, NiL, RTLD_LAZY, names->path, names->data + sizeof(names->data) - names->path)) && (streq(names->name, names->base) || !(dll = dllplugin(names->id, names->base, NiL, version, NiL, RTLD_LAZY, names->path, names->data + sizeof(names->data) - names->path))))
141 (*dllerrorf)(NiL, disc, 2, "%s: library not found", names->name);
143 errorf("dll", NiL, -1, "dll_lib: %s version %lu library not found", names->name, version);
151 sfsprintf(sym, sizeof(sym), "%s_lib", names->id);
155 (*dllerrorf)(NiL, disc, 2, "%s: %s: initialization function not found in library", names->path, sym);
157 errorf("dll", NiL, -1, "dll_lib: %s version %lu initialization function %s not found in library", names->name, version, sym);
165 if (lib = newof(0, Dll_lib_t, 1, (n = strlen(names->base)) + strlen(names->path) + 1))
168 strcpy(lib->base, names->base);
169 strcpy(lib->path = lib->base + n + 1, names->path);
172 errorf("dll", NiL, -1, "dll_lib: %s version %lu loaded from %s", names->name, version, lib->path);
175 return (*libf)(names->path, disc, names->type);
185 Dllnames_t names;
187 return dll_lib(dllnames(id, name, &names), version, 0, 0);