#endif
- assert(_mesa_strlen(buffer) < MAX_STRING);
+ assert(strlen(buffer) < MAX_STRING);
return buffer;
}
static char *
append(const char *a, const char *b)
{
- const GLuint aLen = a ? _mesa_strlen(a) : 0;
- const GLuint bLen = b ? _mesa_strlen(b) : 0;
+ const GLuint aLen = a ? strlen(a) : 0;
+ const GLuint bLen = b ? strlen(b) : 0;
char *s = _mesa_calloc(aLen + bLen + 1);
if (s) {
if (a)
/* first, compute length of the extension string */
for (i = 0 ; i < Elements(default_extensions) ; i++) {
if (extension_enabled(ctx, i)) {
- extStrLen += (GLuint)_mesa_strlen(default_extensions[i].name) + 1;
+ extStrLen += (GLuint) strlen(default_extensions[i].name) + 1;
}
}
if (extraExt)
- extStrLen += _mesa_strlen(extraExt) + 1; /* +1 for space */
+ extStrLen += strlen(extraExt) + 1; /* +1 for space */
/* allocate the extension string */
s = (char *) _mesa_malloc(extStrLen);
extStrLen = 0;
for (i = 0 ; i < Elements(default_extensions) ; i++) {
if (extension_enabled(ctx, i)) {
- GLuint len = (GLuint)_mesa_strlen(default_extensions[i].name);
+ GLuint len = (GLuint) strlen(default_extensions[i].name);
_mesa_memcpy(s + extStrLen, default_extensions[i].name, len);
extStrLen += len;
s[extStrLen] = ' ';
/** \name String */
/*@{*/
-/** Wrapper around strlen() */
-size_t
-_mesa_strlen( const char *s )
-{
- return strlen(s);
-}
-
/** Wrapper around strcmp() */
int
_mesa_strcmp( const char *s1, const char *s2 )
_mesa_strdup( const char *s )
{
if (s) {
- size_t l = _mesa_strlen(s);
+ size_t l = strlen(s);
char *s2 = (char *) _mesa_malloc(l + 1);
if (s2)
strcpy(s2, s);
extern char *
_mesa_getenv( const char *var );
-extern size_t
-_mesa_strlen( const char *s );
-
extern int
_mesa_strcmp( const char *s1, const char *s2 );
return;
}
if (length == NULL || length[i] < 0)
- offsets[i] = _mesa_strlen(string[i]);
+ offsets[i] = strlen(string[i]);
else
offsets[i] = length[i];
/* accumulate string lengths */
switch (pname) {
case GL_PROGRAM_LENGTH_ARB:
*params
- = prog->String ? (GLint) _mesa_strlen((char *) prog->String) : 0;
+ = prog->String ? (GLint) strlen((char *) prog->String) : 0;
return;
case GL_PROGRAM_FORMAT_ARB:
*params = prog->Format;
}
if (prog->String)
- _mesa_memcpy(dst, prog->String, _mesa_strlen((char *) prog->String));
+ _mesa_memcpy(dst, prog->String, strlen((char *) prog->String));
else
*dst = '\0';
}
if (mod & GL_SATURATE_BIT_ATI)
strncat(ret_str, "|SAT", 1024);
- if (_mesa_strlen(ret_str) == 0)
+ if (strlen(ret_str) == 0)
strncat(ret_str, "NONE", 1024);
return ret_str;
}
parseState->pos += (-i);
return GL_FALSE;
}
- len = (GLint)_mesa_strlen((const char *) token);
+ len = (GLint) strlen((const char *) token);
parseState->pos += (i - len);
return GL_TRUE;
}
*params = prog->Target;
return;
case GL_PROGRAM_LENGTH_NV:
- *params = prog->String ?(GLint)_mesa_strlen((char *) prog->String) : 0;
+ *params = prog->String ?(GLint) strlen((char *) prog->String) : 0;
return;
case GL_PROGRAM_RESIDENT_NV:
*params = prog->Resident;
}
if (prog->String) {
- MEMCPY(program, prog->String, _mesa_strlen((char *) prog->String));
+ MEMCPY(program, prog->String, strlen((char *) prog->String));
}
else {
program[0] = 0;
parseState->pos += (-i);
return GL_FALSE;
}
- len = (GLint)_mesa_strlen((const char *) token);
+ len = (GLint) strlen((const char *) token);
parseState->pos += (i - len);
return GL_TRUE;
}
for (i = 0; i < (GLint) paramList->NumParameters; i++) {
if (paramList->Parameters[i].Name &&
_mesa_strncmp(paramList->Parameters[i].Name, name, nameLen) == 0
- && _mesa_strlen(paramList->Parameters[i].Name) == (size_t)nameLen)
+ && strlen(paramList->Parameters[i].Name) == (size_t)nameLen)
return i;
}
}
return 0;
for (i = 0; i < list->NumParameters; i++) {
if (list->Parameters[i].Type == type) {
- GLuint len = _mesa_strlen(list->Parameters[i].Name);
+ GLuint len = strlen(list->Parameters[i].Name);
if (len > maxLen)
maxLen = len;
}
GLint max = 0;
GLuint i;
for (i = 0; list && i < list->NumUniforms; i++) {
- GLint len = (GLint)_mesa_strlen(list->Uniforms[i].Name);
+ GLint len = (GLint) strlen(list->Uniforms[i].Name);
if (len > max)
max = len;
}
parse_identifier_str(slang_parse_ctx * C, char **id)
{
*id = (char *) C->I;
- C->I += _mesa_strlen(*id) + 1;
+ C->I += strlen(*id) + 1;
}
static slang_atom
const char *id;
id = (const char *) C->I;
- C->I += _mesa_strlen(id) + 1;
+ C->I += strlen(id) + 1;
return slang_atom_pool_atom(C->atoms, id);
}
parse_identifier_str(C, &fractional);
parse_identifier_str(C, &exponent);
- whole = (char *) _slang_alloc((_mesa_strlen(integral) +
- _mesa_strlen(fractional) +
- _mesa_strlen(exponent) + 3) * sizeof(char));
+ whole = (char *) _slang_alloc((strlen(integral) +
+ strlen(fractional) +
+ strlen(exponent) + 3) * sizeof(char));
if (whole == NULL) {
slang_info_log_memory(C->L);
RETURN0;
s = (char *) malloc(len);
sprintf(s, "%s = %s %s %s %s", dstAnnot,
srcAnnot0, operator, srcAnnot1, srcAnnot2);
- assert(_mesa_strlen(s) < len);
+ assert(strlen(s) < len);
free(dstAnnot);
free(srcAnnot0);
static int id = 1;
slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label));
if (l) {
- l->Name = (char *) _slang_alloc(_mesa_strlen(name) + 10);
+ l->Name = (char *) _slang_alloc(strlen(name) + 10);
if (!l->Name) {
_mesa_free(l);
return NULL;
for (i = 0; i < shProg->NumShaders; i++) {
const struct gl_shader *shader = shProg->Shaders[i];
if (shader->Type == shaderType) {
- shaderLengths[i] = _mesa_strlen(shader->Source);
+ shaderLengths[i] = strlen(shader->Source);
totalLen += shaderLengths[i];
if (!firstShader)
firstShader = shader;
_slang_strdup(const char *s)
{
if (s) {
- size_t l = _mesa_strlen(s);
+ size_t l = strlen(s);
char *s2 = (char *) _slang_alloc(l + 1);
if (s2)
strcpy(s2, s);
char *
slang_string_concat (char *dst, const char *src)
{
- return strcpy (dst + _mesa_strlen (dst), src);
+ return strcpy (dst + strlen (dst), src);
}
#define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2)
#define slang_string_copy(dst, src) strcpy (dst, src)
-#define slang_string_length(str) _mesa_strlen (str)
+#define slang_string_length(str) strlen (str)
char *slang_string_concat (char *, const char *);