diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2011-12-26 19:18:46 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2011-12-26 19:18:46 -0800 |
commit | 8d2f107d61a8b0e099ab9a59b8a32c236da5a5fc (patch) | |
tree | 89f718ab74f8400332534aee237c6f925348f05c /wildcard.h | |
parent | 3f16ace6784caab54fb054836ee93902e9701913 (diff) |
Some changes to migrate towards C++ and a multithreaded model
Diffstat (limited to 'wildcard.h')
-rw-r--r-- | wildcard.h | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -1,4 +1,4 @@ -/** \file wildcard.h +/** \file wildcard.h My own globbing implementation. Needed to implement this instead of using libs globbing to support tab-expansion of globbed @@ -13,8 +13,10 @@ #define FISH_WILDCARD_H #include <wchar.h> +#include <vector> #include "util.h" +#include "common.h" /* Use unencoded private-use keycodes for internal characters @@ -39,7 +41,7 @@ enum ; /** - Expand the wildcard by matching against the filesystem. + Expand the wildcard by matching against the filesystem. New strings are allocated using malloc and should be freed by the caller. @@ -61,12 +63,14 @@ enum \param out The list in which to put the output \return 1 if matches where found, 0 otherwise. Return -1 on abort (I.e. ^C was pressed). - + */ -int wildcard_expand( const wchar_t *wc, - const wchar_t *base_dir, - int flags, +int wildcard_expand( const wchar_t *wc, + const wchar_t *base_dir, + int flags, array_list_t *out ); + +int wildcard_expand_string(const wcstring &wc, const wcstring &base_dir, int flags, std::vector<wcstring> &out ); /** Test whether the given wildcard matches the string @@ -74,7 +78,7 @@ int wildcard_expand( const wchar_t *wc, \param wc The wildcard to test against \return true if the wildcard matched */ -int wildcard_match( const wchar_t *str, +int wildcard_match( const wchar_t *str, const wchar_t *wc ); @@ -88,7 +92,7 @@ int wildcard_has( const wchar_t *str, int internal ); */ int wildcard_complete( const wchar_t *str, const wchar_t *wc, - const wchar_t *desc, + const wchar_t *desc, const wchar_t *(*desc_func)(const wchar_t *), array_list_t *out, int flags ); |