Selaa lähdekoodia

egl: added eglstring.[ch]

tags/mesa_20090313
Brian Paul 17 vuotta sitten
vanhempi
commit
e94d383b9b
3 muutettua tiedostoa jossa 37 lisäystä ja 2 poistoa
  1. 4
    2
      src/egl/main/Makefile
  2. 24
    0
      src/egl/main/eglstring.c
  3. 9
    0
      src/egl/main/eglstring.h

+ 4
- 2
src/egl/main/Makefile Näytä tiedosto

@@ -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)


+ 24
- 0
src/egl/main/eglstring.c Näytä tiedosto

@@ -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;
}




+ 9
- 0
src/egl/main/eglstring.h Näytä tiedosto

@@ -0,0 +1,9 @@
#ifndef EGLSTRING_INCLUDED
#define EGLSTRING_INCLUDED


extern char *
_eglstrdup(const char *s);


#endif /* EGLSTRING_INCLUDED */

Loading…
Peruuta
Tallenna