X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Ftabcomplete.c;h=870188aa5e36f7fcbc1e705d17cf3df5b97ec88a;hp=cbfd14eeef7cd035e551dd5ce56fc7bb355a9595;hb=248491b25960ff7c08860dd0065f7e04cc550e90;hpb=60f5103f542e3f6dd2e22b6df7015f7bc4b3a937 diff --git a/client/tabcomplete.c b/client/tabcomplete.c index cbfd14e..870188a 100644 --- a/client/tabcomplete.c +++ b/client/tabcomplete.c @@ -1,8 +1,8 @@ /* - * Copyright (C) 1995-2005, Index Data ApS + * Copyright (C) 1995-2006, Index Data ApS * See the file LICENSE for details. * - * $Id: tabcomplete.c,v 1.13 2006-05-07 19:37:23 adam Exp $ + * $Id: tabcomplete.c,v 1.15 2006-05-07 19:43:00 adam Exp $ */ #include @@ -12,8 +12,7 @@ #include #include "tabcomplete.h" -#if HAVE_READLINE_READLINE_H -extern char** curret_global_list; +extern char** current_global_list; /* *************************************************************************** * @@ -23,6 +22,7 @@ extern char** curret_global_list; char* complete_from_list(char* completions[], const char *text, int state) { +#if HAVE_READLINE_READLINE_H static int idx; if(!completions) return NULL; @@ -41,6 +41,7 @@ char* complete_from_list(char* completions[], const char *text, int state) return (char*)strdup(completions[idx-1]); }; }; +#endif return NULL; } @@ -79,7 +80,8 @@ void oid_loader(struct oident* oid, void* data_) } } -char** build_list_for_oclass(oid_class oclass) { +char** build_list_for_oclass(oid_class oclass) +{ oid_callback_t data; data.values = (char **) calloc(10,sizeof(char*)); data.index = 0; @@ -122,8 +124,8 @@ char* complete_format(const char* text, int state) char* complete_schema(const char* text, int state) { - char** list=build_list_for_oclass(CLASS_SCHEMA); - char* res=complete_from_list(list,text,state); + char** list = build_list_for_oclass(CLASS_SCHEMA); + char* res = complete_from_list(list,text,state); free(list); return res; @@ -132,8 +134,8 @@ char* complete_schema(const char* text, int state) char* complete_attributeset(const char* text, int state) { - char** list=build_list_for_oclass(CLASS_ATTSET); - char* res=complete_from_list(list,text,state); + char** list = build_list_for_oclass(CLASS_ATTSET); + char* res = complete_from_list(list,text,state); free(list); return res; @@ -142,9 +144,8 @@ char* complete_attributeset(const char* text, int state) char* default_completer(const char* text, int state) { - return complete_from_list(curret_global_list,text,state); + return complete_from_list(current_global_list, text, state); } -#endif /* * Local variables: