ts_array.c - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
ts_array.c (322B)
---
1 #include <u.h>
2 #include <libc.h>
3 #include "libString.h"
4
5 extern String* _s_alloc(void);
6
7 /* return a String containing a character array (this had better not grow) */
8 extern String *
9 s_array(char *cp, int len)
10 {
11 String *sp = _s_alloc();
12
13 sp->base = sp->ptr = cp;
14 sp->end = sp->base + len;
15 sp->fixed = 1;
16 return sp;
17 }