lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Feb 2017 12:31:15 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andi Kleen <andi@...stfloor.org>
Cc:     acme@...nel.org, jolsa@...nel.org, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 08/10] perf, tools: Add a simple expression parser for
 JSON

On Fri, Jan 27, 2017 at 06:03:43PM -0800, Andi Kleen wrote:

SNIP

> diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h
> new file mode 100644
> index 000000000000..3b99fa282059
> --- /dev/null
> +++ b/tools/perf/util/expr.h
> @@ -0,0 +1,23 @@
> +#ifndef PARSE_CTX_H
> +#define PARSE_CTX_H 1
> +
> +#define MAX_PARSE_ID 2
> +
> +struct parse_id {
> +	const char *name;
> +	double val;
> +};
> +
> +struct parse_ctx {
> +	int num_ids;
> +	struct parse_id ids[MAX_PARSE_ID];
> +};
> +
> +void expr_ctx_init(struct parse_ctx *ctx);
> +void expr_add_id(struct parse_ctx *ctx, const char *id, double val);
> +#ifndef IN_EXPR_Y
> +int expr_parse(double *final_val, struct parse_ctx *ctx, const char **pp);
> +#endif
> +int expr_find_other(const char *p, const char *one, const char **other);

it all looks ok, just please follow the interface function
name style we try to keep with struct name separated with __

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ