24 декабря Архивач восстановлен после серьёзной аварии. К сожалению, значительная часть сохранённых изображений и видео была потеряна. Подробности случившегося. Мы призываем всех неравнодушных помочь нам с восстановлением утраченного контента!
char command_generator (text, state) const char text; int state; { static int list&
char command_generator (text, state) const char text; int state; { static int list_index, len; char name;
/ If this is a new word to complete, initialize now. This includes saving the length of TEXT for efficiency, and initializing the index variable to 0. / if (!state) { list_index = 0; len = strlen (text); }
/ Return the next name which partially matches from the command list. / while (name = commands[list_index].name) { list_index++;
if (strncmp (name, text, len) == 0) return (dupstr(name)); }
/ If no names matched, then return NULL. / return ((char )NULL); }
command_generator (text, state)
const char text;
int state;
{
static int list_index, len;
char name;
/ If this is a new word to complete, initialize now. This includes
saving the length of TEXT for efficiency, and initializing the index
variable to 0. /
if (!state)
{
list_index = 0;
len = strlen (text);
}
/ Return the next name which partially matches from the command list. /
while (name = commands[list_index].name)
{
list_index++;
if (strncmp (name, text, len) == 0)
return (dupstr(name));
}
/ If no names matched, then return NULL. /
return ((char )NULL);
}