Skip to content

Commit

Permalink
api: export new utils_strv_shorten_file_list() function
Browse files Browse the repository at this point in the history
Since I based the algorithm of the above function on code in one of my python
plugins, I would like to remove the implementation in my plugin and call
Geany's function.
  • Loading branch information
kugel- committed Dec 3, 2018
1 parent 3512f6c commit c058370
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils.c
Expand Up @@ -2146,7 +2146,7 @@ gchar *utils_strv_find_lcs(gchar **strv, size_t num)
}


/* * Transform file names in a list to be shorter.
/** Transform file names in a list to be shorter.
*
* This function takes a list of file names (porbably with absolute paths), and
* transforms the paths such that they are short but still unique. This is intended
Expand All @@ -2156,10 +2156,13 @@ gchar *utils_strv_find_lcs(gchar **strv, size_t num)
* The algorthm strips the common prefix (e-g. the user's home directory) and
* replaces the longest common substring with "...".
*
* @param file_names The list of strings to process.
* @param file_names @arraylen{num} The list of strings to process.
* @param num The number of strings contained in @a strv. Can be 0 if @a strv is a @c GStrv
* @return A newly-allocated NULL-terminated array of transformed paths strings. Use @c g_strfreev() to free it.
* @return @transfer{full} A newly-allocated NULL-terminated array of transformed paths strings. Use @c g_strfreev() to free it.
*
* @since 1.34 (API 239)
*/
GEANY_API_SYMBOL
gchar **utils_strv_shorten_file_list(gchar **file_names, size_t num)
{
gint i, j;
Expand Down

0 comments on commit c058370

Please sign in to comment.