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 C436C429E36
\r
6 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:27 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id bU1uiAhtmCJ1 for <notmuch@notmuchmail.org>;
\r
17 Sun, 16 Dec 2012 14:05:26 -0800 (PST)
\r
18 Received: from mail-la0-f53.google.com (mail-la0-f53.google.com
\r
19 [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 8FC33431FD2
\r
22 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:25 -0800 (PST)
\r
23 Received: by mail-la0-f53.google.com with SMTP id w12so4065400lag.26
\r
24 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:24 -0800 (PST)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=google.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
\r
28 :in-reply-to:references:x-gm-message-state;
\r
29 bh=yB+hA6dX1WwjVFKH/ANzufa8mVAszdN9OyGxjSv9O74=;
\r
30 b=ahWY9uhxaAm4Eh2w8EEyudOafhn1ZOSnmnn/wbUpq9CUytaTntTtXuVJefpFxang1p
\r
31 fzeGai4uA9B51y02xlGdh9HucTKD4tsXvPcOBPDqcnnXUjfuqRq/6nXs5Ut76Opjpk95
\r
32 nRNJACyz3wmqKTGMh6mZ1sBCbeBj5/M9VNJmw1l4XgUhdTBi1xxjanGIY2f/q3wFoqFx
\r
33 XQLuDQCiOyFsqMOxlSQqsnrLFQ4JVJaxExtabfRjMhu6EDHI666GY8r+pJy2uNQw2eLY
\r
34 eSKtKdd+/hPtjevSD0Cq2MCW+jRCNu1BKjDi1BkL4QQsD+3njjynJjEIEtISQKGjF0Sy
\r
36 Received: by 10.112.43.161 with SMTP id x1mr5107336lbl.32.1355695522635;
\r
37 Sun, 16 Dec 2012 14:05:22 -0800 (PST)
\r
38 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPS id sj3sm4118235lab.2.2012.12.16.14.05.20
\r
41 (version=SSLv3 cipher=OTHER); Sun, 16 Dec 2012 14:05:21 -0800 (PST)
\r
42 From: Jani Nikula <jani@nikula.org>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v4 2/5] sprinter: add text0 formatter for null character
\r
46 Date: Mon, 17 Dec 2012 00:05:10 +0200
\r
48 <67652be343e8eec1934c57aaf0809f7a658866f5.1355695036.git.jani@nikula.org>
\r
49 X-Mailer: git-send-email 1.7.10.4
\r
50 In-Reply-To: <cover.1355695036.git.jani@nikula.org>
\r
51 References: <cover.1355695036.git.jani@nikula.org>
\r
52 In-Reply-To: <cover.1355695036.git.jani@nikula.org>
\r
53 References: <cover.1355695036.git.jani@nikula.org>
\r
55 ALoCoQlprmwhmqDeHISA9aZCfh8eRwLQ0eKUcNS9PosRMUg+wgc2VAxgi8nb/6rMDIoRgiuvY/aK
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.13
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Sun, 16 Dec 2012 22:05:28 -0000
\r
70 Same as the text formatter, but with each field separated by a null
\r
71 character rather than a newline character.
\r
73 sprinter-text.c | 22 ++++++++++++++++++++++
\r
74 sprinter.h | 6 ++++++
\r
75 2 files changed, 28 insertions(+)
\r
77 diff --git a/sprinter-text.c b/sprinter-text.c
\r
78 index 10343be..7779488 100644
\r
79 --- a/sprinter-text.c
\r
80 +++ b/sprinter-text.c
\r
81 @@ -68,6 +68,14 @@ text_separator (struct sprinter *sp)
\r
85 +text0_separator (struct sprinter *sp)
\r
87 + struct sprinter_text *sptxt = (struct sprinter_text *) sp;
\r
89 + fputc ('\0', sptxt->stream);
\r
93 text_set_prefix (struct sprinter *sp, const char *prefix)
\r
95 struct sprinter_text *sptxt = (struct sprinter_text *) sp;
\r
96 @@ -133,3 +141,17 @@ sprinter_text_create (const void *ctx, FILE *stream)
\r
97 res->stream = stream;
\r
98 return &res->vtable;
\r
102 +sprinter_text0_create (const void *ctx, FILE *stream)
\r
104 + struct sprinter *sp;
\r
106 + sp = sprinter_text_create (ctx, stream);
\r
110 + sp->separator = text0_separator;
\r
114 diff --git a/sprinter.h b/sprinter.h
\r
115 index f43a844..f859672 100644
\r
118 @@ -67,6 +67,12 @@ typedef struct sprinter {
\r
120 sprinter_text_create (const void *ctx, FILE *stream);
\r
122 +/* Create a new unstructured printer that emits the text format for
\r
123 + * "notmuch search", with each field separated by a null character
\r
124 + * instead of the newline character. */
\r
126 +sprinter_text0_create (const void *ctx, FILE *stream);
\r
128 /* Create a new structure printer that emits JSON. */
\r
130 sprinter_json_create (const void *ctx, FILE *stream);
\r