diff --git a/fx/include/fx/stringstream.h b/fx/include/fx/stringstream.h index c35ad37..ff0ae0d 100644 --- a/fx/include/fx/stringstream.h +++ b/fx/include/fx/stringstream.h @@ -27,7 +27,7 @@ FX_API fx_status fx_stringstream_reset(fx_stringstream *strv); FX_API fx_status fx_stringstream_reset_with_buffer(fx_stringstream *strv, char *buf, size_t max); -FX_API const char *fx_stringstream_ptr(const fx_stringstream *strv); +FX_API const char *fx_stringstream_get_cstr(const fx_stringstream *strv); FX_API char *fx_stringstream_steal(fx_stringstream *strv); FX_API size_t fx_stringstream_get_length(const fx_stringstream *strv); diff --git a/fx/string.c b/fx/string.c index bdc2999..0e6d5db 100644 --- a/fx/string.c +++ b/fx/string.c @@ -478,7 +478,7 @@ static fx_status string_replace_all_with_stringstream( size_t new_len = fx_stringstream_get_length(new_data); string_reserve(str, new_len); char *dest = string_ptr(str); - memcpy(dest, fx_stringstream_ptr(new_data), new_len); + memcpy(dest, fx_stringstream_get_cstr(new_data), new_len); dest[new_len] = '\0'; str->s_len = new_len; diff --git a/fx/stringstream.c b/fx/stringstream.c index 2ae2054..6d7e86d 100644 --- a/fx/stringstream.c +++ b/fx/stringstream.c @@ -141,7 +141,7 @@ static size_t stringstream_get_length(const struct fx_stringstream_p *strv) return strv->ss_len; } -static const char *stringstream_ptr(const struct fx_stringstream_p *ss) +static const char *stringstream_get_cstr(const struct fx_stringstream_p *ss) { return ss->ss_buf; } @@ -236,9 +236,12 @@ enum fx_status fx_stringstream_reset_with_buffer( max); } -const char *fx_stringstream_ptr(const fx_stringstream *ss) +const char *fx_stringstream_get_cstr(const fx_stringstream *ss) { - FX_CLASS_DISPATCH_STATIC_0(FX_TYPE_STRINGSTREAM, stringstream_ptr, ss); + FX_CLASS_DISPATCH_STATIC_0( + FX_TYPE_STRINGSTREAM, + stringstream_get_cstr, + ss); } char *fx_stringstream_steal(fx_stringstream *ss) diff --git a/fx/value.c b/fx/value.c index c049dc5..2486925 100644 --- a/fx/value.c +++ b/fx/value.c @@ -181,7 +181,7 @@ static fx_status value_change_string(fx_value *in, fx_value *out) } fx_string *result - = fx_string_create_from_cstr(fx_stringstream_ptr(strm)); + = fx_string_create_from_cstr(fx_stringstream_get_cstr(strm)); fx_stringstream_unref(strm); if (!result) {