diff options
author | Brian Paul <[email protected]> | 2003-01-14 03:02:13 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-01-14 03:02:13 +0000 |
commit | 44257dacc0d5e2032b2d5eb6a6b35127c0f77a76 (patch) | |
tree | f539ae332e7324a0d83b90e7b3cf278804ec301a /src/mesa/main/imports.c | |
parent | 4097ea012a14656f468f3e41480ef4cbec926038 (diff) |
added _mesa_strtof()
Diffstat (limited to 'src/mesa/main/imports.c')
-rw-r--r-- | src/mesa/main/imports.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index b64bb3cc330..4123545ee07 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -1,4 +1,4 @@ -/* $Id: imports.c,v 1.27 2002/12/06 03:10:59 brianp Exp $ */ +/* $Id: imports.c,v 1.28 2003/01/14 03:02:13 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -356,6 +356,17 @@ _mesa_strncmp( const char *s1, const char *s2, size_t n ) } +char * +_mesa_strdup( const char *s ) +{ + int l = _mesa_strlen(s); + char *s2 = _mesa_malloc(l + 1); + if (s2) + _mesa_strcpy(s2, s); + return s2; +} + + int _mesa_atoi(const char *s) { @@ -367,6 +378,17 @@ _mesa_atoi(const char *s) } +float +_mesa_strtof( const char *s, const char **end ) +{ +#if defined(XFree86LOADER) && defined(IN_MODULE) + return xf86strtof(s, end); +#else + return strtod(s, end); +#endif +} + + int _mesa_sprintf( char *str, const char *fmt, ... ) { |