summaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-05-28 12:54:33 -0600
committerBrian Paul <[email protected]>2008-05-28 12:54:33 -0600
commite94d383b9ba7964da9fefac2a55e10c00ee72392 (patch)
treed0a2171ec2125715dd79095f93136c39608fd298 /src/egl/main
parent17ec3b3cc5100deb6ef96977d87b2a7f05814f72 (diff)
egl: added eglstring.[ch]
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/Makefile6
-rw-r--r--src/egl/main/eglstring.c24
-rw-r--r--src/egl/main/eglstring.h9
3 files changed, 37 insertions, 2 deletions
diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile
index 5f3d65f72a8..eabfb414501 100644
--- a/src/egl/main/Makefile
+++ b/src/egl/main/Makefile
@@ -17,8 +17,9 @@ HEADERS = \
eglhash.h \
eglmode.h \
eglscreen.h \
+ eglstring.h \
eglsurface.h \
-# eglx.h
+ eglx.h
SOURCES = \
eglapi.c \
@@ -32,8 +33,9 @@ SOURCES = \
eglhash.c \
eglmode.c \
eglscreen.c \
+ eglstring.c \
eglsurface.c \
-# eglx.c
+ eglx.c
OBJECTS = $(SOURCES:.c=.o)
diff --git a/src/egl/main/eglstring.c b/src/egl/main/eglstring.c
new file mode 100644
index 00000000000..ba7406158c4
--- /dev/null
+++ b/src/egl/main/eglstring.c
@@ -0,0 +1,24 @@
+/**
+ * String utils.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "eglstring.h"
+
+
+char *
+_eglstrdup(const char *s)
+{
+ if (s) {
+ int l = strlen(s);
+ char *s2 = malloc(l + 1);
+ if (s2)
+ strcpy(s2, s);
+ return s2;
+ }
+ return NULL;
+}
+
+
+
diff --git a/src/egl/main/eglstring.h b/src/egl/main/eglstring.h
new file mode 100644
index 00000000000..10468636e87
--- /dev/null
+++ b/src/egl/main/eglstring.h
@@ -0,0 +1,9 @@
+#ifndef EGLSTRING_INCLUDED
+#define EGLSTRING_INCLUDED
+
+
+extern char *
+_eglstrdup(const char *s);
+
+
+#endif /* EGLSTRING_INCLUDED */