to match our CodingStyle. --- This avoids c'n'p problems as seen in my recent domhostname patch. Cheers, -- Guido tools/virsh.c | 186 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 2c0446c..2c2f9f1 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1405,7 +1405,7 @@ cmdList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) VIR_FREE(title); } else if (optHostname) { - if (!(hostname = virDomainGetHostname (dom, 0))) + if (!(hostname = virDomainGetHostname(dom, 0))) goto cleanup; vshPrint(ctl, " %-5s %-30s %-10s %-20s\n", id_buf, @@ -1742,7 +1742,7 @@ static const struct _domblkstat_sequence domblkstat_output[] = { VALUE); static bool -cmdDomblkstat (vshControl *ctl, const vshCmd *cmd) +cmdDomblkstat(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom; const char *name = NULL, *device = NULL; @@ -1800,7 +1800,7 @@ cmdDomblkstat (vshControl *ctl, const vshCmd *cmd) } else { params = vshCalloc(ctl, nparams, sizeof(*params)); - if (virDomainBlockStatsFlags (dom, device, params, &nparams, 0) < 0) { + if (virDomainBlockStatsFlags(dom, device, params, &nparams, 0) < 0) { vshError(ctl, _("Failed to get block stats %s %s"), name, device); goto cleanup; } @@ -1875,52 +1875,52 @@ static const vshCmdOptDef opts_domifstat[] = { }; static bool -cmdDomIfstat (vshControl *ctl, const vshCmd *cmd) +cmdDomIfstat(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom; const char *name = NULL, *device = NULL; struct _virDomainInterfaceStats stats; - if (!vshConnectionUsability (ctl, ctl->conn)) + if (!vshConnectionUsability(ctl, ctl->conn)) return false; - if (!(dom = vshCommandOptDomain (ctl, cmd, &name))) + if (!(dom = vshCommandOptDomain(ctl, cmd, &name))) return false; - if (vshCommandOptString (cmd, "interface", &device) <= 0) { + if (vshCommandOptString(cmd, "interface", &device) <= 0) { virDomainFree(dom); return false; } - if (virDomainInterfaceStats (dom, device, &stats, sizeof(stats)) == -1) { + if (virDomainInterfaceStats(dom, device, &stats, sizeof(stats)) == -1) { vshError(ctl, _("Failed to get interface stats %s %s"), name, device); virDomainFree(dom); return false; } if (stats.rx_bytes >= 0) - vshPrint (ctl, "%s rx_bytes %lld\n", device, stats.rx_bytes); + vshPrint(ctl, "%s rx_bytes %lld\n", device, stats.rx_bytes); if (stats.rx_packets >= 0) - vshPrint (ctl, "%s rx_packets %lld\n", device, stats.rx_packets); + vshPrint(ctl, "%s rx_packets %lld\n", device, stats.rx_packets); if (stats.rx_errs >= 0) - vshPrint (ctl, "%s rx_errs %lld\n", device, stats.rx_errs); + vshPrint(ctl, "%s rx_errs %lld\n", device, stats.rx_errs); if (stats.rx_drop >= 0) - vshPrint (ctl, "%s rx_drop %lld\n", device, stats.rx_drop); + vshPrint(ctl, "%s rx_drop %lld\n", device, stats.rx_drop); if (stats.tx_bytes >= 0) - vshPrint (ctl, "%s tx_bytes %lld\n", device, stats.tx_bytes); + vshPrint(ctl, "%s tx_bytes %lld\n", device, stats.tx_bytes); if (stats.tx_packets >= 0) - vshPrint (ctl, "%s tx_packets %lld\n", device, stats.tx_packets); + vshPrint(ctl, "%s tx_packets %lld\n", device, stats.tx_packets); if (stats.tx_errs >= 0) - vshPrint (ctl, "%s tx_errs %lld\n", device, stats.tx_errs); + vshPrint(ctl, "%s tx_errs %lld\n", device, stats.tx_errs); if (stats.tx_drop >= 0) - vshPrint (ctl, "%s tx_drop %lld\n", device, stats.tx_drop); + vshPrint(ctl, "%s tx_drop %lld\n", device, stats.tx_drop); virDomainFree(dom); return true; @@ -1944,7 +1944,7 @@ static const vshCmdOptDef opts_domif_setlink[] = { }; static bool -cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd) +cmdDomIfSetLink(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom; const char *iface; @@ -2120,7 +2120,7 @@ static const vshCmdOptDef opts_domif_getlink[] = { }; static bool -cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd) +cmdDomIfGetLink(vshControl *ctl, const vshCmd *cmd) { virDomainPtr dom; const char *iface = NULL; @@ -2138,13 +2138,13 @@ cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd) xmlNodePtr cur = NULL; xmlXPathObjectPtr obj = NULL; - if (!vshConnectionUsability (ctl, ctl->conn)) + if (!vshConnectionUsability(ctl, ctl->conn)) return false; - if (!(dom = vshCommandOptDomain (ctl, cmd, NULL))) + if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) return false; - if (vshCommandOptString (cmd, "interface", &iface) <= 0) { + if (vshCommandOptString(cmd, "interface", &iface) <= 0) { virDomainFree(dom); return false; } @@ -2455,7 +2455,7 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd) if (!(dom = vshCommandOptDomain(ctl, cmd, &name))) return false; - nr_stats = virDomainMemoryStats (dom, stats, VIR_DOMAIN_MEMORY_STAT_NR, 0); + nr_stats = virDomainMemoryStats(dom, stats, VIR_DOMAIN_MEMORY_STAT_NR, 0); if (nr_stats == -1) { vshError(ctl, _("Failed to get memory statistics for domain %s"), name); virDomainFree(dom); @@ -2464,21 +2464,21 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd) for (i = 0; i < nr_stats; i++) { if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_SWAP_IN) - vshPrint (ctl, "swap_in %llu\n", stats[i].val); + vshPrint(ctl, "swap_in %llu\n", stats[i].val); if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_SWAP_OUT) - vshPrint (ctl, "swap_out %llu\n", stats[i].val); + vshPrint(ctl, "swap_out %llu\n", stats[i].val); if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT) - vshPrint (ctl, "major_fault %llu\n", stats[i].val); + vshPrint(ctl, "major_fault %llu\n", stats[i].val); if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT) - vshPrint (ctl, "minor_fault %llu\n", stats[i].val); + vshPrint(ctl, "minor_fault %llu\n", stats[i].val); if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_UNUSED) - vshPrint (ctl, "unused %llu\n", stats[i].val); + vshPrint(ctl, "unused %llu\n", stats[i].val); if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_AVAILABLE) - vshPrint (ctl, "available %llu\n", stats[i].val); + vshPrint(ctl, "available %llu\n", stats[i].val); if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON) - vshPrint (ctl, "actual %llu\n", stats[i].val); + vshPrint(ctl, "actual %llu\n", stats[i].val); if (stats[i].tag == VIR_DOMAIN_MEMORY_STAT_RSS) - vshPrint (ctl, "rss %llu\n", stats[i].val); + vshPrint(ctl, "rss %llu\n", stats[i].val); } virDomainFree(dom); @@ -2514,7 +2514,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd) if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) return false; - if (vshCommandOptString (cmd, "device", &device) <= 0) { + if (vshCommandOptString(cmd, "device", &device) <= 0) { virDomainFree(dom); return false; } @@ -3541,7 +3541,7 @@ doSave(void *opaque) out: pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); out_sig: - if (dom) virDomainFree (dom); + if (dom) virDomainFree(dom); VIR_FREE(xml); ignore_value(safewrite(data->writefd, &ret, sizeof(ret))); } @@ -3820,7 +3820,7 @@ out: pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); out_sig: if (dom) - virDomainFree (dom); + virDomainFree(dom); ignore_value(safewrite(data->writefd, &ret, sizeof(ret))); } @@ -4297,7 +4297,7 @@ out: pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); out_sig: if (dom) - virDomainFree (dom); + virDomainFree(dom); ignore_value(safewrite(data->writefd, &ret, sizeof(ret))); } @@ -7066,18 +7066,18 @@ static const vshCmdInfo info_capabilities[] = { }; static bool -cmdCapabilities (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) +cmdCapabilities(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) { char *caps; if (!vshConnectionUsability(ctl, ctl->conn)) return false; - if ((caps = virConnectGetCapabilities (ctl->conn)) == NULL) { + if ((caps = virConnectGetCapabilities(ctl->conn)) == NULL) { vshError(ctl, "%s", _("failed to get capabilities")); return false; } - vshPrint (ctl, "%s\n", caps); + vshPrint(ctl, "%s\n", caps); VIR_FREE(caps); return true; @@ -7364,7 +7364,7 @@ static const vshCmdOptDef opts_migrate[] = { }; static void -doMigrate (void *opaque) +doMigrate(void *opaque) { char ret = '1'; virDomainPtr dom = NULL; @@ -7384,10 +7384,10 @@ doMigrate (void *opaque) if (pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask) < 0) goto out_sig; - if (!vshConnectionUsability (ctl, ctl->conn)) + if (!vshConnectionUsability(ctl, ctl->conn)) goto out; - if (!(dom = vshCommandOptDomain (ctl, cmd, NULL))) + if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) goto out; if (vshCommandOptString(cmd, "desturi", &desturi) <= 0 || @@ -7452,7 +7452,7 @@ doMigrate (void *opaque) virConnectPtr dconn = NULL; virDomainPtr ddom = NULL; - dconn = virConnectOpenAuth (desturi, virConnectAuthPtrDefault, 0); + dconn = virConnectOpenAuth(desturi, virConnectAuthPtrDefault, 0); if (!dconn) goto out; ddom = virDomainMigrate2(dom, dconn, xml, flags, dname, migrateuri, 0); @@ -7460,13 +7460,13 @@ doMigrate (void *opaque) virDomainFree(ddom); ret = '0'; } - virConnectClose (dconn); + virConnectClose(dconn); } out: pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); out_sig: - if (dom) virDomainFree (dom); + if (dom) virDomainFree(dom); VIR_FREE(xml); ignore_value(safewrite(data->writefd, &ret, sizeof(ret))); } @@ -9378,7 +9378,7 @@ cmdInterfaceDefine(vshControl *ctl, const vshCmd *cmd) if (iface != NULL) { vshPrint(ctl, _("Interface %s defined from %s\n"), virInterfaceGetName(iface), from); - virInterfaceFree (iface); + virInterfaceFree(iface); } else { vshError(ctl, _("Failed to define interface from %s"), from); ret = false; @@ -12073,7 +12073,7 @@ cmdVolUploadSource(virStreamPtr st ATTRIBUTE_UNUSED, } static bool -cmdVolUpload (vshControl *ctl, const vshCmd *cmd) +cmdVolUpload(vshControl *ctl, const vshCmd *cmd) { const char *file = NULL; virStorageVolPtr vol = NULL; @@ -12164,7 +12164,7 @@ static const vshCmdOptDef opts_vol_download[] = { }; static bool -cmdVolDownload (vshControl *ctl, const vshCmd *cmd) +cmdVolDownload(vshControl *ctl, const vshCmd *cmd) { const char *file = NULL; virStorageVolPtr vol = NULL; @@ -13655,7 +13655,7 @@ static const vshCmdOptDef opts_node_device_detach[] = { }; static bool -cmdNodeDeviceDetach (vshControl *ctl, const vshCmd *cmd) +cmdNodeDeviceDetach(vshControl *ctl, const vshCmd *cmd) { const char *name = NULL; virNodeDevicePtr device; @@ -13698,7 +13698,7 @@ static const vshCmdOptDef opts_node_device_reattach[] = { }; static bool -cmdNodeDeviceReAttach (vshControl *ctl, const vshCmd *cmd) +cmdNodeDeviceReAttach(vshControl *ctl, const vshCmd *cmd) { const char *name = NULL; virNodeDevicePtr device; @@ -13739,7 +13739,7 @@ static const vshCmdOptDef opts_node_device_reset[] = { }; static bool -cmdNodeDeviceReset (vshControl *ctl, const vshCmd *cmd) +cmdNodeDeviceReset(vshControl *ctl, const vshCmd *cmd) { const char *name = NULL; virNodeDevicePtr device; @@ -13774,14 +13774,14 @@ static const vshCmdInfo info_hostname[] = { }; static bool -cmdHostname (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) +cmdHostname(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) { char *hostname; if (!vshConnectionUsability(ctl, ctl->conn)) return false; - hostname = virConnectGetHostname (ctl->conn); + hostname = virConnectGetHostname(ctl->conn); if (hostname == NULL) { vshError(ctl, "%s", _("failed to get hostname")); return false; @@ -13803,20 +13803,20 @@ static const vshCmdInfo info_uri[] = { }; static bool -cmdURI (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) +cmdURI(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) { char *uri; if (!vshConnectionUsability(ctl, ctl->conn)) return false; - uri = virConnectGetURI (ctl->conn); + uri = virConnectGetURI(ctl->conn); if (uri == NULL) { vshError(ctl, "%s", _("failed to get URI")); return false; } - vshPrint (ctl, "%s\n", uri); + vshPrint(ctl, "%s\n", uri); VIR_FREE(uri); return true; @@ -13833,20 +13833,20 @@ static const vshCmdInfo info_sysinfo[] = { }; static bool -cmdSysinfo (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) +cmdSysinfo(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) { char *sysinfo; if (!vshConnectionUsability(ctl, ctl->conn)) return false; - sysinfo = virConnectGetSysinfo (ctl->conn, 0); + sysinfo = virConnectGetSysinfo(ctl->conn, 0); if (sysinfo == NULL) { vshError(ctl, "%s", _("failed to get sysinfo")); return false; } - vshPrint (ctl, "%s", sysinfo); + vshPrint(ctl, "%s", sysinfo); VIR_FREE(sysinfo); return true; @@ -14161,7 +14161,7 @@ static const vshCmdOptDef opts_domhostname[] = { }; static bool -cmdDomHostname (vshControl *ctl, const vshCmd *cmd) +cmdDomHostname(vshControl *ctl, const vshCmd *cmd) { char *hostname; virDomainPtr dom; @@ -14173,13 +14173,13 @@ cmdDomHostname (vshControl *ctl, const vshCmd *cmd) if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) return false; - hostname = virDomainGetHostname (dom, 0); + hostname = virDomainGetHostname(dom, 0); if (hostname == NULL) { vshError(ctl, "%s", _("failed to get hostname")); goto error; } - vshPrint (ctl, "%s\n", hostname); + vshPrint(ctl, "%s\n", hostname); ret = true; error: @@ -15962,7 +15962,7 @@ no_memory: /* Common code for the edit / net-edit / pool-edit functions which follow. */ static char * -editWriteToTempFile (vshControl *ctl, const char *doc) +editWriteToTempFile(vshControl *ctl, const char *doc) { char *ret; const char *tmpdir; @@ -15982,18 +15982,18 @@ editWriteToTempFile (vshControl *ctl, const char *doc) return NULL; } - if (safewrite (fd, doc, strlen (doc)) == -1) { + if (safewrite(fd, doc, strlen(doc)) == -1) { vshError(ctl, _("write: %s: failed to write to temporary file: %s"), ret, strerror(errno)); VIR_FORCE_CLOSE(fd); - unlink (ret); + unlink(ret); VIR_FREE(ret); return NULL; } if (VIR_CLOSE(fd) < 0) { vshError(ctl, _("close: %s: failed to write or close temporary file: %s"), ret, strerror(errno)); - unlink (ret); + unlink(ret); VIR_FREE(ret); return NULL; } @@ -16007,7 +16007,7 @@ editWriteToTempFile (vshControl *ctl, const char *doc) "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-/_.:@" static int -editFile (vshControl *ctl, const char *filename) +editFile(vshControl *ctl, const char *filename) { const char *editor; virCommandPtr cmd; @@ -16015,9 +16015,9 @@ editFile (vshControl *ctl, const char *filename) int outfd = STDOUT_FILENO; int errfd = STDERR_FILENO; - editor = getenv ("VISUAL"); + editor = getenv("VISUAL"); if (!editor) - editor = getenv ("EDITOR"); + editor = getenv("EDITOR"); if (!editor) editor = "vi"; /* could be cruel & default to ed(1) here */ @@ -16029,8 +16029,8 @@ editFile (vshControl *ctl, const char *filename) * is why sudo scrubs it by default). Conversely, if the editor * is safe, we can run it directly rather than wasting a shell. */ - if (strspn (editor, ACCEPTED_CHARS) != strlen (editor)) { - if (strspn (filename, ACCEPTED_CHARS) != strlen (filename)) { + if (strspn(editor, ACCEPTED_CHARS) != strlen(editor)) { + if (strspn(filename, ACCEPTED_CHARS) != strlen(filename)) { vshError(ctl, _("%s: temporary filename contains shell meta or other " "unacceptable characters (is $TMPDIR wrong?)"), @@ -16059,7 +16059,7 @@ cleanup: } static char * -editReadBackFile (vshControl *ctl, const char *filename) +editReadBackFile(vshControl *ctl, const char *filename) { char *ret; @@ -16135,7 +16135,7 @@ cmdPwd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) strerror(errno)); ret = false; } else { - vshPrint (ctl, _("%s\n"), cwd); + vshPrint(ctl, _("%s\n"), cwd); VIR_FREE(cwd); } @@ -16163,7 +16163,7 @@ static const vshCmdOptDef opts_echo[] = { * quotes for later evaluation. */ static bool -cmdEcho (vshControl *ctl, const vshCmd *cmd) +cmdEcho(vshControl *ctl, const vshCmd *cmd) { bool shell = false; bool xml = false; @@ -16248,7 +16248,7 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd) #define EDIT_GET_XML virDomainGetXMLDesc(dom, flags) #define EDIT_NOT_CHANGED \ vshPrint(ctl, _("Domain %s XML configuration not changed.\n"), \ - virDomainGetName (dom)); \ + virDomainGetName(dom)); \ ret = true; goto edit_cleanup; #define EDIT_DEFINE \ (dom_edited = virDomainDefineXML(ctl->conn, doc_edited)) @@ -16320,7 +16320,7 @@ cmdNetworkEdit(vshControl *ctl, const vshCmd *cmd) #define EDIT_GET_XML vshNetworkGetXMLDesc(network) #define EDIT_NOT_CHANGED \ vshPrint(ctl, _("Network %s XML configuration not changed.\n"), \ - virNetworkGetName (network)); \ + virNetworkGetName(network)); \ ret = true; goto edit_cleanup; #define EDIT_DEFINE \ (network_edited = virNetworkDefineXML(ctl->conn, doc_edited)) @@ -16389,7 +16389,7 @@ cmdPoolEdit(vshControl *ctl, const vshCmd *cmd) #define EDIT_GET_XML virStoragePoolGetXMLDesc(pool, flags) #define EDIT_NOT_CHANGED \ vshPrint(ctl, _("Pool %s XML configuration not changed.\n"), \ - virStoragePoolGetName (pool)); \ + virStoragePoolGetName(pool)); \ ret = true; goto edit_cleanup; #define EDIT_DEFINE \ (pool_edited = virStoragePoolDefineXML(ctl->conn, doc_edited, 0)) @@ -19192,14 +19192,14 @@ vshCommandOptArgv(const vshCmd *cmd, const vshCmdOpt *opt) If not, give a diagnostic and return false. If so, return true. */ static bool -cmd_has_option (vshControl *ctl, const vshCmd *cmd, const char *optname) +cmd_has_option(vshControl *ctl, const vshCmd *cmd, const char *optname) { /* Iterate through cmd->opts, to ensure that there is an entry with name OPTNAME and type VSH_OT_DATA. */ bool found = false; const vshCmdOpt *opt; for (opt = cmd->opts; opt; opt = opt->next) { - if (STREQ (opt->def->name, optname) && opt->def->type == VSH_OT_DATA) { + if (STREQ(opt->def->name, optname) && opt->def->type == VSH_OT_DATA) { found = true; break; } @@ -19219,7 +19219,7 @@ vshCommandOptDomainBy(vshControl *ctl, const vshCmd *cmd, const char *n = NULL; int id; const char *optname = "domain"; - if (!cmd_has_option (ctl, cmd, optname)) + if (!cmd_has_option(ctl, cmd, optname)) return NULL; if (vshCommandOptString(cmd, optname, &n) <= 0) @@ -19266,7 +19266,7 @@ vshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, virNetworkPtr network = NULL; const char *n = NULL; const char *optname = "network"; - if (!cmd_has_option (ctl, cmd, optname)) + if (!cmd_has_option(ctl, cmd, optname)) return NULL; if (vshCommandOptString(cmd, optname, &n) <= 0) @@ -19305,7 +19305,7 @@ vshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd, virNWFilterPtr nwfilter = NULL; const char *n = NULL; const char *optname = "nwfilter"; - if (!cmd_has_option (ctl, cmd, optname)) + if (!cmd_has_option(ctl, cmd, optname)) return NULL; if (vshCommandOptString(cmd, optname, &n) <= 0) @@ -19346,7 +19346,7 @@ vshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd, if (!optname) optname = "interface"; - if (!cmd_has_option (ctl, cmd, optname)) + if (!cmd_has_option(ctl, cmd, optname)) return NULL; if (vshCommandOptString(cmd, optname, &n) <= 0) @@ -19479,7 +19479,7 @@ vshCommandOptSecret(vshControl *ctl, const vshCmd *cmd, const char **name) const char *n = NULL; const char *optname = "secret"; - if (!cmd_has_option (ctl, cmd, optname)) + if (!cmd_has_option(ctl, cmd, optname)) return NULL; if (vshCommandOptString(cmd, optname, &n) <= 0) @@ -19565,7 +19565,7 @@ typedef enum { } vshCommandToken; typedef struct __vshCommandParser { - vshCommandToken (*getNextArg)(vshControl *, struct __vshCommandParser *, + vshCommandToken(*getNextArg)(vshControl *, struct __vshCommandParser *, char **); /* vshCommandStringGetArg() */ char *pos; @@ -20681,7 +20681,7 @@ vshReadlineInit(vshControl *ctl) } static void -vshReadlineDeinit (vshControl *ctl) +vshReadlineDeinit(vshControl *ctl) { if (ctl->historyfile != NULL) { if (mkdir(ctl->historydir, 0755) < 0 && errno != EEXIST) { @@ -20698,43 +20698,43 @@ vshReadlineDeinit (vshControl *ctl) } static char * -vshReadline (vshControl *ctl ATTRIBUTE_UNUSED, const char *prompt) +vshReadline(vshControl *ctl ATTRIBUTE_UNUSED, const char *prompt) { - return readline (prompt); + return readline(prompt); } #else /* !USE_READLINE */ static int -vshReadlineInit (vshControl *ctl ATTRIBUTE_UNUSED) +vshReadlineInit(vshControl *ctl ATTRIBUTE_UNUSED) { /* empty */ return 0; } static void -vshReadlineDeinit (vshControl *ctl ATTRIBUTE_UNUSED) +vshReadlineDeinit(vshControl *ctl ATTRIBUTE_UNUSED) { /* empty */ } static char * -vshReadline (vshControl *ctl, const char *prompt) +vshReadline(vshControl *ctl, const char *prompt) { char line[1024]; char *r; int len; - fputs (prompt, stdout); - r = fgets (line, sizeof(line), stdin); + fputs(prompt, stdout); + r = fgets(line, sizeof(line), stdin); if (r == NULL) return NULL; /* EOF */ /* Chomp trailing \n */ - len = strlen (r); + len = strlen(r); if (len > 0 && r[len-1] == '\n') r[len-1] = '\0'; - return vshStrdup (ctl, r); + return vshStrdup(ctl, r); } #endif /* !USE_READLINE */ -- 1.7.10.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list