summaryrefslogtreecommitdiffstatshomepage
path: root/xstd.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-20 13:44:05 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-20 13:44:05 +0000
commitf0efcfb7750a1c0ab3108c5a759de5c050166035 (patch)
tree42c4f3dfff406eb906a633e4b8588959e74dd9ae /xstd.c
parentd7fbb7d096f24634fd2aa0c5146e6fbf55acb09e (diff)
downloadmandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.tar.gz
mandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.tar.zst
mandoc-f0efcfb7750a1c0ab3108c5a759de5c050166035.zip
Re-merged old port-building routines.
Diffstat (limited to 'xstd.c')
-rw-r--r--xstd.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/xstd.c b/xstd.c
index eb36b404..163a0f27 100644
--- a/xstd.c
+++ b/xstd.c
@@ -1,4 +1,4 @@
-/* $Id: xstd.c,v 1.3 2009/01/17 16:15:27 kristaps Exp $ */
+/* $Id: xstd.c,v 1.4 2009/01/20 13:44:05 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -23,12 +23,16 @@
#include "private.h"
+/*
+ * Contains wrappers for common functions to simplify their general
+ * usage throughout this codebase.
+ */
+
#ifdef __linux__
extern size_t strlcat(char *, const char *, size_t);
extern size_t strlcpy(char *, const char *, size_t);
#endif
-
int
xstrcmp(const char *p1, const char *p2)
{
@@ -36,7 +40,6 @@ xstrcmp(const char *p1, const char *p2)
return(0 == strcmp(p1, p2));
}
-
int
xstrlcat(char *dst, const char *src, size_t sz)
{
@@ -44,7 +47,6 @@ xstrlcat(char *dst, const char *src, size_t sz)
return(strlcat(dst, src, sz) < sz);
}
-
int
xstrlcpy(char *dst, const char *src, size_t sz)
{
@@ -52,8 +54,6 @@ xstrlcpy(char *dst, const char *src, size_t sz)
return(strlcpy(dst, src, sz) < sz);
}
-
-
void *
xcalloc(size_t num, size_t sz)
{
@@ -64,7 +64,6 @@ xcalloc(size_t num, size_t sz)
return(p);
}
-
char *
xstrdup(const char *p)
{
@@ -75,7 +74,6 @@ xstrdup(const char *p)
return(pp);
}
-
int
xstrlcats(char *buf, const struct mdoc_node *n, size_t sz)
{
@@ -97,9 +95,6 @@ xstrlcats(char *buf, const struct mdoc_node *n, size_t sz)
return(1);
}
-
-
-
#ifdef __linux__
/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
@@ -151,7 +146,6 @@ strlcat(char *dst, const char *src, size_t siz)
return(dlen + (s - src)); /* count does not include NUL */
}
-
size_t
strlcpy(char *dst, const char *src, size_t siz)
{