stacinhtml

Static C in HTML - simple static site generator
git clone git://git.kocotian.pl/stacinhtml.git
Log | Files | Refs | README

commit cc12adaa0f8747743a46b65f6d1221b654701d7e
parent 91397306f94517db054dcc6d714a79d633faf66c
Author: kocotian <kocotian@kocotian.pl>
Date:   Sat, 20 Mar 2021 20:49:30 +0100

toString()

Diffstat:
Mstr.h | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/str.h b/str.h @@ -6,8 +6,18 @@ typedef struct { size_t len; } String; +static String toString(char *s); static int Strcmp(String a, String b); static ssize_t Strtok(String string, String *out, char c); +static String Strtrim(String str); + +static String +toString(char *s) +{ + String ret; + ret.len = (ret.data = s); + return ret; +} static int Strcmp(String a, String b)