u_string.h File Reference

Platform independent functions for string manipulation. More...

Include dependency graph for u_string.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  util_strbuf
 Printable string buffer. More...

Defines

#define util_vsnprintf   vsnprintf
#define util_snprintf   snprintf
#define util_vsprintf   vsprintf
#define util_sprintf   sprintf
#define util_strchr   strchr
#define util_strcmp   strcmp
#define util_strncmp   strncmp
#define util_strncat   strncat
#define util_strstr   strstr
#define util_memmove   memmove

Functions

static void util_strbuf_init (struct util_strbuf *sbuf, char *str, size_t size)
static void util_strbuf_printf (struct util_strbuf *sbuf, const char *format,...)


Detailed Description

Platform independent functions for string manipulation.

Author:
Jose Fonseca <jrfonseca@tungstengraphics.com>

Definition in file u_string.h.


Define Documentation

#define util_memmove   memmove

Definition at line 174 of file u_string.h.

#define util_snprintf   snprintf

Definition at line 166 of file u_string.h.

#define util_sprintf   sprintf

Definition at line 168 of file u_string.h.

#define util_strchr   strchr

Definition at line 169 of file u_string.h.

#define util_strcmp   strcmp

Definition at line 170 of file u_string.h.

#define util_strncat   strncat

Definition at line 172 of file u_string.h.

#define util_strncmp   strncmp

Definition at line 171 of file u_string.h.

#define util_strstr   strstr

Definition at line 173 of file u_string.h.

#define util_vsnprintf   vsnprintf

Definition at line 165 of file u_string.h.

#define util_vsprintf   vsprintf

Definition at line 167 of file u_string.h.


Function Documentation

static void util_strbuf_init ( struct util_strbuf sbuf,
char *  str,
size_t  size 
) [static]

Definition at line 191 of file u_string.h.

References util_strbuf::left, util_strbuf::ptr, and util_strbuf::str.

00192 {
00193    sbuf->str = str;
00194    sbuf->str[0] = 0;
00195    sbuf->ptr = sbuf->str;
00196    sbuf->left = size;
00197 }

static void util_strbuf_printf ( struct util_strbuf sbuf,
const char *  format,
  ... 
) [static]

Definition at line 201 of file u_string.h.

References util_strbuf::left, util_strbuf::ptr, and util_vsnprintf.

00202 {
00203    if(sbuf->left > 1) {
00204       size_t written;
00205       va_list ap;
00206       va_start(ap, format);
00207       written = util_vsnprintf(sbuf->ptr, sbuf->left, format, ap);
00208       va_end(ap);
00209       sbuf->ptr += written;
00210       sbuf->left -= written;
00211    }
00212 }


Generated on Tue Sep 29 06:25:29 2009 for Gallium3D by  doxygen 1.5.4