search for: c_isspace

Displaying 20 results from an estimated 38 matches for "c_isspace".

2009 Sep 24
1
enabling more syntax-checks
The first c-set cleans up the list of excluded syntax-checks. The second enables the sc_avoid_ctype_macros test and changes each use of a ctype macro like isspace to c_isspace. This makes it so such tests (often parsing-related) is locale-independent. Otherwise, in some odd corner cases (combination of non-C locale and perverted inputs), I suspect that libguestfs tools would mistakenly accept surprising inputs. >From 0ca36888c6975ffa7e03df11bf8ded42156939c7 Mon Sep 1...
2014 Nov 21
3
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...do that manually. > + return NULL; > + } > + if (add_string (&ret, out) == -1) { > + return NULL; > + } > + > + /* Read the lines and split into "key: value". */ > + while (*p) { > + /* leading spaces and tabs */ > + while (*p && c_isspace (*p)) p++; Properly indent such lines, so: while (*p && c_isspace (*p)) p++; (also, a minor optimization is to use ++p instead of p++, as it can avoid a temporary value) > + > + pend = strchrnul (p, '\n'); > + if (*pend == '\n') { > + *pend =...
2016 Jan 27
4
[PATCH] lvm: support lvm2 older than 2.02.107
...LARE_STRINGSBUF (ret); + + p = out; + while (p) { + size_t len; + char *saveptr; + char *lv_attr, *vg_name, *lv_name; + + pend = strchr (p, '\n'); /* Get the next line of output. */ + if (pend) { + *pend = '\0'; + pend++; + } + + while (*p && c_isspace (*p)) /* Skip any leading whitespace. */ + p++; + + /* Sigh, skip trailing whitespace too. "pvs", I'm looking at you. */ + len = strlen (p)-1; + while (*p && c_isspace (p[len])) + p[len--] = '\0'; + + if (!*p) { /* Empty line? Skip it. */ +...
2014 Nov 21
0
[PATCH 6/6] New API: btrfs_subvolume_show
.... */ + if (add_string (&ret, strdup("path")) == -1) { + return NULL; + } + if (add_string (&ret, out) == -1) { + return NULL; + } + + /* Read the lines and split into "key: value". */ + while (*p) { + /* leading spaces and tabs */ + while (*p && c_isspace (*p)) p++; + + pend = strchrnul (p, '\n'); + if (*pend == '\n') { + *pend = '\0'; + pend++; + } + + if (!*p) continue; + + colon = strchr (p, ':'); + if (colon) { + *colon = '\0'; + + /* snapshot is special, see the outpu...
2014 Nov 24
0
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...; > + } > > + if (add_string (&ret, out) == -1) { > > + return NULL; > > + } > > + > > + /* Read the lines and split into "key: value". */ > > + while (*p) { > > + /* leading spaces and tabs */ > > + while (*p && c_isspace (*p)) p++; > > Properly indent such lines, so: > while (*p && c_isspace (*p)) > p++; > > (also, a minor optimization is to use ++p instead of p++, as it can > avoid a temporary value) Okay. > > > + > > + pend = strchrnul (p, '\n'); &...
2014 Nov 24
1
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...snapshots/test3 Other attribute: - p would be at: snapshots/test1 ^- here, while strchr(p, ':') == NULL) would be Other attribute: - ^- here, so skipping all the multi-line value. > > > + while (*p && c_isspace (*p)) p++; > > > + pend = strchrnul (p, '\n'); > > > + if (*pend == '\n') { > > > + *pend = '\0'; > > > + pend++; > > > + } > > > > I see this code repeated already; I...
2016 Jan 28
0
[PATCH v2] lvm: support lvm2 older than 2.02.107
...LARE_STRINGSBUF (ret); + + p = out; + while (p) { + size_t len; + char *saveptr; + char *lv_attr, *vg_name, *lv_name; + + pend = strchr (p, '\n'); /* Get the next line of output. */ + if (pend) { + *pend = '\0'; + pend++; + } + + while (*p && c_isspace (*p)) /* Skip any leading whitespace. */ + p++; + + /* Sigh, skip trailing whitespace too. "pvs", I'm looking at you. */ + len = strlen (p)-1; + while (*p && c_isspace (p[len])) + p[len--] = '\0'; + + if (!*p) { /* Empty line? Skip it. */ +...
2014 Nov 21
13
[PATCH 0/6] btrfs support part1: subvolume commands
Hi, This is the part1 of improving btrfs support. This series adds missing parameters to btrfs_subvolume_snapshot and btrfs_subvolume_create, and adds two new API btrfs_subvolume_get_default and btrfs_subvolume_show. Other parts will follow. Regards, Hu Hu Tao (6): btrfs: correct words about subvolume and snapshot btrfs: add optional parameter `ro' to btrfs_subvolume_snapshot btrfs:
2017 Apr 08
2
Omega: Missing support for newer weighting schemes
On Sat, Apr 08, 2017 at 09:11:22PM +0100, James Aylett wrote: > On 8 Apr 2017, at 19:15, Vivek Pal <vivekpal.dtu at gmail.com> wrote: > > >> and the details of which weighting schemes were available in which version > >> isn't a key part of the $set command itself. > > > > Do you suggest dropping that piece of information out? Since the reason behind
2014 Dec 02
0
[PATCH 2/8] New API: btrfs_subvolume_show
...':'; + char *del_pos = NULL; + + if (!line || *line == '\0') { + *key = NULL; + *value = NULL; + return NULL; + } + + next = strchr (p, '\n'); + if (next) { + *next = '\0'; + ++next; + } + + /* leading spaces and tabs */ + while (*p && c_isspace (*p)) + ++p; + + assert (key); + if (*p == delimiter) + *key = NULL; + else + *key = p; + + del_pos = strchr (p, delimiter); + if (del_pos) { + *del_pos = '\0'; + + /* leading spaces and tabs */ + do { + ++del_pos; + } while (*del_pos && c_isspace (*de...
2014 Dec 05
1
Re: [PATCH 2/8] New API: btrfs_subvolume_show
...'\0') { > + *key = NULL; > + *value = NULL; > + return NULL; > + } > + > + next = strchr (p, '\n'); > + if (next) { > + *next = '\0'; > + ++next; > + } > + > + /* leading spaces and tabs */ > + while (*p && c_isspace (*p)) > + ++p; > + > + assert (key); > + if (*p == delimiter) > + *key = NULL; > + else > + *key = p; > + > + del_pos = strchr (p, delimiter); > + if (del_pos) { > + *del_pos = '\0'; > + > + /* leading spaces and tabs */ > + d...
2017 Apr 09
3
Omega: Missing support for newer weighting schemes
...ct with params > in the "scheme" string. E.g. - > > if (startswith(scheme, "bm25")) { > const char *p = scheme.c_str() + 4; > if (*p == '\0') { > enq.set_weighting_scheme(Xapian::BM25Weight()); > return; > } > if (C_isspace(*p)) { > Xapian::BM25Weight wt = Xapian::BM25Weight::parse_params(p); > enq.set_weighting_scheme(wt); > return; > } > } No, use Xapian::Registry to find the weighting scheme from the name like how Weight::unserialise() does (otherwise every caller woul...
2017 Jul 14
0
[PATCH 14/27] daemon: Reimplement ‘lvs’ API in OCaml.
...LARE_STRINGSBUF (ret); - - p = out; - while (p) { - size_t len; - char *saveptr; - char *lv_attr, *vg_name, *lv_name; - - pend = strchr (p, '\n'); /* Get the next line of output. */ - if (pend) { - *pend = '\0'; - pend++; - } - - while (*p && c_isspace (*p)) /* Skip any leading whitespace. */ - p++; - - /* Sigh, skip trailing whitespace too. "pvs", I'm looking at you. */ - len = strlen (p)-1; - while (*p && c_isspace (p[len])) - p[len--] = '\0'; - - if (!*p) { /* Empty line? Skip it. */ -...
2010 Apr 03
1
hivex: Exported foreign symbols in libhivex.so.0.0.0
...i/Visibility Symbols: asnprintf at Base 1.2.1 c_isalnum at Base 1.2.1 c_isalpha at Base 1.2.1 c_isascii at Base 1.2.1 c_isblank at Base 1.2.1 c_iscntrl at Base 1.2.1 c_isdigit at Base 1.2.1 c_isgraph at Base 1.2.1 c_islower at Base 1.2.1 c_isprint at Base 1.2.1 c_ispunct at Base 1.2.1 c_isspace at Base 1.2.1 c_isupper at Base 1.2.1 c_isxdigit at Base 1.2.1 c_tolower at Base 1.2.1 c_toupper at Base 1.2.1 exit_failure at Base 1.2.1 full_read at Base 1.2.1 full_write at Base 1.2.1 printf_fetchargs at Base 1.2.1 printf_parse at Base 1.2.1 program_name at Base 1.2.1 safe_read at Bas...
2017 Apr 12
4
Omega: Missing support for newer weighting schemes
...ieves what we intend to do. It works fine for all tests. Please let me know what you think. if (startswith(scheme, "pl2")) { const char *p = scheme.c_str() + 3; if (*p == '\0') { enq.set_weighting_scheme(Xapian::BM25Weight()); return; } if (C_isspace(*p)) { Xapian::Registry reg; const Xapian::Weight * wt = reg.get_weighting_scheme("Xapian::PL2Weight"); enq.set_weighting_scheme(*wt->set_parameter_values(p)); return; } } Although, I'm still having a hard time trying to figure out how it's p...
2014 Aug 26
6
[PATCH 0/3] fix setting lvm filter with newer lvm2
Hi, newer lvm2 releases don't have have uncommented "filter" lines, so the current way to edit lvm.conf doesn't work anymore. Instead, switch to augeas (with a "custom" len) for a cleaner and working way to set the lvm filter. Pino Toscano (3): daemon: add add_sprintf daemon: move AUGEAS_ERROR to the common header daemon: lvm-filter: use augeas for setting the
2014 Nov 26
7
[PATCH v2 0/5] btrfs support part1: subvolume commands
Hi, This is the part1 of improving btrfs support. This series adds missing parameters to btrfs_subvolume_snapshot and btrfs_subvolume_create, and adds two new API btrfs_subvolume_get_default and btrfs_subvolume_show. Other parts will follow. Regards, Hu changes: v2: - add 'once_had_no_optargs = true' for btrfs_subvolume_snapshot and btrfs_subvolume_create - improved documents
2019 Dec 03
7
[p2v PATCH 0/6] Use GLib a bit more
In an effort to reduce the code, start to use few bits of GLib: - replace the gnulib c-type module - replace the gnulib getprogname module - use g_spawn_sync to launch curl, and drop a file reading function Pino Toscano (6): Include glib.h in p2v.h Use g_ascii_isspace instead of c_isspace from gnulib Use g_get_prgname instead of getprogname from gnulib build: remove no more used gnulib modules Use g_spawn_sync to launch curl Remove whole-file.c Makefile.am | 3 +- bootstrap | 2 -- conversion.c | 5 ++- cpuid.c | 4 +-- gui.c | 11 ++...
2014 Dec 02
21
[PATCH 0/8] btrfs support part2: qgroup commands
Hi, This series adds support to btrfs qgroup related commands, inclduing quota commands, and two leftover of subvolume commands. Regards, Hu Hu Tao (8): New API: btrfs_subvolume_get_default New API: btrfs_subvolume_show New API: btrfs_quota_enable New API: btrfs_quota_disable New API: btrfs_quota_rescan New API: btrfs_qgroup_limit New API: btrfs_qgroup_create New API:
2014 Dec 12
15
[PATCH v3 00/11] btrfs support part2: qgroup/quota commands
Hi, This is v3 series to add support to btrfs qgroup related commands, inclduing quota commands, and two leftover of subvolume commands. Regards, Hu changes: v3: - don't intialize fs_buf (patch 1) - check the return value of sysroot_path (patch 1) - check fs_buf rather than fs (patch 1) - fprintf (stderr,...) -> reply_with_error() v2: - add tests for new APIs - combine