mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-25 01:22:47 +00:00
Second thoughts on stringbuffer changes
git-svn-id: http://svn.osgeo.org/postgis/trunk@6367 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
447c10e294
commit
79320ce2bb
|
@ -114,32 +114,16 @@ char stringbuffer_lastchar(stringbuffer_t *s)
|
|||
return *(s->str_end - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append the specified string to the stringbuffer_t, using the given length
|
||||
*/
|
||||
void stringbuffer_append_with_size(stringbuffer_t *s, const char *a, size_t alen)
|
||||
{
|
||||
int alen0 = alen + 1; /* Length including null terminator */
|
||||
stringbuffer_makeroom(s, alen0);
|
||||
memcpy(s->str_end, a, alen0);
|
||||
s->str_end += alen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append the specified string to the stringbuffer_t.
|
||||
*/
|
||||
void stringbuffer_append(stringbuffer_t *s, const char *a)
|
||||
{
|
||||
int alen = strlen(a); /* Length of string to append */
|
||||
stringbuffer_append_with_size(s, a, alen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append the specified single character to the stringbuffer_t.
|
||||
*/
|
||||
void stringbuffer_append_char(stringbuffer_t *s, const char *a)
|
||||
{
|
||||
stringbuffer_append_with_size(s, a, 1);
|
||||
int alen0 = alen + 1; /* Length including null terminator */
|
||||
stringbuffer_makeroom(s, alen0);
|
||||
memcpy(s->str_end, a, alen0);
|
||||
s->str_end += alen;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -59,8 +59,6 @@ extern void stringbuffer_clear(stringbuffer_t *sb);
|
|||
void stringbuffer_set(stringbuffer_t *sb, const char *s);
|
||||
void stringbuffer_copy(stringbuffer_t *sb, stringbuffer_t *src);
|
||||
extern void stringbuffer_append(stringbuffer_t *sb, const char *s);
|
||||
extern void stringbuffer_append_char(stringbuffer_t *s, const char *a);
|
||||
extern void stringbuffer_append_with_size(stringbuffer_t *sb, const char *s, size_t s_size);
|
||||
extern int stringbuffer_aprintf(stringbuffer_t *sb, const char *fmt, ...);
|
||||
extern const char *stringbuffer_getstring(stringbuffer_t *sb);
|
||||
extern char *stringbuffer_getstringcopy(stringbuffer_t *sb);
|
||||
|
|
Loading…
Reference in a new issue