2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00

dynamic-string: New function ds_cstr_ro().

This commit is contained in:
Ben Pfaff
2009-12-16 11:28:13 -08:00
parent ffed42ab73
commit 5f98eed4eb
2 changed files with 7 additions and 0 deletions

View File

@@ -219,6 +219,12 @@ ds_cstr(struct ds *ds)
return ds->string;
}
const char *
ds_cstr_ro(const struct ds *ds)
{
return ds_cstr((struct ds *) ds);
}
/* Returns a null-terminated string representing the current contents of 'ds',
* which the caller is expected to free with free(), then clears the contents
* of 'ds'. */

View File

@@ -56,6 +56,7 @@ void ds_put_hex_dump(struct ds *ds, const void *buf_, size_t size,
int ds_get_line(struct ds *, FILE *);
char *ds_cstr(struct ds *);
const char *ds_cstr_ro(const struct ds *);
char *ds_steal_cstr(struct ds *);
void ds_destroy(struct ds *);