summaryrefslogtreecommitdiffstats
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
commit50f9604d3b055e8ec8c5617c792e62d6e01219a3 (patch)
tree39fcd3980a3ce1ed22e07f3f0b0d813f92061772 /xstd.c
parentffd36f32dbbe968941923914f7f8630c797a1206 (diff)
downloadmandoc-50f9604d3b055e8ec8c5617c792e62d6e01219a3.tar.gz
Re-merged old port-building routines.
Diffstat (limited to 'xstd.c')
-rw-r--r--xstd.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/xstd.c b/xstd.c
index dee1ff35..b5820d70 100644
--- a/xstd.c
+++ b/xstd.c
@@ -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)
{