aboutsummaryrefslogtreecommitdiffhomepage
path: root/complete.h
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-02-19 09:25:20 +1000
committerGravatar axel <axel@liljencrantz.se>2007-02-19 09:25:20 +1000
commit6859e012d9c6c2743f8cd300466c0f861e14025c (patch)
treecb13c22c03ec5a5297a685cc6053984536903e1b /complete.h
parent680cf175708ddc38d6c8975a3595a1bb551185dd (diff)
Fourth phase of using a real struct for passing around completions - make expand_string return a completion_t struct. Also make the reader sort and remove duplicates again
darcs-hash:20070218232520-ac50b-e23339ec5bba673681eced110e1b0b344eb5d976.gz
Diffstat (limited to 'complete.h')
-rw-r--r--complete.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/complete.h b/complete.h
index 181e54b5..74a4d8b2 100644
--- a/complete.h
+++ b/complete.h
@@ -86,20 +86,29 @@
typedef struct
{
+
/**
The completion string
*/
const wchar_t *completion;
+
/**
The description for this completion
*/
const wchar_t *description;
+
/**
- Determines whether a spece should be inserted after this
- compeltion if it is the only possible completion. Can be one of
- COMPLETE_SPACE_YES, COMPLETE_SPACE_NO and COMPLETE_SPACE_AUTO.
+ Flags determining the completion behaviour.
+
+ Determines whether a space should be inserted after this
+ compeltion if it is the only possible completion using the
+ COMPLETE_NO_SPACE flag.
+
+ The COMPLETE_NO_CASE can be used to signal that this completion
+ is case insensitive.
*/
int flags;
+
}
completion_t;
@@ -227,4 +236,29 @@ int complete_is_valid_argument( const wchar_t *str,
*/
void complete_load( const wchar_t *cmd, int reload );
+/**
+ Create a new completion entry
+
+ \param context The halloc context to use for allocating new memory
+ \pram comp The completion string
+ \param desc The description of the completion
+ \param flags completion flags
+*/
+void completion_allocate( array_list_t *context,
+ const wchar_t *comp,
+ const wchar_t *desc,
+ int flags );
+
+
+/**
+ Create a new completion entry from an existing text entry
+
+ \param context The halloc context to use for allocating new memory
+ \param comp the completion and possibly the description for it
+ \param sep the separator character between completion and description
+*/
+void completion_allocate2( array_list_t *context,
+ wchar_t *comp,
+ wchar_t sep );
+
#endif