[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / ea / f97e99b9bb6dddc57ff48a97bd7e4f4c20a859
1 Return-Path: <bremner@tethera.net>\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 4BC12431FD5\r
6         for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 13:20:45 -0800 (PST)\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 j4s5i-y5Qzas for <notmuch@notmuchmail.org>;\r
16         Sat, 24 Nov 2012 13:20:43 -0800 (PST)\r
17 Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
18         (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 68615431FD9\r
21         for <notmuch@notmuchmail.org>; Sat, 24 Nov 2012 13:20:33 -0800 (PST)\r
22 Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net\r
23         ([156.34.89.108] helo=zancas.localnet)\r
24         by tesseract.cs.unb.ca with esmtpsa\r
25         (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72)\r
26         (envelope-from <bremner@tethera.net>)\r
27         id 1TcN9M-0006SO-Bh; Sat, 24 Nov 2012 17:20:32 -0400\r
28 Received: from bremner by zancas.localnet with local (Exim 4.80)\r
29         (envelope-from <bremner@tethera.net>)\r
30         id 1TcN9G-0008Cy-Ni; Sat, 24 Nov 2012 17:20:26 -0400\r
31 From: david@tethera.net\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [Patch v2 08/17] util: add string-util.[ch]\r
34 Date: Sat, 24 Nov 2012 17:20:08 -0400\r
35 Message-Id: <1353792017-31459-9-git-send-email-david@tethera.net>\r
36 X-Mailer: git-send-email 1.7.10.4\r
37 In-Reply-To: <1353792017-31459-1-git-send-email-david@tethera.net>\r
38 References: <1353792017-31459-1-git-send-email-david@tethera.net>\r
39 X-Spam_bar: -\r
40 Cc: David Bremner <bremner@debian.org>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Sat, 24 Nov 2012 21:20:45 -0000\r
54 \r
55 From: David Bremner <bremner@debian.org>\r
56 \r
57 This is to give a home to strtok_len. It's a bit silly to add a header\r
58 for one routine, but it needs to be shared between several compilation\r
59 units (or at least that's the most natural design).\r
60 ---\r
61  util/Makefile.local |    3 ++-\r
62  util/string-util.c  |   34 ++++++++++++++++++++++++++++++++++\r
63  util/string-util.h  |   19 +++++++++++++++++++\r
64  3 files changed, 55 insertions(+), 1 deletion(-)\r
65  create mode 100644 util/string-util.c\r
66  create mode 100644 util/string-util.h\r
67 \r
68 diff --git a/util/Makefile.local b/util/Makefile.local\r
69 index 3ca623e..a11e35b 100644\r
70 --- a/util/Makefile.local\r
71 +++ b/util/Makefile.local\r
72 @@ -3,7 +3,8 @@\r
73  dir := util\r
74  extra_cflags += -I$(srcdir)/$(dir)\r
75  \r
76 -libutil_c_srcs := $(dir)/xutil.c $(dir)/error_util.c $(dir)/hex-escape.c\r
77 +libutil_c_srcs := $(dir)/xutil.c $(dir)/error_util.c $(dir)/hex-escape.c \\r
78 +                 $(dir)/string-util.c\r
79  \r
80  libutil_modules := $(libutil_c_srcs:.c=.o)\r
81  \r
82 diff --git a/util/string-util.c b/util/string-util.c\r
83 new file mode 100644\r
84 index 0000000..44f8cd3\r
85 --- /dev/null\r
86 +++ b/util/string-util.c\r
87 @@ -0,0 +1,34 @@\r
88 +/* string-util.c -  Extra or enhanced routines for null terminated strings.\r
89 + *\r
90 + * Copyright (c) 2012 Jani Nikula\r
91 + *\r
92 + * This program is free software: you can redistribute it and/or modify\r
93 + * it under the terms of the GNU General Public License as published by\r
94 + * the Free Software Foundation, either version 3 of the License, or\r
95 + * (at your option) any later version.\r
96 + *\r
97 + * This program is distributed in the hope that it will be useful,\r
98 + * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
99 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
100 + * GNU General Public License for more details.\r
101 + *\r
102 + * You should have received a copy of the GNU General Public License\r
103 + * along with this program.  If not, see http://www.gnu.org/licenses/ .\r
104 + *\r
105 + * Author: Jani Nikula <jani@nikula.org>\r
106 + */\r
107 +\r
108 +\r
109 +#include "string-util.h"\r
110 +\r
111 +char *\r
112 +strtok_len (char *s, const char *delim, size_t *len)\r
113 +{\r
114 +    /* skip initial delims */\r
115 +    s += strspn (s, delim);\r
116 +\r
117 +    /* length of token */\r
118 +    *len = strcspn (s, delim);\r
119 +\r
120 +    return *len ? s : NULL;\r
121 +}\r
122 diff --git a/util/string-util.h b/util/string-util.h\r
123 new file mode 100644\r
124 index 0000000..696da40\r
125 --- /dev/null\r
126 +++ b/util/string-util.h\r
127 @@ -0,0 +1,19 @@\r
128 +#ifndef _STRING_UTIL_H\r
129 +#define _STRING_UTIL_H\r
130 +\r
131 +#include <string.h>\r
132 +\r
133 +/* like strtok(3), but without state, and doesn't modify s. usage pattern:\r
134 + *\r
135 + * const char *tok = input;\r
136 + * const char *delim = " \t";\r
137 + * size_t tok_len = 0;\r
138 + *\r
139 + * while ((tok = strtok_len (tok + tok_len, delim, &tok_len)) != NULL) {\r
140 + *     // do stuff with string tok of length tok_len\r
141 + * }\r
142 + */\r
143 +\r
144 +char *strtok_len (char *s, const char *delim, size_t *len);\r
145 +\r
146 +#endif\r
147 -- \r
148 1.7.10.4\r
149 \r