aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/dummylib/xalloc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-15 10:39:59 +0000
committermarha <marha@users.sourceforge.net>2009-09-15 10:39:59 +0000
commita233ed27754bb0d373d63569d9a28aeb8fee5b82 (patch)
tree2732a9434bbc102653dc22df9887d94e19570836 /xorg-server/hw/xfree86/dummylib/xalloc.c
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-a233ed27754bb0d373d63569d9a28aeb8fee5b82.tar.gz
vcxsrv-a233ed27754bb0d373d63569d9a28aeb8fee5b82.tar.bz2
vcxsrv-a233ed27754bb0d373d63569d9a28aeb8fee5b82.zip
Checked in xorg-server-1.6.99.901
Diffstat (limited to 'xorg-server/hw/xfree86/dummylib/xalloc.c')
-rw-r--r--xorg-server/hw/xfree86/dummylib/xalloc.c111
1 files changed, 0 insertions, 111 deletions
diff --git a/xorg-server/hw/xfree86/dummylib/xalloc.c b/xorg-server/hw/xfree86/dummylib/xalloc.c
deleted file mode 100644
index b671d4dde..000000000
--- a/xorg-server/hw/xfree86/dummylib/xalloc.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include "os.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-
-/*
- * Utility functions required by libxf86_os.
- */
-
-_X_EXPORT pointer
-Xalloc(unsigned long n)
-{
- if (!n)
- n = 1;
- return malloc(n);
-}
-
-_X_EXPORT pointer
-Xrealloc(pointer p, unsigned long n)
-{
- if (!n)
- n = 1;
- return realloc(p, n);
-}
-
-_X_EXPORT pointer
-Xcalloc(unsigned long n)
-{
- pointer r;
-
- r = Xalloc(n);
- memset(r, 0, n);
- return r;
-}
-
-_X_EXPORT pointer
-XNFalloc(unsigned long n)
-{
- pointer r;
-
- r = Xalloc(n);
- if (!r)
- FatalError("XNFalloc failed\n");
- return r;
-
-}
-
-_X_EXPORT pointer
-XNFrealloc(pointer p, unsigned long n)
-{
- pointer r;
-
- r = Xrealloc(p, n);
- if (!r)
- FatalError("XNFrealloc failed\n");
- return r;
-
-}
-
-_X_EXPORT pointer
-XNFcalloc(unsigned long n)
-{
- pointer r;
-
- r = Xcalloc(n);
- if (!r)
- FatalError("XNFcalloc failed\n");
- return r;
-
-}
-
-_X_EXPORT void
-Xfree(pointer p)
-{
- free(p);
-}
-
-_X_EXPORT char *
-Xstrdup(const char *s)
-{
- char *sd;
-
- if (s == NULL)
- return NULL;
-
- sd = (char *)Xalloc(strlen(s) + 1);
- if (sd != NULL)
- strcpy(sd, s);
- return sd;
-}
-
-char *
-XNFstrdup(const char *s)
-{
- char *sd;
- size_t len;
-
- if (s == NULL)
- return NULL;
-
- len = strlen(s) + 1;
- sd = (char *)XNFalloc(len);
- strlcpy(sd, s, len);
- return sd;
-}
-