String functions



set_format_text ()
     Description:
       Formats a string using the same formatting style as the
       "printf()" function.

     Syntax:
       l_text  set_format_text ( l_text *dest, l_text format, ... );

     Parameters:
       dest        Pointer to a variable that will contain the
                   formatted string. (can be NULL)
       format      The formatting to use on the string.
       ...         The string(s) to format.

     Returns:
       The formatted string. 



set_format_text_nice ()
     Description:
       Formats a string using the same formatting style as the
       "printf()" function but if the string is longer than a
       defined value it is truncated and the last three chars 
       are set to "...". 

     Syntax:
       l_text  set_format_text_nice ( l_text *dest, l_int size, 
                                      l_text format, ... );

     Parameters:
       dest        Pointer to a variable that will contain the
                   formatted string. (can be NULL)
       size        Maximum length of the string. If the value is 
                   positive, the end of the string is truncated. 
                   If negative, beginning of the string is truncated.
       format      The formatting to use on the string.
       ...         The string(s) to format.

     Returns:
       The formatted string. 
     

     Example:
        l_text hello1 = set_format_text(NULL, "I %s you %s %s", love, Hanny, Banny);
        l_text hello2 = set_fromat_text_nice(NULL, -12, "I %s you %s %s", love, Hanny, Banny);
        l_text hello3 = set_fromat_text_nice(NULL, +12, "I %s you %s %s", love, Hanny, Banny);

        in hello1 : "I love you Hanny Banny"
        in hello2 : "...nny Banny"
        in hello3 : "I love yo..."



insstr ()
     Description:
       Inserts a string into another string.

     Syntax:
       l_text  insstr ( l_text dest, l_text str, l_long pos, l_long size );

     Parameters:
       dest        The string to insert in. If it doesn't exist
                   a copy of the insertion string is created.
       str         String to insert.
       pos         Position to start inserting at.
       size        Length of the string to insert. The "dest"
                   string can change length depending on this.

     Returns:
       The edited string.



     Description:
       Removes a part of a string.

     Syntax:
       l_text  delstr ( l_text dest, l_long pos, l_long size );

     Parameters:
       dest        String to delete characters from.
       pos         The position to start removing from.
       size        Number of characters to remove.

     Returns:
       The edited string.



strdup ()
     Description:
       Duplicates a string. Allocate memory for a new string with
       the size "min(num, strlen(str))" and copies the original
       into this one. 

     Syntax:
       l_text  stridup ( l_text str, l_long num );

     Parameters:
       str         Original string to duplicate.
       num         Size of the string.

     Returns:
       The new string.



stristr ()
     Description:
       Finds a string into another one. Works as "strstr(s, d)" 
       but ignores character case.

     Syntax:
       l_text  stristr ( l_text s, l_text d );

     Parameters:
       s           String to search.
       d           String to find.

     Returns:
       Pointer to the first occurrance of the sub-string.


     Example:
        l_text occ = stristr("Hello YOU", "you");

        occ is pointer to char 'Y'...