Fix examples based on older versions, add build examples script
This commit is contained in:
parent
f4d4a8ab00
commit
48218b0cdb
7 changed files with 38 additions and 16 deletions
|
|
@ -1,15 +1,16 @@
|
|||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#define LAZY_IMPL
|
||||
#include "lazy.h"
|
||||
#include "../lazy.h"
|
||||
|
||||
int main() {
|
||||
char *src = strdup(" \t This text has some extra whitespace \t ");
|
||||
char *src = lz_cstr_dup(" \t This text has some extra whitespace \t ");
|
||||
Lz_Slc s = lz_cstr_to_slc(src);
|
||||
|
||||
printf("|"LZ_SLC_FMT"|\n", LZ_SLC_PRINTF(s));
|
||||
printf("|"LZ_STR_FMT"|\n", LZ_STR_PRINTF(s));
|
||||
lz_trim_typ(&s, isspace);
|
||||
printf("|"LZ_SLC_FMT"|\n", LZ_SLC_PRINTF(s));
|
||||
printf("|"LZ_STR_FMT"|\n", LZ_STR_PRINTF(s));
|
||||
|
||||
free(src); // excessive but this is how you should do it
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue