mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
24 lines
276 B
C
24 lines
276 B
C
|
#include <u.h>
|
||
|
#include <libc.h>
|
||
|
#include "libString.h"
|
||
|
|
||
|
String*
|
||
|
s_reset(String *s)
|
||
|
{
|
||
|
if(s != nil){
|
||
|
s = s_unique(s);
|
||
|
s->ptr = s->base;
|
||
|
*s->ptr = '\0';
|
||
|
} else
|
||
|
s = s_new();
|
||
|
return s;
|
||
|
}
|
||
|
|
||
|
String*
|
||
|
s_restart(String *s)
|
||
|
{
|
||
|
s = s_unique(s);
|
||
|
s->ptr = s->base;
|
||
|
return s;
|
||
|
}
|