From 874b517481ff689306a3a4d5189d8b8c6af93464 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Tue, 7 Aug 2012 17:00:49 +0100 Subject: [PATCH] Re: [PATCH] cli: Remove now-unused json.c --- a2/d1eda84b4c8b3af7f6c9cfa6b5b9b6830db790 | 235 ++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 a2/d1eda84b4c8b3af7f6c9cfa6b5b9b6830db790 diff --git a/a2/d1eda84b4c8b3af7f6c9cfa6b5b9b6830db790 b/a2/d1eda84b4c8b3af7f6c9cfa6b5b9b6830db790 new file mode 100644 index 000000000..ea0c1ee0c --- /dev/null +++ b/a2/d1eda84b4c8b3af7f6c9cfa6b5b9b6830db790 @@ -0,0 +1,235 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id CDB60431FC0 + for ; Tue, 7 Aug 2012 09:01:00 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id fNeaj-SMniNn for ; + Tue, 7 Aug 2012 09:00:59 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A7DC1431FAF + for ; Tue, 7 Aug 2012 09:00:59 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1SymDJ-0004H7-Og; Tue, 07 Aug 2012 17:00:58 +0100 +Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] + helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1SymDJ-0002Cf-AQ; Tue, 07 Aug 2012 17:00:57 +0100 +From: Mark Walters +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH] cli: Remove now-unused json.c +In-Reply-To: <1344344667-19114-1-git-send-email-amdragon@mit.edu> +References: <1344344667-19114-1-git-send-email-amdragon@mit.edu> +User-Agent: Notmuch/0.13.2+96~g634443c (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Tue, 07 Aug 2012 17:00:49 +0100 +Message-ID: <87hasebsjy.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +X-Sender-Host-Address: 94.192.233.223 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 017434ca916f5c82319bd8c12f417e14 (of first 20000 bytes) +X-SpamAssassin-Score: -1.8 +X-SpamAssassin-SpamBar: - +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -1.8 points. + Summary of the scoring: + * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, + * medium trust + * [138.37.6.40 listed in list.dnswl.org] + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + * domain + * 0.5 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 07 Aug 2012 16:01:00 -0000 + + ++1 + +Mark + +On Tue, 07 Aug 2012, Austin Clements wrote: +> The string buffer quoting functions in json.c have been superseded by +> the new sprinter interface and are no longer used. Remove them. +> --- +> Makefile.local | 1 - +> json.c | 109 --------------------------------------------------= +------ +> 2 files changed, 110 deletions(-) +> delete mode 100644 json.c +> +> diff --git a/Makefile.local b/Makefile.local +> index b3b960c..de984ab 100644 +> --- a/Makefile.local +> +++ b/Makefile.local +> @@ -294,7 +294,6 @@ notmuch_client_srcs =3D \ +> query-string.c \ +> mime-node.c \ +> crypto.c \ +> - json.c +>=20=20 +> notmuch_client_modules =3D $(notmuch_client_srcs:.c=3D.o) +>=20=20 +> diff --git a/json.c b/json.c +> deleted file mode 100644 +> index 817fc83..0000000 +> --- a/json.c +> +++ /dev/null +> @@ -1,109 +0,0 @@ +> -/* notmuch - Not much of an email program, (just index and search) +> - * +> - * Copyright =C2=A9 2009 Dave Gamble +> - * Copyright =C2=A9 2009 Scott Robinson +> - * +> - * This program is free software: you can redistribute it and/or modify +> - * it under the terms of the GNU General Public License as published by +> - * the Free Software Foundation, either version 3 of the License, or +> - * (at your option) any later version. +> - * +> - * This program is distributed in the hope that it will be useful, +> - * but WITHOUT ANY WARRANTY; without even the implied warranty of +> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +> - * GNU General Public License for more details. +> - * +> - * You should have received a copy of the GNU General Public License +> - * along with this program. If not, see http://www.gnu.org/licenses/ . +> - * +> - * Authors: Dave Gamble +> - * Scott Robinson +> - * +> - */ +> - +> -#include "notmuch-client.h" +> - +> -/* This function was derived from the print_string_ptr function of +> - * cJSON (http://cjson.sourceforge.net/) and is used by permission of +> - * the following license: +> - * +> - * Copyright (c) 2009 Dave Gamble +> - * +> - * Permission is hereby granted, free of charge, to any person obtaining= + a copy +> - * of this software and associated documentation files (the "Software"),= + to deal +> - * in the Software without restriction, including without limitation the= + rights +> - * to use, copy, modify, merge, publish, distribute, sublicense, and/or = +sell +> - * copies of the Software, and to permit persons to whom the Software is +> - * furnished to do so, subject to the following conditions: +> - * +> - * The above copyright notice and this permission notice shall be includ= +ed in +> - * all copies or substantial portions of the Software. +> - * +> - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE= +SS OR +> - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILI= +TY, +> - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHA= +LL THE +> - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI= +NG FROM, +> - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING= +S IN +> - * THE SOFTWARE. +> - */ +> - +> -char * +> -json_quote_chararray(const void *ctx, const char *str, const size_t len) +> -{ +> - const char *ptr; +> - char *ptr2; +> - char *out; +> - size_t loop; +> - size_t required; +> - +> - for (loop =3D 0, required =3D 0, ptr =3D str; +> - loop < len; +> - loop++, required++, ptr++) { +> - if ((unsigned char)(*ptr) < 32 || *ptr =3D=3D '\"' || *ptr =3D=3D '\\') +> - required++; +> - } +> - +> - /* +> - * + 3 for: +> - * - leading quotation mark, +> - * - trailing quotation mark, +> - * - trailing NULL. +> - */ +> - out =3D talloc_array (ctx, char, required + 3); +> - +> - ptr =3D str; +> - ptr2 =3D out; +> - +> - *ptr2++ =3D '\"'; +> - for (loop =3D 0; loop < len; loop++) { +> - if ((unsigned char)(*ptr) > 31 && *ptr !=3D '\"' && *ptr !=3D '\\') { +> - *ptr2++ =3D *ptr++; +> - } else { +> - *ptr2++ =3D '\\'; +> - switch (*ptr++) { +> - case '\"': *ptr2++ =3D '\"'; break; +> - case '\\': *ptr2++ =3D '\\'; break; +> - case '\b': *ptr2++ =3D 'b'; break; +> - case '\f': *ptr2++ =3D 'f'; break; +> - case '\n': *ptr2++ =3D 'n'; break; +> - case '\r': *ptr2++ =3D 'r'; break; +> - case '\t': *ptr2++ =3D 't'; break; +> - default: ptr2--; break; +> - } +> - } +> - } +> - *ptr2++ =3D '\"'; +> - *ptr2++ =3D '\0'; +> - +> - return out; +> -} +> - +> -char * +> -json_quote_str(const void *ctx, const char *str) +> -{ +> - if (str =3D=3D NULL) +> - str =3D ""; +> - +> - return (json_quote_chararray (ctx, str, strlen (str))); +> -} +> --=20 +> 1.7.10 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2