Add libString.

This commit is contained in:
rsc 2003-12-11 18:15:57 +00:00
parent 57ccfb9e8f
commit 7f11104a57
20 changed files with 1315 additions and 0 deletions

13
src/libString/s_putc.c Normal file
View file

@ -0,0 +1,13 @@
#include <u.h>
#include <libc.h>
#include "libString.h"
void
s_putc(String *s, int c)
{
if(s->ref > 1)
sysfatal("can't s_putc a shared string");
if (s->ptr >= s->end)
s_grow(s, 2);
*(s->ptr)++ = c;
}