[PATCH v2 (rebased) 0/3] Improve the display of matching/non-matching authors.
[notmuch-archives.git] / 07 / 136efdfec8c14b25a4a84e151f480a45c547b3
1 Return-Path: <tomi.ollila@iki.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 0BF8F429E25\r
6         for <notmuch@notmuchmail.org>; Tue,  7 Aug 2012 06:07:36 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id TmRxnSA0fHF7 for <notmuch@notmuchmail.org>;\r
16         Tue,  7 Aug 2012 06:07:35 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 0687C431FAF\r
19         for <notmuch@notmuchmail.org>; Tue,  7 Aug 2012 06:07:35 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 15F581002A4; Tue,  7 Aug 2012 16:07:45 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
24 Subject: Re: [PATCH] cli: Remove now-unused json.c\r
25 In-Reply-To: <1344344667-19114-1-git-send-email-amdragon@mit.edu>\r
26 References: <1344344667-19114-1-git-send-email-amdragon@mit.edu>\r
27 User-Agent: Notmuch/0.13.2+128~g07453d8 (http://notmuchmail.org) Emacs/23.1.1\r
28         (x86_64-redhat-linux-gnu)\r
29 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
30         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
31         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
32 Date: Tue, 07 Aug 2012 16:07:44 +0300\r
33 Message-ID: <m2y5lqc0kf.fsf@guru.guru-group.fi>\r
34 MIME-Version: 1.0\r
35 Content-Type: text/plain; charset=utf-8\r
36 Content-Transfer-Encoding: quoted-printable\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Tue, 07 Aug 2012 13:07:36 -0000\r
50 \r
51 On Tue, Aug 07 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
52 \r
53 > The string buffer quoting functions in json.c have been superseded by\r
54 > the new sprinter interface and are no longer used.  Remove them.\r
55 > ---\r
56 \r
57 +1\r
58 \r
59 Tomi\r
60 \r
61 \r
62 >  Makefile.local |    1 -\r
63 >  json.c         |  109 --------------------------------------------------=\r
64 ------\r
65 >  2 files changed, 110 deletions(-)\r
66 >  delete mode 100644 json.c\r
67 >\r
68 > diff --git a/Makefile.local b/Makefile.local\r
69 > index b3b960c..de984ab 100644\r
70 > --- a/Makefile.local\r
71 > +++ b/Makefile.local\r
72 > @@ -294,7 +294,6 @@ notmuch_client_srcs =3D           \\r
73 >       query-string.c          \\r
74 >       mime-node.c             \\r
75 >       crypto.c                \\r
76 > -     json.c\r
77 >=20=20\r
78 >  notmuch_client_modules =3D $(notmuch_client_srcs:.c=3D.o)\r
79 >=20=20\r
80 > diff --git a/json.c b/json.c\r
81 > deleted file mode 100644\r
82 > index 817fc83..0000000\r
83 > --- a/json.c\r
84 > +++ /dev/null\r
85 > @@ -1,109 +0,0 @@\r
86 > -/* notmuch - Not much of an email program, (just index and search)\r
87 > - *\r
88 > - * Copyright =C2=A9 2009 Dave Gamble\r
89 > - * Copyright =C2=A9 2009 Scott Robinson\r
90 > - *\r
91 > - * This program is free software: you can redistribute it and/or modify\r
92 > - * it under the terms of the GNU General Public License as published by\r
93 > - * the Free Software Foundation, either version 3 of the License, or\r
94 > - * (at your option) any later version.\r
95 > - *\r
96 > - * This program is distributed in the hope that it will be useful,\r
97 > - * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
98 > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
99 > - * GNU General Public License for more details.\r
100 > - *\r
101 > - * You should have received a copy of the GNU General Public License\r
102 > - * along with this program.  If not, see http://www.gnu.org/licenses/ .\r
103 > - *\r
104 > - * Authors: Dave Gamble\r
105 > - *          Scott Robinson <scott@quadhome.com>\r
106 > - *\r
107 > - */\r
108 > -\r
109 > -#include "notmuch-client.h"\r
110 > -\r
111 > -/* This function was derived from the print_string_ptr function of\r
112 > - * cJSON (http://cjson.sourceforge.net/) and is used by permission of\r
113 > - * the following license:\r
114 > - *\r
115 > - * Copyright (c) 2009 Dave Gamble\r
116 > - *\r
117 > - * Permission is hereby granted, free of charge, to any person obtaining=\r
118  a copy\r
119 > - * of this software and associated documentation files (the "Software"),=\r
120  to deal\r
121 > - * in the Software without restriction, including without limitation the=\r
122  rights\r
123 > - * to use, copy, modify, merge, publish, distribute, sublicense, and/or =\r
124 sell\r
125 > - * copies of the Software, and to permit persons to whom the Software is\r
126 > - * furnished to do so, subject to the following conditions:\r
127 > - *\r
128 > - * The above copyright notice and this permission notice shall be includ=\r
129 ed in\r
130 > - * all copies or substantial portions of the Software.\r
131 > - *\r
132 > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE=\r
133 SS OR\r
134 > - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILI=\r
135 TY,\r
136 > - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHA=\r
137 LL THE\r
138 > - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
139 > - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI=\r
140 NG FROM,\r
141 > - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING=\r
142 S IN\r
143 > - * THE SOFTWARE.\r
144 > - */\r
145 > -\r
146 > -char *\r
147 > -json_quote_chararray(const void *ctx, const char *str, const size_t len)\r
148 > -{\r
149 > -    const char *ptr;\r
150 > -    char *ptr2;\r
151 > -    char *out;\r
152 > -    size_t loop;\r
153 > -    size_t required;\r
154 > -\r
155 > -    for (loop =3D 0, required =3D 0, ptr =3D str;\r
156 > -      loop < len;\r
157 > -      loop++, required++, ptr++) {\r
158 > -     if ((unsigned char)(*ptr) < 32 || *ptr =3D=3D '\"' || *ptr =3D=3D '\\')\r
159 > -         required++;\r
160 > -    }\r
161 > -\r
162 > -    /*\r
163 > -     * + 3 for:\r
164 > -     * - leading quotation mark,\r
165 > -     * - trailing quotation mark,\r
166 > -     * - trailing NULL.\r
167 > -     */\r
168 > -    out =3D talloc_array (ctx, char, required + 3);\r
169 > -\r
170 > -    ptr =3D str;\r
171 > -    ptr2 =3D out;\r
172 > -\r
173 > -    *ptr2++ =3D '\"';\r
174 > -    for (loop =3D 0; loop < len; loop++) {\r
175 > -     if ((unsigned char)(*ptr) > 31 && *ptr !=3D '\"' && *ptr !=3D '\\') {\r
176 > -             *ptr2++ =3D *ptr++;\r
177 > -         } else {\r
178 > -             *ptr2++ =3D '\\';\r
179 > -             switch (*ptr++) {\r
180 > -                 case '\"':  *ptr2++ =3D '\"';       break;\r
181 > -                 case '\\':  *ptr2++ =3D '\\';       break;\r
182 > -                 case '\b':  *ptr2++ =3D 'b';        break;\r
183 > -                 case '\f':  *ptr2++ =3D 'f';        break;\r
184 > -                 case '\n':  *ptr2++ =3D 'n';        break;\r
185 > -                 case '\r':  *ptr2++ =3D 'r';        break;\r
186 > -                 case '\t':  *ptr2++ =3D 't';        break;\r
187 > -                 default:     ptr2--;        break;\r
188 > -             }\r
189 > -         }\r
190 > -    }\r
191 > -    *ptr2++ =3D '\"';\r
192 > -    *ptr2++ =3D '\0';\r
193 > -\r
194 > -    return out;\r
195 > -}\r
196 > -\r
197 > -char *\r
198 > -json_quote_str(const void *ctx, const char *str)\r
199 > -{\r
200 > -    if (str =3D=3D NULL)\r
201 > -     str =3D "";\r
202 > -\r
203 > -    return (json_quote_chararray (ctx, str, strlen (str)));\r
204 > -}\r
205 > --=20\r
206 > 1.7.10\r
207 >\r
208 > _______________________________________________\r
209 > notmuch mailing list\r
210 > notmuch@notmuchmail.org\r
211 > http://notmuchmail.org/mailman/listinfo/notmuch\r