X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fstr.h;h=c53b2f4659c37f016ff50bdf8f434c902e2d6c17;hb=dbb0228a4c98cbf4756ba651fda158c1565b3b55;hp=9b90cf60f93695e4e6715b2b0d82e782905f3ab4;hpb=b321086267ad1014dc5d09886396cde30f094437;p=pspp diff --git a/src/str.h b/src/str.h index 9b90cf60f9..c53b2f4659 100644 --- a/src/str.h +++ b/src/str.h @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #if !str_h #define str_h 1 @@ -120,56 +120,59 @@ long getdelim (char **lineptr, size_t * n, int delimiter, FILE * stream); void mm_reverse (void *, size_t); char *mm_find_reverse (const char *, size_t, const char *, size_t); +int mm_case_compare (const void *, const void *, size_t); int st_compare_pad (const char *, size_t, const char *, size_t); char *st_spaces (int); void st_bare_pad_copy (char *dest, const char *src, size_t n); void st_bare_pad_len_copy (char *dest, const char *src, size_t n, size_t len); void st_pad_copy (char *dest, const char *src, size_t n); +void st_trim_copy (char *dest, const char *src, size_t n); +void st_uppercase (char *); -/* Lengthed strings. */ -struct len_string +/* Fixed-length strings. */ +struct fixed_string { char *string; size_t length; }; -void ls_create (struct len_string *, const char *); -void ls_create_buffer (struct len_string *, +void ls_create (struct fixed_string *, const char *); +void ls_create_buffer (struct fixed_string *, const char *, size_t len); -void ls_init (struct len_string *, const char *, size_t); -void ls_shallow_copy (struct len_string *, const struct len_string *); -void ls_destroy (struct len_string *); +void ls_init (struct fixed_string *, const char *, size_t); +void ls_shallow_copy (struct fixed_string *, const struct fixed_string *); +void ls_destroy (struct fixed_string *); -void ls_null (struct len_string *); -int ls_null_p (const struct len_string *); -int ls_empty_p (const struct len_string *); +void ls_null (struct fixed_string *); +int ls_null_p (const struct fixed_string *); +int ls_empty_p (const struct fixed_string *); -size_t ls_length (const struct len_string *); -char *ls_c_str (const struct len_string *); -char *ls_end (const struct len_string *); +size_t ls_length (const struct fixed_string *); +char *ls_c_str (const struct fixed_string *); +char *ls_end (const struct fixed_string *); #if __GNUC__ > 1 extern inline size_t -ls_length (const struct len_string *st) +ls_length (const struct fixed_string *st) { return st->length; } extern inline char * -ls_c_str (const struct len_string *st) +ls_c_str (const struct fixed_string *st) { return st->string; } extern inline char * -ls_end (const struct len_string *st) +ls_end (const struct fixed_string *st) { return st->string + st->length; } #endif -/* Dynamic strings. */ +/* Variable length strings. */ struct string {