char *libname;
if (D->file.filename) {
- size_t i = 0;
- char *libname;
-
dprintf(fd, "// filename=%s (%u errors)\n", D->file.filename, D->errors);
}
while (psi_plist_get(D->file.libnames, i++, &libname)) {
struct psi_decl *decl;
while (psi_plist_get(D->decls, i++, &decl)) {
+ if (decl->extvar) {
+ dprintf(fd, "/* extvar accessor\n");
+ }
psi_decl_dump(fd, decl);
- dprintf(fd, "// %p \n", decl->sym);
+ dprintf(fd, "\n");
+ if (decl->extvar) {
+ dprintf(fd, " extvar accessor */\n");
+ }
}
dprintf(fd, "\n");
}
void psi_decl_dump(int fd, struct psi_decl *decl)
{
- psi_decl_abi_dump(fd, decl->abi);
+ if (decl->abi) {
+ psi_decl_abi_dump(fd, decl->abi);
+ }
dprintf(fd, " ");
/* FIXME: functions returning arrays */
psi_decl_arg_dump(fd, decl->func, 0);
dprintf(fd, ", ...");
}
}
+ if (decl->func->var->array_size) {
+ dprintf(fd, ")[%zu]", decl->func->var->array_size);
+ }
if (decl->redir) {
dprintf(fd, ") __asm__ (\"%s\");", decl->redir);
} else {
void *sym;
void *info;
unsigned varargs:1;
+ unsigned extvar:1;
};
struct psi_decl *psi_decl_init(struct psi_decl_arg *func, struct psi_plist *args);
func_var->name = realloc(func_var->name, strlen(evar->arg->var->name) + sizeof("_set"));
strcat(func_var->name, "_set");
+ decl->extvar = 1;
+
return decl;
}
func_var->name = realloc(func_var->name, strlen(evar->arg->var->name) + sizeof("_get"));
strcat(func_var->name, "_get");
+ decl->extvar = 1;
+
return decl;
}