From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Couder Subject: [PATCH v2 77/94] builtin/apply: rename option parsing functions Date: Wed, 11 May 2016 15:17:28 +0200 Message-ID: <20160511131745.2914-78-chriscool@tuxfamily.org> References: <20160511131745.2914-1-chriscool@tuxfamily.org> Cc: Junio C Hamano , =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= , Nguyen Thai Ngoc Duy , Stefan Beller , Johannes Schindelin , Eric Sunshine , Ramsay Jones , Jeff King , Karsten Blees , Matthieu Moy , Christian Couder To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed May 11 15:22:19 2016 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b0U5g-0005en-Aj for gcvg-git-2@plane.gmane.org; Wed, 11 May 2016 15:22:16 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932382AbcEKNVV (ORCPT ); Wed, 11 May 2016 09:21:21 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35889 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932357AbcEKNVG (ORCPT ); Wed, 11 May 2016 09:21:06 -0400 Received: by mail-wm0-f66.google.com with SMTP id w143so9355798wmw.3 for ; Wed, 11 May 2016 06:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ct8151URP2lPwR6ZkcLR8fRD1sGY6djUEJRAa/X+sHE=; b=YY6LIaX4vwxtplXe5nM+t/HzDd7pxMwUsiz6LpBNCN204/QwZTxfc5/TvdIFluUrES D7JITgXK0jUAho++CfyYnvj/lcOLnKNRvCOIc8bChIAw2mLcfYVPIkIkMBiY41MHazJk hBDWJB8n26XE1Zznl7/xOiqjfZrAtbLCOdTfeIgzDJKnevKnfXLttfnGzuNVSqcBqNE2 lrBBaySbD+Bmi5etqK28Rh7wKCjvrAoLgYZoIbERI/FBzcpFHC7xoqeTJA5fqRkxZ9yj J2R/O4aN2wCOMjYkn5AaRbXBHBCuKlIIZcuqtx8ju0CstQOc1ofa66Tn//6QXVAu43he 82EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ct8151URP2lPwR6ZkcLR8fRD1sGY6djUEJRAa/X+sHE=; b=LOld4+eVO4UYJl83rXEXmDoThPIV5Zxcq2IkULHQa23DYSK5/g26yve2uHU+o2o3Tx IU9dhsXOKapmLykpa4h44B+kBdh/a85ofV6h3JQTujcN0aObWG7TJOqTTrTi0RiYUdVj JoSA6h0wJZGgG4jqh04aVXV0PAz9ENYDLYGiitLkXdmZzby/dMi1oZ9FjyeAmQAb74x2 R2oH6Dqo+RoNq8XQiomcaejt0jvoMJyI8OoJqrntEhWaf6wMIs9c9oSB0wijwnhqDj+U S5J4vs1Lld136XAx6UoYurFySnsFoN7XwB7QjAv+PHKqrI+i/QZKUA8zREEjz+95aQy1 qFCg== X-Gm-Message-State: AOPr4FUsV51xUVZNV3PyyVvJ1GSVxFZdDXHIpUh1aT30DUyhFRUi7BxpwjXpuRcLl3HPBw== X-Received: by 10.194.77.140 with SMTP id s12mr3828174wjw.24.1462972865051; Wed, 11 May 2016 06:21:05 -0700 (PDT) Received: from localhost.localdomain ([80.215.130.96]) by smtp.gmail.com with ESMTPSA id pm4sm8060791wjb.35.2016.05.11.06.21.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 May 2016 06:21:04 -0700 (PDT) X-Google-Original-From: Christian Couder X-Mailer: git-send-email 2.8.2.490.g3dabe57 In-Reply-To: <20160511131745.2914-1-chriscool@tuxfamily.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: As these functions are going to be part of the libified apply api, let's give them a name that is more specific to the apply api. Signed-off-by: Christian Couder --- builtin/apply.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index 8c31617..f05dc96 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -4565,16 +4565,16 @@ end: return res; } -static int option_parse_exclude(const struct option *opt, - const char *arg, int unset) +static int apply_option_parse_exclude(const struct option *opt, + const char *arg, int unset) { struct apply_state *state = opt->value; add_name_limit(state, arg, 1); return 0; } -static int option_parse_include(const struct option *opt, - const char *arg, int unset) +static int apply_option_parse_include(const struct option *opt, + const char *arg, int unset) { struct apply_state *state = opt->value; add_name_limit(state, arg, 0); @@ -4582,9 +4582,9 @@ static int option_parse_include(const struct option *opt, return 0; } -static int option_parse_p(const struct option *opt, - const char *arg, - int unset) +static int apply_option_parse_p(const struct option *opt, + const char *arg, + int unset) { struct apply_state *state = opt->value; state->p_value = atoi(arg); @@ -4592,8 +4592,8 @@ static int option_parse_p(const struct option *opt, return 0; } -static int option_parse_space_change(const struct option *opt, - const char *arg, int unset) +static int apply_option_parse_space_change(const struct option *opt, + const char *arg, int unset) { struct apply_state *state = opt->value; if (unset) @@ -4603,8 +4603,8 @@ static int option_parse_space_change(const struct option *opt, return 0; } -static int option_parse_whitespace(const struct option *opt, - const char *arg, int unset) +static int apply_option_parse_whitespace(const struct option *opt, + const char *arg, int unset) { struct apply_state *state = opt->value; state->whitespace_option = arg; @@ -4613,8 +4613,8 @@ static int option_parse_whitespace(const struct option *opt, return 0; } -static int option_parse_directory(const struct option *opt, - const char *arg, int unset) +static int apply_option_parse_directory(const struct option *opt, + const char *arg, int unset) { struct apply_state *state = opt->value; strbuf_reset(&state->root); @@ -4714,13 +4714,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix) struct option builtin_apply_options[] = { { OPTION_CALLBACK, 0, "exclude", &state, N_("path"), N_("don't apply changes matching the given path"), - 0, option_parse_exclude }, + 0, apply_option_parse_exclude }, { OPTION_CALLBACK, 0, "include", &state, N_("path"), N_("apply changes matching the given path"), - 0, option_parse_include }, + 0, apply_option_parse_include }, { OPTION_CALLBACK, 'p', NULL, &state, N_("num"), N_("remove leading slashes from traditional diff paths"), - 0, option_parse_p }, + 0, apply_option_parse_p }, OPT_BOOL(0, "no-add", &state.no_add, N_("ignore additions made by the patch")), OPT_BOOL(0, "stat", &state.diffstat, @@ -4752,13 +4752,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix) N_("ensure at least lines of context match")), { OPTION_CALLBACK, 0, "whitespace", &state, N_("action"), N_("detect new or modified lines that have whitespace errors"), - 0, option_parse_whitespace }, + 0, apply_option_parse_whitespace }, { OPTION_CALLBACK, 0, "ignore-space-change", &state, NULL, N_("ignore changes in whitespace when finding context"), - PARSE_OPT_NOARG, option_parse_space_change }, + PARSE_OPT_NOARG, apply_option_parse_space_change }, { OPTION_CALLBACK, 0, "ignore-whitespace", &state, NULL, N_("ignore changes in whitespace when finding context"), - PARSE_OPT_NOARG, option_parse_space_change }, + PARSE_OPT_NOARG, apply_option_parse_space_change }, OPT_BOOL('R', "reverse", &state.apply_in_reverse, N_("apply the patch in reverse")), OPT_BOOL(0, "unidiff-zero", &state.unidiff_zero, @@ -4776,7 +4776,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix) RECOUNT), { OPTION_CALLBACK, 0, "directory", &state, N_("root"), N_("prepend to all filenames"), - 0, option_parse_directory }, + 0, apply_option_parse_directory }, OPT_END() }; -- 2.8.2.490.g3dabe57