From 0931eb36fd5528e336ecb69e801b05e8062b64fd Mon Sep 17 00:00:00 2001 From: fredrik Date: Sat, 14 Apr 2007 03:37:14 +0000 Subject: [PATCH] Update to new dc_queuecmd syntax. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@929 959494ce-11ee-0310-bf91-de5d638817bd --- clients/gaim/gaim-dolcon.c | 4 ++-- clients/gnome-trans-applet/conduit-dclib.c | 4 ++-- clients/gtk2/main.c | 26 +++++++++++++------------- lib/guile/dolcon-guile.c | 4 ++-- lib/python/dolmod.c | 4 ++-- lib/uimisc.c | 12 ++++++------ 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/clients/gaim/gaim-dolcon.c b/clients/gaim/gaim-dolcon.c index 94199d7..c52feb6 100644 --- a/clients/gaim/gaim-dolcon.c +++ b/clients/gaim/gaim-dolcon.c @@ -276,7 +276,7 @@ static int gi_sendchat(GaimConnection *gc, int id, const char *what, GaimMessage /* XXX: Handle chat rooms */ if((wwhat = icmbstowcs((char *)what, "UTF-8")) == NULL) return(-errno); - dc_queuecmd(NULL, NULL, L"sendchat", L"%%i", fn->id, L"1", L"", L"%%ls", wwhat, NULL); + dc_queuecmd(NULL, NULL, L"sendchat", L"%i", fn->id, L"1", L"", L"%ls", wwhat, NULL); free(wwhat); updatewrite(data); return(0); @@ -316,7 +316,7 @@ static int gi_sendim(GaimConnection *gc, const char *who, const char *what, Gaim free(wwho); return(-en); } - dc_queuecmd(NULL, NULL, L"sendchat", L"%%i", fn->id, L"0", L"%%ls", peer->nick, L"%%ls", wwhat, NULL); + dc_queuecmd(NULL, NULL, L"sendchat", L"%i", fn->id, L"0", L"%ls", peer->nick, L"%ls", wwhat, NULL); free(wwho); free(wwhat); updatewrite(data); diff --git a/clients/gnome-trans-applet/conduit-dclib.c b/clients/gnome-trans-applet/conduit-dclib.c index c267db2..a610f66 100644 --- a/clients/gnome-trans-applet/conduit-dclib.c +++ b/clients/gnome-trans-applet/conduit-dclib.c @@ -142,7 +142,7 @@ static void inittrans(struct conduit *conduit, struct dc_transfer *dt) dtd->conduit = conduit; dt->udata = dtd; dt->destroycb = dtfreecb; - dc_queuecmd(lstrargcb, dt, L"lstrarg", L"%%i", dt->id, NULL); + dc_queuecmd(lstrargcb, dt, L"lstrarg", L"%i", dt->id, NULL); } static void trlistcb(int resp, struct conduit *conduit) @@ -312,7 +312,7 @@ static int cancel(struct conduit *conduit, struct transfer *transfer) { if(((dtd = dt->udata) != NULL) && (dtd->ct == transfer)) { - dc_queuecmd(NULL, NULL, L"cancel", L"%%i", dt->id, NULL); + dc_queuecmd(NULL, NULL, L"cancel", L"%i", dt->id, NULL); return(0); } } diff --git a/clients/gtk2/main.c b/clients/gtk2/main.c index aebeaac..88d68b9 100644 --- a/clients/gtk2/main.c +++ b/clients/gtk2/main.c @@ -1043,7 +1043,7 @@ gint ksupdatecb(gpointer data) } } addtobuf(users, NULL); - ksquerytag = dc_queuecmd(NULL, NULL, L"filtercmd", L"userspeeda", L"%%a", users, NULL); + ksquerytag = dc_queuecmd(NULL, NULL, L"filtercmd", L"userspeeda", L"%a", users, NULL); dc_freewcsarr(users); } return(TRUE); @@ -1145,7 +1145,7 @@ void handleresps(void) if(ires->argv[0].val.num == nextsrch) { if(cursrch != -1) - dc_queuecmd(NULL, NULL, L"cansrch", L"%%i", cursrch, NULL); + dc_queuecmd(NULL, NULL, L"cansrch", L"%i", cursrch, NULL); cursrch = nextsrch; nextsrch = -1; gtk_widget_set_sensitive(main_realsrch, TRUE); @@ -1432,7 +1432,7 @@ void cb_main_fnaddr_activate(GtkWidget *widget, gpointer data) toks[0] = srealloc(toks[0], (wcslen(toks[0]) + 5) * sizeof(wchar_t)); wcscat(toks[0], L":411"); } - tag = dc_queuecmd(NULL, NULL, L"cnct", L"dc", L"%%a", toks, NULL); + tag = dc_queuecmd(NULL, NULL, L"cnct", L"dc", L"%a", toks, NULL); dc_freewcsarr(toks); if((resp = dc_gettaggedrespsync(tag)) != NULL) { @@ -1857,7 +1857,7 @@ void cb_main_dcnctbtn_clicked(GtkWidget *widget, gpointer data) return; } gtk_tree_model_get(GTK_TREE_MODEL(fnmodel), &iter, 0, &id, -1); - tag = dc_queuecmd(NULL, NULL, L"dcnct", L"%%i", id, NULL); + tag = dc_queuecmd(NULL, NULL, L"dcnct", L"%i", id, NULL); if((resp = dc_gettaggedrespsync(tag)) != NULL) { if(resp->code == 502) @@ -1902,7 +1902,7 @@ void cb_main_phublist_activate(GtkWidget *widget, GtkTreePath *path, GtkTreeView buf = g_realloc(buf, strlen(buf) + 5); strcat(buf, ":411"); } - tag = dc_queuecmd(NULL, NULL, L"cnct", L"dc", L"%%s", buf, NULL); + tag = dc_queuecmd(NULL, NULL, L"cnct", L"dc", L"%s", buf, NULL); g_free(buf); gtk_entry_set_text(GTK_ENTRY(main_fnaddr), ""); if((resp = dc_gettaggedrespsync(tag)) != NULL) @@ -1963,7 +1963,7 @@ void cb_main_chatstr_activate(GtkWidget *widget, gpointer data) return; } buf = gtk_entry_get_text(GTK_ENTRY(main_chatstr)); - tag = dc_queuecmd(NULL, NULL, L"sendchat", L"%%i", curchat, L"1", L"", L"%%s", buf, NULL); + tag = dc_queuecmd(NULL, NULL, L"sendchat", L"%i", curchat, L"1", L"", L"%s", buf, NULL); if((resp = dc_gettaggedrespsync(tag)) != NULL) { if(resp->code == 502) @@ -2053,7 +2053,7 @@ void cb_main_srchbtn_clicked(GtkWidget *widget, gpointer data) msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Please enter a search expression before searching")); return; } - tag = dc_queuecmd(NULL, NULL, L"search", L"all", L"%%a", toks, NULL); + tag = dc_queuecmd(NULL, NULL, L"search", L"all", L"%a", toks, NULL); dc_freewcsarr(toks); if((resp = dc_gettaggedrespsync(tag)) != NULL) { @@ -2088,7 +2088,7 @@ void cb_main_srchcanbtn_clicked(GtkWidget *widget, gpointer data) { if(nextsrch == -1) return; - dc_queuecmd(NULL, NULL, L"cansrch", L"%%i", nextsrch, NULL); + dc_queuecmd(NULL, NULL, L"cansrch", L"%i", nextsrch, NULL); nextsrch = -1; gtk_widget_set_sensitive(main_realsrch, TRUE); gtk_widget_set_sensitive(main_simplesrch, TRUE); @@ -2111,7 +2111,7 @@ gboolean cb_main_trlist_keypress(GtkWidget *widget, GdkEventKey *event, gpointer if(gtk_tree_selection_get_selected(sel, &model, &iter)) { gtk_tree_model_get(model, &iter, 0, &id, -1); - tag = dc_queuecmd(NULL, NULL, L"cancel", L"%%i", id, NULL); + tag = dc_queuecmd(NULL, NULL, L"cancel", L"%i", id, NULL); if((resp = dc_gettaggedrespsync(tag)) != NULL) { if(resp->code == 502) @@ -2175,9 +2175,9 @@ void cb_main_srchres_activate(GtkWidget *widget, GtkTreePath *path, GtkTreeViewC g_free(tfilename); arg = (char *)gtk_entry_get_text(GTK_ENTRY(main_dlarg)); if(*arg) - tag = dc_queuecmd(NULL, NULL, L"download", fnet, L"%%ls", peerid, L"%%ls", filename, L"%%i", size, L"hash", L"%%ls", (hash == NULL)?L"":hash, L"user", L"%%s", arg, NULL); + tag = dc_queuecmd(NULL, NULL, L"download", fnet, L"%ls", peerid, L"%ls", filename, L"%i", size, L"hash", L"%ls", (hash == NULL)?L"":hash, L"user", L"%s", arg, NULL); else - tag = dc_queuecmd(NULL, NULL, L"download", fnet, L"%%ls", peerid, L"%%ls", filename, L"%%i", size, L"hash", L"%%ls", (hash == NULL)?L"":hash, NULL); + tag = dc_queuecmd(NULL, NULL, L"download", fnet, L"%ls", peerid, L"%ls", filename, L"%i", size, L"hash", L"%ls", (hash == NULL)?L"":hash, NULL); free(fnet); free(peerid); free(filename); @@ -2309,7 +2309,7 @@ void cb_main_trcancel_activate(GtkWidget *widget, gpointer data) if(gtk_tree_selection_get_selected(sel, &model, &iter)) { gtk_tree_model_get(model, &iter, 0, &id, -1); - tag = dc_queuecmd(NULL, NULL, L"cancel", L"%%i", id, NULL); + tag = dc_queuecmd(NULL, NULL, L"cancel", L"%i", id, NULL); if((resp = dc_gettaggedrespsync(tag)) != NULL) { if(resp->code == 502) @@ -2415,7 +2415,7 @@ int rmres(char *id) struct dc_response *resp; ret = -1; - tag = dc_queuecmd(NULL, NULL, L"filtercmd", L"rmres", L"%%s", id, NULL); + tag = dc_queuecmd(NULL, NULL, L"filtercmd", L"rmres", L"%s", id, NULL); if((resp = dc_gettaggedrespsync(tag)) != NULL) { if(resp->numlines > 0) diff --git a/lib/guile/dolcon-guile.c b/lib/guile/dolcon-guile.c index 1be85a0..900345a 100644 --- a/lib/guile/dolcon-guile.c +++ b/lib/guile/dolcon-guile.c @@ -221,11 +221,11 @@ static SCM scm_dc_qcmd(SCM argv, SCM callback) addtobuf(toks, NULL); if(callback == SCM_UNDEFINED) { - tag = dc_queuecmd(NULL, NULL, cmd, L"%%a", toks, NULL); + tag = dc_queuecmd(NULL, NULL, cmd, L"%a", toks, NULL); } else { scmcb = scm_must_malloc(sizeof(*scmcb), "scmcb"); scm_gc_protect_object(scmcb->subr = callback); - tag = dc_queuecmd(qcmd_scmcb, scmcb, cmd, L"%%a", toks, NULL); + tag = dc_queuecmd(qcmd_scmcb, scmcb, cmd, L"%a", toks, NULL); } dc_freewcsarr(toks); if(cmd != NULL) diff --git a/lib/python/dolmod.c b/lib/python/dolmod.c index 71623a6..4f46682 100644 --- a/lib/python/dolmod.c +++ b/lib/python/dolmod.c @@ -267,13 +267,13 @@ static PyObject *mod_qcmd(PyObject *self, PyObject *args, PyObject *kwargs) if(PyMapping_HasKeyString(kwargs, "cb")) { cb = PyMapping_GetItemString(kwargs, "cb"); if(PyCallable_Check(cb)) { - ret = PyInt_FromLong(dc_queuecmd(qcmd_cb, cb, cmd, L"%%a", toks, NULL)); + ret = PyInt_FromLong(dc_queuecmd(qcmd_cb, cb, cmd, L"%a", toks, NULL)); } else { PyErr_SetString(PyExc_TypeError, "Callback must be callable"); Py_DECREF(cb); } } else { - ret = PyInt_FromLong(dc_queuecmd(NULL, NULL, cmd, L"%%a", toks, NULL)); + ret = PyInt_FromLong(dc_queuecmd(NULL, NULL, cmd, L"%a", toks, NULL)); } out: diff --git a/lib/uimisc.c b/lib/uimisc.c index 8252a7e..a79f6a0 100644 --- a/lib/uimisc.c +++ b/lib/uimisc.c @@ -190,7 +190,7 @@ static void process_pam(struct dc_response *resp, struct logindata *data) data->callback(DC_LOGIN_ERR_CONV, NULL, data->data); freelogindata(data); } else { - dc_queuecmd(logincallback, data, L"pass", L"%%s", buf, NULL); + dc_queuecmd(logincallback, data, L"pass", L"%s", buf, NULL); } if(buf != NULL) { @@ -249,7 +249,7 @@ static void process_krb5(struct dc_response *resp, struct logindata *data) { case 0: buf = hexencode(krb->reqbuf.data, krb->reqbuf.length); - dc_queuecmd(logincallback, data, L"pass", L"%%s", buf, NULL); + dc_queuecmd(logincallback, data, L"pass", L"%s", buf, NULL); free(buf); krb->state = 1; break; @@ -522,7 +522,7 @@ static int logincallback(struct dc_response *resp) } username = pwent->pw_name; } - dc_queuecmd(logincallback, data, L"login", data->mech->name, L"%%s", username, NULL); + dc_queuecmd(logincallback, data, L"login", data->mech->name, L"%s", username, NULL); } } } else if(!wcscmp(resp->cmdname, L"login") || !wcscmp(resp->cmdname, L"pass")) { @@ -1071,9 +1071,9 @@ static int getpalistcallback(struct dc_response *resp) adddatum(fn, ires->argv[0].val.str, ires->argv[1].val.num); dc_freeires(ires); } - dc_queuecmd(getpeerlistcallback, data, L"lspeers", L"%%i", fn->id, NULL); + dc_queuecmd(getpeerlistcallback, data, L"lspeers", L"%i", fn->id, NULL); } else if(resp->code == 201) { - dc_queuecmd(getpeerlistcallback, data, L"lspeers", L"%%i", fn->id, NULL); + dc_queuecmd(getpeerlistcallback, data, L"lspeers", L"%i", fn->id, NULL); } else { data->callback(fn, resp->code, data->data); free(data); @@ -1109,7 +1109,7 @@ void dc_getpeerlistasync(struct dc_fnetnode *fn, void (*callback)(struct dc_fnet data->callback = callback; data->fnid = fn->id; data->data = udata; - dc_queuecmd(getpalistcallback, data, L"lspa", L"%%i", fn->id, NULL); + dc_queuecmd(getpalistcallback, data, L"lspa", L"%i", fn->id, NULL); } void dc_uimisc_disconnected(void) -- 2.11.0