aboutsummaryrefslogtreecommitdiffhomepage
path: root/complete.h
diff options
context:
space:
mode:
authorGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-01-16 22:26:47 +0530
committerGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-01-16 22:26:47 +0530
commit140ead65b6a7051a8737623b7201f5b5a07d55d9 (patch)
treeb93cb8f9936db93ae37030272f6d2c5205097987 /complete.h
parentf3e2d2f68f14120e298fb1d50be89fa5e83c9222 (diff)
Converted all auto completion calls (on pressing tab) to use std::vector<completion_t>, bugs are yet to be fixed
Diffstat (limited to 'complete.h')
-rw-r--r--complete.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/complete.h b/complete.h
index 74c2b5a0..dcd5d902 100644
--- a/complete.h
+++ b/complete.h
@@ -12,10 +12,11 @@
*/
#define FISH_COMPLETE_H
+
#include <wchar.h>
#include "util.h"
-
+#include "common.h"
/**
Use all completions
*/
@@ -101,18 +102,18 @@
-typedef struct
+struct completion_t
{
/**
The completion string
*/
- const wchar_t *completion;
+ wcstring completion;
/**
The description for this completion
*/
- const wchar_t *description;
+ wcstring description;
/**
Flags determining the completion behaviour.
@@ -126,8 +127,11 @@ typedef struct
*/
int flags;
+ bool operator < (const completion_t& rhs) const { return this->completion < rhs.completion; }
+ bool operator == (const completion_t& rhs) const { return this->completion == rhs.completion; }
+ bool operator != (const completion_t& rhs) const { return this->completion != rhs.completion; }
}
- completion_t;
+;
/**
@@ -209,7 +213,9 @@ void complete_remove( const wchar_t *cmd,
Values returned by this function should be freed by the caller.
*/
-void complete( const wchar_t *cmd, array_list_t *out );
+//void complete( const wchar_t *cmd, array_list_t *out );
+
+void complete2( const wchar_t* cmd, std::vector<completion_t> &out);
/**
Print a list of all current completions into the string_buffer_t.
@@ -253,7 +259,7 @@ void complete_load( const wchar_t *cmd, int reload );
\param desc The description of the completion
\param flags completion flags
*/
-void completion_allocate( array_list_t *context,
+void completion_allocate( std::vector<completion_t> &context,
const wchar_t *comp,
const wchar_t *desc,
int flags );