home | help
xt_strsqueeze(3)	    Library Functions Manual		xt_strsqueeze(3)

NAME
     xt_strsqueeze() - Squeeze a string by replacing middle with ...

LIBRARY
     #include <xtend/string.h>
     -lxtend

SYNOPSIS
     size_t  xt_strsqueeze(char *dest, const char *src, size_t dstsize)

ARGUMENTS
     dest:   Pointer to a character array of at least len dstsize, where
     the possibly modified string is stored.
     src:    Point to a character array containing the string to compact
     dstsize: Length of the dest array

DESCRIPTION
     Copy  string src to dest, reducing to a maximum length of dstsize if neces-
     sary by replacing the center portion of the string with "...".

RETURN VALUES
     The length of the original string (like strlcpy(3))

EXAMPLES
     #define MAXLEN  127
     char    limited_str[MAXLEN + 1],
	     original_str[SOME_OTHER_LEN + 1];

     xt_strsqueeze(limited_str, original_str, MAXLEN + 1);

SEE ALSO
     strlcpy(3), strlcat(3)

								xt_strsqueeze(3)

home | help