[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / e3 / 0737ab27e2714f4199ed16443ed9a2e9ad03a9
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 69F2F431FD0\r
6         for <notmuch@notmuchmail.org>; Sun, 23 Oct 2011 08:19:09 -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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 jAMzopR-sJUp for <notmuch@notmuchmail.org>;\r
16         Sun, 23 Oct 2011 08:19:07 -0700 (PDT)\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id A86DC431FB6\r
21         for <notmuch@notmuchmail.org>; Sun, 23 Oct 2011 08:19:07 -0700 (PDT)\r
22 Received: from zancas.localnet\r
23         (fctnnbsc36w-156034064058.pppoe-dynamic.High-Speed.nb.bellaliant.net\r
24         [156.34.64.58]) (authenticated bits=0)\r
25         by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id p9NFJ0iS008916\r
26         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
27         Sun, 23 Oct 2011 12:19:02 -0300\r
28 Received: from bremner by zancas.localnet with local (Exim 4.76)\r
29         (envelope-from <bremner@tethera.net>)\r
30         id 1RHzpD-0002sY-NH; Sun, 23 Oct 2011 12:18:59 -0300\r
31 From: David Bremner <david@tethera.net>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH] xutil.c: remove duplicate copies, create new library libutil.a to contain xutil.\r
34 Date: Sun, 23 Oct 2011 12:18:53 -0300\r
35 Message-Id: <1319383133-11006-1-git-send-email-david@tethera.net>\r
36 X-Mailer: git-send-email 1.7.6.3\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain; charset=UTF-8\r
39 Content-Transfer-Encoding: 8bit\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: Sun, 23 Oct 2011 15:19:09 -0000\r
54 \r
55 From: David Bremner <bremner@debian.org>\r
56 \r
57 We keep the lib/xutil.c version. As a consequence, also factor out\r
58 _internal_error and associated macros.  It might be overkill to make a\r
59 new file error_util.c for this, but _internal_error does not really\r
60 belong in database.cc.\r
61 ---\r
62 \r
63 This turned out to be more disruptive than I thought. On the other\r
64 hand, having two copies of xutil.c seems like a recipe for disaster.\r
65 I wanted to factor out the logic in xregcomp so I could use it in\r
66 situations where miscompilation is not an internal error, but more\r
67 likely a user error.\r
68 \r
69  Makefile              |    2 +-\r
70  Makefile.local        |    7 +--\r
71  lib/Makefile.local    |    5 +-\r
72  lib/database.cc       |   15 -----\r
73  lib/notmuch-private.h |   20 +-------\r
74  lib/xutil.c           |  134 -----------------------------------------------\r
75  lib/xutil.h           |   55 -------------------\r
76  util/Makefile         |    5 ++\r
77  util/Makefile.local   |   11 ++++\r
78  util/error_util.c     |   41 +++++++++++++++\r
79  util/error_util.h     |   45 ++++++++++++++++\r
80  util/xutil.c          |  136 ++++++++++++++++++++++++++++++++++++++++++++++++\r
81  util/xutil.h          |   55 +++++++++++++++++++\r
82  xutil.c               |  138 -------------------------------------------------\r
83  14 files changed, 300 insertions(+), 369 deletions(-)\r
84  delete mode 100644 lib/xutil.c\r
85  delete mode 100644 lib/xutil.h\r
86  create mode 100644 util/Makefile\r
87  create mode 100644 util/Makefile.local\r
88  create mode 100644 util/error_util.c\r
89  create mode 100644 util/error_util.h\r
90  create mode 100644 util/xutil.c\r
91  create mode 100644 util/xutil.h\r
92  delete mode 100644 xutil.c\r
93 \r
94 diff --git a/Makefile b/Makefile\r
95 index 11e3a3d..2fb2a61 100644\r
96 --- a/Makefile\r
97 +++ b/Makefile\r
98 @@ -3,7 +3,7 @@\r
99  all:\r
100  \r
101  # List all subdirectories here. Each contains its own Makefile.local\r
102 -subdirs = compat completion emacs lib test\r
103 +subdirs = compat completion emacs lib util test\r
104  \r
105  # We make all targets depend on the Makefiles themselves.\r
106  global_deps = Makefile Makefile.config Makefile.local \\r
107 diff --git a/Makefile.local b/Makefile.local\r
108 index 38f6c17..e31defa 100644\r
109 --- a/Makefile.local\r
110 +++ b/Makefile.local\r
111 @@ -39,7 +39,7 @@ PV_FILE=bindings/python/notmuch/version.py\r
112  # Smash together user's values with our extra values\r
113  FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)\r
114  FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)\r
115 -FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS)\r
116 +FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS)\r
117  FINAL_NOTMUCH_LINKER = CC\r
118  ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)\r
119  FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)\r
120 @@ -288,12 +288,11 @@ notmuch_client_srcs =             \\r
121         notmuch-time.c          \\r
122         query-string.c          \\r
123         show-message.c          \\r
124 -       json.c                  \\r
125 -       xutil.c\r
126 +       json.c                  \r
127  \r
128  notmuch_client_modules = $(notmuch_client_srcs:.c=.o)\r
129  \r
130 -notmuch: $(notmuch_client_modules) lib/libnotmuch.a\r
131 +notmuch: $(notmuch_client_modules) lib/libnotmuch.a util/libutil.a\r
132         $(call quiet,CXX $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@\r
133  \r
134  notmuch-shared: $(notmuch_client_modules) lib/$(LINKER_NAME)\r
135 diff --git a/lib/Makefile.local b/lib/Makefile.local\r
136 index ea20b2b..f148661 100644\r
137 --- a/lib/Makefile.local\r
138 +++ b/lib/Makefile.local\r
139 @@ -49,8 +49,7 @@ libnotmuch_c_srcs =           \\r
140         $(dir)/message-file.c   \\r
141         $(dir)/messages.c       \\r
142         $(dir)/sha1.c           \\r
143 -       $(dir)/tags.c           \\r
144 -       $(dir)/xutil.c\r
145 +       $(dir)/tags.c           \r
146  \r
147  libnotmuch_cxx_srcs =          \\r
148         $(dir)/database.cc      \\r
149 @@ -66,7 +65,7 @@ $(dir)/libnotmuch.a: $(libnotmuch_modules)\r
150         $(call quiet,AR) rcs $@ $^\r
151  \r
152  $(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym\r
153 -       $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@\r
154 +       $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@ -L$(srcdir)/util -lutil\r
155  \r
156  notmuch.sym: lib/notmuch.h $(libnotmuch_modules)\r
157         sh lib/gen-version-script.sh $< $(libnotmuch_modules) > $@\r
158 diff --git a/lib/database.cc b/lib/database.cc\r
159 index e77fd53..88be939 100644\r
160 --- a/lib/database.cc\r
161 +++ b/lib/database.cc\r
162 @@ -209,21 +209,6 @@ static prefix_t PROBABILISTIC_PREFIX[]= {\r
163      { "folder",                        "XFOLDER"}\r
164  };\r
165  \r
166 -int\r
167 -_internal_error (const char *format, ...)\r
168 -{\r
169 -    va_list va_args;\r
170 -\r
171 -    va_start (va_args, format);\r
172 -\r
173 -    fprintf (stderr, "Internal error: ");\r
174 -    vfprintf (stderr, format, va_args);\r
175 -\r
176 -    exit (1);\r
177 -\r
178 -    return 1;\r
179 -}\r
180 -\r
181  const char *\r
182  _find_prefix (const char *name)\r
183  {\r
184 diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
185 index d319530..0d3cc27 100644\r
186 --- a/lib/notmuch-private.h\r
187 +++ b/lib/notmuch-private.h\r
188 @@ -47,6 +47,7 @@ NOTMUCH_BEGIN_DECLS\r
189  #include <talloc.h>\r
190  \r
191  #include "xutil.h"\r
192 +#include "error_util.h"\r
193  \r
194  #pragma GCC visibility push(hidden)\r
195  \r
196 @@ -60,25 +61,6 @@ NOTMUCH_BEGIN_DECLS\r
197  #define STRNCMP_LITERAL(var, literal) \\r
198      strncmp ((var), (literal), sizeof (literal) - 1)\r
199  \r
200 -/* There's no point in continuing when we've detected that we've done\r
201 - * something wrong internally (as opposed to the user passing in a\r
202 - * bogus value).\r
203 - *\r
204 - * Note that PRINTF_ATTRIBUTE comes from talloc.h\r
205 - */\r
206 -int\r
207 -_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2);\r
208 -\r
209 -/* There's no point in continuing when we've detected that we've done\r
210 - * something wrong internally (as opposed to the user passing in a\r
211 - * bogus value).\r
212 - *\r
213 - * Note that __location__ comes from talloc.h.\r
214 - */\r
215 -#define INTERNAL_ERROR(format, ...)                    \\r
216 -    _internal_error (format " (%s).\n",                        \\r
217 -                    ##__VA_ARGS__, __location__)\r
218 -\r
219  #define unused(x) x __attribute__ ((unused))\r
220  \r
221  #ifdef __cplusplus\r
222 diff --git a/lib/xutil.c b/lib/xutil.c\r
223 deleted file mode 100644\r
224 index 268225b..0000000\r
225 diff --git a/lib/xutil.h b/lib/xutil.h\r
226 deleted file mode 100644\r
227 index fd77f73..0000000\r
228 diff --git a/util/Makefile b/util/Makefile\r
229 new file mode 100644\r
230 index 0000000..fa25832\r
231 --- /dev/null\r
232 +++ b/util/Makefile\r
233 @@ -0,0 +1,5 @@\r
234 +all:\r
235 +       $(MAKE) -C .. all\r
236 +\r
237 +.DEFAULT:\r
238 +       $(MAKE) -C .. $@\r
239 diff --git a/util/Makefile.local b/util/Makefile.local\r
240 new file mode 100644\r
241 index 0000000..2ff42b3\r
242 --- /dev/null\r
243 +++ b/util/Makefile.local\r
244 @@ -0,0 +1,11 @@\r
245 +# -*- makefile -*-\r
246 +\r
247 +dir := util\r
248 +extra_cflags += -I$(srcdir)/$(dir)\r
249 +\r
250 +libutil_c_srcs := $(dir)/xutil.c $(dir)/error_util.c\r
251 +\r
252 +libutil_modules := $(libutil_c_srcs:.c=.o)\r
253 +\r
254 +$(dir)/libutil.a: $(libutil_modules)\r
255 +       $(call quiet,AR) rcs $@ $^\r
256 diff --git a/util/error_util.c b/util/error_util.c\r
257 new file mode 100644\r
258 index 0000000..630d228\r
259 --- /dev/null\r
260 +++ b/util/error_util.c\r
261 @@ -0,0 +1,41 @@\r
262 +/* error_util.c - internal error utilities for notmuch.\r
263 + *\r
264 + * Copyright © 2009 Carl Worth\r
265 + *\r
266 + * This program is free software: you can redistribute it and/or modify\r
267 + * it under the terms of the GNU General Public License as published by\r
268 + * the Free Software Foundation, either version 3 of the License, or\r
269 + * (at your option) any later version.\r
270 + *\r
271 + * This program is distributed in the hope that it will be useful,\r
272 + * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
273 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
274 + * GNU General Public License for more details.\r
275 + *\r
276 + * You should have received a copy of the GNU General Public License\r
277 + * along with this program.  If not, see http://www.gnu.org/licenses/ .\r
278 + *\r
279 + * Author: Carl Worth <cworth@cworth.org>\r
280 + */\r
281 +\r
282 +#include <stdlib.h>\r
283 +#include <stdarg.h>\r
284 +#include <stdio.h>\r
285 +\r
286 +#include "error_util.h"\r
287 +\r
288 +int\r
289 +_internal_error (const char *format, ...)\r
290 +{\r
291 +    va_list va_args;\r
292 +\r
293 +    va_start (va_args, format);\r
294 +\r
295 +    fprintf (stderr, "Internal error: ");\r
296 +    vfprintf (stderr, format, va_args);\r
297 +\r
298 +    exit (1);\r
299 +\r
300 +    return 1;\r
301 +}\r
302 +\r
303 diff --git a/util/error_util.h b/util/error_util.h\r
304 new file mode 100644\r
305 index 0000000..0f1e5ef\r
306 --- /dev/null\r
307 +++ b/util/error_util.h\r
308 @@ -0,0 +1,45 @@\r
309 +/* error_util.h - Internal interfaces for notmuch.\r
310 + *\r
311 + * Copyright © 2009 Carl Worth\r
312 + *\r
313 + * This program is free software: you can redistribute it and/or modify\r
314 + * it under the terms of the GNU General Public License as published by\r
315 + * the Free Software Foundation, either version 3 of the License, or\r
316 + * (at your option) any later version.\r
317 + *\r
318 + * This program is distributed in the hope that it will be useful,\r
319 + * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
320 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
321 + * GNU General Public License for more details.\r
322 + *\r
323 + * You should have received a copy of the GNU General Public License\r
324 + * along with this program.  If not, see http://www.gnu.org/licenses/ .\r
325 + *\r
326 + * Author: Carl Worth <cworth@cworth.org>\r
327 + */\r
328 +\r
329 +#ifndef ERROR_UTIL_H\r
330 +#define ERROR_UTIL_H\r
331 +\r
332 +#include <talloc.h>\r
333 +\r
334 +/* There's no point in continuing when we've detected that we've done\r
335 + * something wrong internally (as opposed to the user passing in a\r
336 + * bogus value).\r
337 + *\r
338 + * Note that PRINTF_ATTRIBUTE comes from talloc.h\r
339 + */\r
340 +int\r
341 +_internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2);\r
342 +\r
343 +/* There's no point in continuing when we've detected that we've done\r
344 + * something wrong internally (as opposed to the user passing in a\r
345 + * bogus value).\r
346 + *\r
347 + * Note that __location__ comes from talloc.h.\r
348 + */\r
349 +#define INTERNAL_ERROR(format, ...)                    \\r
350 +    _internal_error (format " (%s).\n",                        \\r
351 +                    ##__VA_ARGS__, __location__)\r
352 +\r
353 +#endif\r
354 diff --git a/util/xutil.c b/util/xutil.c\r
355 new file mode 100644\r
356 index 0000000..15ff765\r
357 --- /dev/null\r
358 +++ b/util/xutil.c\r
359 @@ -0,0 +1,136 @@\r
360 +/* xutil.c - Various wrapper functions to abort on error.\r
361 + *\r
362 + * Copyright © 2009 Carl Worth\r
363 + *\r
364 + * This program is free software: you can redistribute it and/or modify\r
365 + * it under the terms of the GNU General Public License as published by\r
366 + * the Free Software Foundation, either version 3 of the License, or\r
367 + * (at your option) any later version.\r
368 + *\r
369 + * This program is distributed in the hope that it will be useful,\r
370 + * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
371 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
372 + * GNU General Public License for more details.\r
373 + *\r
374 + * You should have received a copy of the GNU General Public License\r
375 + * along with this program.  If not, see http://www.gnu.org/licenses/ .\r
376 + *\r
377 + * Author: Carl Worth <cworth@cworth.org>\r
378 + */\r
379 +\r
380 +#include <stdio.h>\r
381 +#include <string.h>\r
382 +\r
383 +#include "xutil.h"\r
384 +#include "error_util.h"\r
385 +\r
386 +void *\r
387 +xcalloc (size_t nmemb, size_t size)\r
388 +{\r
389 +    void *ret;\r
390 +\r
391 +    ret = calloc (nmemb, size);\r
392 +    if (ret == NULL) {\r
393 +       fprintf (stderr, "Out of memory.\n");\r
394 +       exit (1);\r
395 +    }\r
396 +\r
397 +    return ret;\r
398 +}\r
399 +\r
400 +void *\r
401 +xmalloc (size_t size)\r
402 +{\r
403 +    void *ret;\r
404 +\r
405 +    ret = malloc (size);\r
406 +    if (ret == NULL) {\r
407 +       fprintf (stderr, "Out of memory.\n");\r
408 +       exit (1);\r
409 +    }\r
410 +\r
411 +    return ret;\r
412 +}\r
413 +\r
414 +void *\r
415 +xrealloc (void *ptr, size_t size)\r
416 +{\r
417 +    void *ret;\r
418 +\r
419 +    ret = realloc (ptr, size);\r
420 +    if (ret == NULL) {\r
421 +       fprintf (stderr, "Out of memory.\n");\r
422 +       exit (1);\r
423 +    }\r
424 +\r
425 +    return ret;\r
426 +}\r
427 +\r
428 +char *\r
429 +xstrdup (const char *s)\r
430 +{\r
431 +    char *ret;\r
432 +\r
433 +    ret = strdup (s);\r
434 +    if (ret == NULL) {\r
435 +       fprintf (stderr, "Out of memory.\n");\r
436 +       exit (1);\r
437 +    }\r
438 +\r
439 +    return ret;\r
440 +}\r
441 +\r
442 +char *\r
443 +xstrndup (const char *s, size_t n)\r
444 +{\r
445 +    char *ret;\r
446 +\r
447 +    if (strlen (s) <= n)\r
448 +       n = strlen (s);\r
449 +\r
450 +    ret = malloc (n + 1);\r
451 +    if (ret == NULL) {\r
452 +       fprintf (stderr, "Out of memory.\n");\r
453 +       exit (1);\r
454 +    }\r
455 +    memcpy (ret, s, n);\r
456 +    ret[n] = '\0';\r
457 +\r
458 +    return ret;\r
459 +}\r
460 +\r
461 +void\r
462 +xregcomp (regex_t *preg, const char *regex, int cflags)\r
463 +{\r
464 +    int rerr;\r
465 +\r
466 +    rerr = regcomp (preg, regex, cflags);\r
467 +    if (rerr) {\r
468 +       size_t error_size = regerror (rerr, preg, NULL, 0);\r
469 +       char *error = xmalloc (error_size);\r
470 +\r
471 +       regerror (rerr, preg, error, error_size);\r
472 +       INTERNAL_ERROR ("compiling regex %s: %s\n",\r
473 +                       regex, error);\r
474 +    }\r
475 +}\r
476 +\r
477 +int\r
478 +xregexec (const regex_t *preg, const char *string,\r
479 +         size_t nmatch, regmatch_t pmatch[], int eflags)\r
480 +{\r
481 +    unsigned int i;\r
482 +    int rerr;\r
483 +\r
484 +    rerr = regexec (preg, string, nmatch, pmatch, eflags);\r
485 +    if (rerr)\r
486 +       return rerr;\r
487 +\r
488 +    for (i = 0; i < nmatch; i++) {\r
489 +       if (pmatch[i].rm_so == -1)\r
490 +           INTERNAL_ERROR ("matching regex against %s: Sub-match %d not found\n",\r
491 +                           string, i);\r
492 +    }\r
493 +\r
494 +    return 0;\r
495 +}\r
496 diff --git a/util/xutil.h b/util/xutil.h\r
497 new file mode 100644\r
498 index 0000000..fd77f73\r
499 --- /dev/null\r
500 +++ b/util/xutil.h\r
501 @@ -0,0 +1,55 @@\r
502 +/* xutil.h - Various wrapper functions to abort on error.\r
503 + *\r
504 + * Copyright © 2009 Carl Worth\r
505 + *\r
506 + * This program is free software: you can redistribute it and/or modify\r
507 + * it under the terms of the GNU General Public License as published by\r
508 + * the Free Software Foundation, either version 3 of the License, or\r
509 + * (at your option) any later version.\r
510 + *\r
511 + * This program is distributed in the hope that it will be useful,\r
512 + * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
513 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
514 + * GNU General Public License for more details.\r
515 + *\r
516 + * You should have received a copy of the GNU General Public License\r
517 + * along with this program.  If not, see http://www.gnu.org/licenses/ .\r
518 + *\r
519 + * Author: Carl Worth <cworth@cworth.org>\r
520 + */\r
521 +\r
522 +#ifndef NOTMUCH_XUTIL_H\r
523 +#define NOTMUCH_XUTIL_H\r
524 +\r
525 +#include <stdlib.h>\r
526 +#include <sys/types.h>\r
527 +#include <regex.h>\r
528 +\r
529 +#pragma GCC visibility push(hidden)\r
530 +\r
531 +/* xutil.c */\r
532 +void *\r
533 +xcalloc (size_t nmemb, size_t size);\r
534 +\r
535 +void *\r
536 +xmalloc (size_t size);\r
537 +\r
538 +void *\r
539 +xrealloc (void *ptrr, size_t size);\r
540 +\r
541 +char *\r
542 +xstrdup (const char *s);\r
543 +\r
544 +char *\r
545 +xstrndup (const char *s, size_t n);\r
546 +\r
547 +void\r
548 +xregcomp (regex_t *preg, const char *regex, int cflags);\r
549 +\r
550 +int\r
551 +xregexec (const regex_t *preg, const char *string,\r
552 +         size_t nmatch, regmatch_t pmatch[], int eflags);\r
553 +\r
554 +#pragma GCC visibility pop\r
555 +\r
556 +#endif\r
557 diff --git a/xutil.c b/xutil.c\r
558 deleted file mode 100644\r
559 index 5f98f3f..0000000\r
560 -- \r
561 1.7.6.3\r
562 \r