Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
COMPLETE(3)		   Library Functions Manual		   COMPLETE(3)

NAME
       complete, freecompletion	- file name completion

SYNOPSIS
       #include	<u.h>
       #include	<libc.h>
       #include	<complete.h>

       typedef struct CompletionCompletion;
       struct Completion{
	   uchar advance;
	   uchar complete;
	   char	*string;
	   int nmatch;
	   int nfile;
	   char	**filename;
       };

       Completion* complete(char *dir, char *s);

       void freecompletion(Completion *c);

DESCRIPTION
       The  complete function implements file name completion.	Given a	direc-
       tory dir	and a string s,	it returns an analysis of the  file  names  in
       that  directory	that  begin  with the string s.	 The fields nmatch and
       nfile will be set to the	number of files	 that  match  the  prefix  and
       filename	 will  be  filled in with their	names.	If the file named is a
       directory, a slash character will be appended to	it.

       If no files match the string, nmatch will be zero,  but	complete  will
       return  the full	set of files in	the directory, with nfile set to their
       number.

       The flag	advance	reports	whether	the string s can be  extended  without
       changing	 the  set of files that	match.	If true, string	will be	set to
       the extension; that is, the value of string may be appended to s	by the
       caller to extend	the embryonic file name	unambiguously.

       The flag	complete reports whether the extended file name	uniquely iden-
       tifies a	file.  If true,	string will be suffixed	with  a	 blank,	 or  a
       slash and a blank, depending on whether the resulting file name identi-
       fies a plain file or a directory.

       The freecompletion function frees a Completion structure	and  its  con-
       tents.

       In rio(1) and acme(1), file name	completion is triggered	by a control-F
       character or an Insert character.

SOURCE
       /usr/local/plan9/src/libcomplete

SEE ALSO
       rio(1), acme(1)

DIAGNOSTICS
       The complete function returns a null pointer and	sets errstr if the di-
       rectory is unreadable or	there is some other error.

BUGS
       The  behavior  of  file	name  completion  should  be controlled	by the
       plumber.

								   COMPLETE(3)

NAME | SYNOPSIS | DESCRIPTION | SOURCE | SEE ALSO | DIAGNOSTICS | BUGS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=complete&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help