X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fstr.h;h=c0643263d36b85075616620a3d2a0662a4e4f4f4;hb=ebf3b993687a25782fe72f45bf3e72aa4bee7c95;hp=7773db022ca69fb54cb0a9a53c3e739330794604;hpb=cb05567731adc7c890d3146102ff01068ba796dd;p=pspp-builds.git diff --git a/src/libpspp/str.h b/src/libpspp/str.h index 7773db02..c0643263 100644 --- a/src/libpspp/str.h +++ b/src/libpspp/str.h @@ -20,6 +20,7 @@ #if !str_h #define str_h 1 +#include #include #include #include @@ -128,6 +129,8 @@ void ds_shrink (struct string *); void ds_truncate (struct string *, size_t); void ds_rpad (struct string *, size_t length, char pad); int ds_rtrim_spaces (struct string *); +int ds_ltrim_spaces (struct string *st); + bool ds_chomp (struct string *, char); /* Inspectors. */ @@ -171,6 +174,7 @@ ds_length (const struct string *st) extern inline char * ds_c_str (const struct string *st) { + assert(st); ((char *) st->string)[st->length] = '\0'; return st->string; } @@ -206,4 +210,12 @@ spprintf (char *dst, const char *format, ...) return dst + count; } +int ds_find(const struct string *st, const char cs[]); + +int ds_n_find(const struct string *st, const char cs[]); + +void ds_create_substr(struct string *dst, const struct string *src, + int first, int last); + + #endif /* str_h */