1 Return-Path: <jani@nikula.org>
\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 601A3431FB6
\r
6 for <notmuch@notmuchmail.org>; Thu, 6 Dec 2012 14:30:05 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 yQxdTGsctFB8 for <notmuch@notmuchmail.org>;
\r
16 Thu, 6 Dec 2012 14:30:05 -0800 (PST)
\r
17 Received: from mail-la0-f53.google.com (mail-la0-f53.google.com
\r
18 [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id A9FCF431FAE
\r
21 for <notmuch@notmuchmail.org>; Thu, 6 Dec 2012 14:30:04 -0800 (PST)
\r
22 Received: by mail-la0-f53.google.com with SMTP id w12so5835867lag.26
\r
23 for <notmuch@notmuchmail.org>; Thu, 06 Dec 2012 14:30:03 -0800 (PST)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=google.com; s=20120113;
\r
26 h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state;
\r
27 bh=ivJzNGYJ+2ho34b0H5sBN4Tn7tXpK1wyuttWWWDbJ3k=;
\r
28 b=CImAD2A5NSKaCtZRXWf3Qte4ZfckUqiPjWh6/obZ6pFsT5klCyEr/A1g+k1U+CuSnv
\r
29 74C0aywwunK7WiqMcFpCztYnj/03Plqrs6HSTFpgl/RfyN83gFVqjsrHKTUmNVvT444N
\r
30 n0t5QNJt/eqhEsm7z49UUXG5nKuBXzeLX5cRkVokSi4NP2u7vqzTPvoRGe3Ndj715f0d
\r
31 ZcNo/X+ZGf5E7V2K8TzGn6ZxSpWI9ZE3JCTN5sEE08Pm2ii3eE/HwAxml6YOZ9uCaKU3
\r
32 oYljtgjJEzx3Yg9+vhkMGBRzHCQohptpGyZ05cAAikqvsudgN8vnRptl451rYtPZBW5i
\r
34 Received: by 10.152.105.68 with SMTP id gk4mr3375775lab.48.1354833001821;
\r
35 Thu, 06 Dec 2012 14:30:01 -0800 (PST)
\r
36 Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.
\r
38 by mx.google.com with ESMTPS id pw17sm3924175lab.5.2012.12.06.14.29.59
\r
39 (version=SSLv3 cipher=OTHER); Thu, 06 Dec 2012 14:30:00 -0800 (PST)
\r
40 From: Jani Nikula <jani@nikula.org>
\r
41 To: notmuch@notmuchmail.org
\r
42 Subject: [PATCH 1/2] sprinter: add text0 formatter for null character
\r
44 Date: Fri, 7 Dec 2012 00:29:57 +0200
\r
46 <30f03a18ed10c221c13b6672f90654963c76452d.1354832980.git.jani@nikula.org>
\r
47 X-Mailer: git-send-email 1.7.10.4
\r
49 ALoCoQmQpnigYXJ2Vi5ev3kCONReBwMqdJUl0XWI6qCzRXnFh7JE6hNOJ8aLKP7Dos4Cco6Ia3af
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Thu, 06 Dec 2012 22:30:05 -0000
\r
64 Same as the text formatter, but with each field separated by a null
\r
65 character rather than a newline character.
\r
67 sprinter-text.c | 22 ++++++++++++++++++++++
\r
68 sprinter.h | 6 ++++++
\r
69 2 files changed, 28 insertions(+)
\r
71 diff --git a/sprinter-text.c b/sprinter-text.c
\r
72 index 10343be..7779488 100644
\r
73 --- a/sprinter-text.c
\r
74 +++ b/sprinter-text.c
\r
75 @@ -68,6 +68,14 @@ text_separator (struct sprinter *sp)
\r
79 +text0_separator (struct sprinter *sp)
\r
81 + struct sprinter_text *sptxt = (struct sprinter_text *) sp;
\r
83 + fputc ('\0', sptxt->stream);
\r
87 text_set_prefix (struct sprinter *sp, const char *prefix)
\r
89 struct sprinter_text *sptxt = (struct sprinter_text *) sp;
\r
90 @@ -133,3 +141,17 @@ sprinter_text_create (const void *ctx, FILE *stream)
\r
91 res->stream = stream;
\r
92 return &res->vtable;
\r
96 +sprinter_text0_create (const void *ctx, FILE *stream)
\r
98 + struct sprinter *sp;
\r
100 + sp = sprinter_text_create (ctx, stream);
\r
104 + sp->separator = text0_separator;
\r
108 diff --git a/sprinter.h b/sprinter.h
\r
109 index 912a526..74e7fec 100644
\r
112 @@ -66,6 +66,12 @@ typedef struct sprinter {
\r
114 sprinter_text_create (const void *ctx, FILE *stream);
\r
116 +/* Create a new unstructured printer that emits the text format for
\r
117 + * "notmuch search", with each field separated by a null character
\r
118 + * instead of the newline character. */
\r
120 +sprinter_text0_create (const void *ctx, FILE *stream);
\r
122 /* Create a new structure printer that emits JSON. */
\r
124 sprinter_json_create (const void *ctx, FILE *stream);
\r