00001
00008 #ifndef FISH_COMPLETE_H
00009
00013 #define FISH_COMPLETE_H
00014
00015 #include <wchar.h>
00016
00017 #include "util.h"
00018
00022 #define SHARED 0
00023
00026 #define NO_FILES 1
00027
00030 #define NO_COMMON 2
00031
00035 #define EXCLUSIVE 3
00036
00040 #define PATH 1
00041
00044 #define COMMAND 0
00045
00049 #define COMPLETE_SEP L'\004'
00050
00054 #define COMPLETE_SEP_STR L"\004"
00055
00061 #define COMPLETE_ITEM_SEP L'\uf500'
00062
00067 #define PROG_COMPLETE_SEP L'\t'
00068
00073 #define COMPLETE_NO_SPACE 1
00074
00082 #define COMPLETE_NO_CASE 2
00083
00089 #define COMPLETE_WHOLE_ARGUMENT 4
00090
00095 #define COMPLETE_AUTO_SPACE 8
00096
00100 #define COMPLETE_DONT_ESCAPE 16
00101
00102
00103
00104 typedef struct
00105 {
00106
00110 const wchar_t *completion;
00111
00115 const wchar_t *description;
00116
00127 int flags;
00128
00129 }
00130 completion_t;
00131
00132
00175 void complete_add( const wchar_t *cmd,
00176 int cmd_type,
00177 wchar_t short_opt,
00178 const wchar_t *long_opt,
00179 int long_mode,
00180 int result_mode,
00181 const wchar_t *condition,
00182 const wchar_t *comp,
00183 const wchar_t *desc,
00184 int flags );
00190 void complete_set_authoritative( const wchar_t *cmd,
00191 int cmd_type,
00192 int authoritative );
00193
00197 void complete_remove( const wchar_t *cmd,
00198 int cmd_type,
00199 wchar_t short_opt,
00200 const wchar_t *long_opt );
00201
00212 void complete( const wchar_t *cmd, array_list_t *out );
00213
00219 void complete_print( string_buffer_t *out );
00220
00224 int complete_is_valid_option( const wchar_t *str,
00225 const wchar_t *opt,
00226 array_list_t *errors );
00227
00232 int complete_is_valid_argument( const wchar_t *str,
00233 const wchar_t *opt,
00234 const wchar_t *arg );
00235
00236
00246 void complete_load( const wchar_t *cmd, int reload );
00247
00256 void completion_allocate( array_list_t *context,
00257 const wchar_t *comp,
00258 const wchar_t *desc,
00259 int flags );
00260
00261
00262 #endif