Switch cavlink and nap plugins to use save_dllvar() function for saving SETs

This removes the only module uses of dll_variable, allowing it to be removed from the module
exports.
This commit is contained in:
Kevin Easton
2017-11-06 17:01:36 +11:00
parent 3f047ab2a9
commit fcda7a4d55
3 changed files with 47 additions and 31 deletions

View File

@@ -1331,7 +1331,6 @@ BUILT_IN_DLL(naphelp)
BUILT_IN_DLL(napsave)
{
IrcVariableDll *newv = NULL;
FILE *outf = NULL;
char *expanded = NULL;
char buffer[NAP_BUFFER_SIZE+1];
@@ -1348,21 +1347,32 @@ char *p = NULL;
new_free(&expanded);
return;
}
for (newv = dll_variable; newv; newv = newv->next)
{
if (!my_strnicmp(newv->name, "napster", 7))
{
if (newv->type == STR_TYPE_VAR)
{
if (newv->string)
fprintf(outf, "SET %s %s\n", newv->name, newv->string);
}
else if (newv->type == BOOL_TYPE_VAR)
fprintf(outf, "SET %s %s\n", newv->name, on_off(newv->integer));
else
fprintf(outf, "SET %s %d\n", newv->name, newv->integer);
}
}
save_dllvar(outf, "napster_prompt");
save_dllvar(outf, "napster_window");
save_dllvar(outf, "napster_host");
save_dllvar(outf, "napster_user");
save_dllvar(outf, "napster_pass");
save_dllvar(outf, "napster_email");
save_dllvar(outf, "napster_port");
save_dllvar(outf, "napster_dataport");
save_dllvar(outf, "napster_speed");
save_dllvar(outf, "napster_max_results");
save_dllvar(outf, "napster_numeric");
save_dllvar(outf, "napster_download_dir");
save_dllvar(outf, "napster_names_nickcolor");
save_dllvar(outf, "napster_hotlist_online");
save_dllvar(outf, "napster_hotlist_offline");
save_dllvar(outf, "napster_show_numeric");
save_dllvar(outf, "napster_window_hidden");
save_dllvar(outf, "napster_resume_download");
save_dllvar(outf, "napster_send_limit");
save_dllvar(outf, "napster_names_columns");
save_dllvar(outf, "napster_share");
save_dllvar(outf, "napster_max_send_nick");
save_dllvar(outf, "napster_format");
save_dllvar(outf, "napster_dir");
for (new = nap_hotlist; new; new = new->next)
m_s3cat(&p, " ", new->nick);
if (p)