GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
COMPLETE(3) FreeBSD Library Functions Manual COMPLETE(3)

complete, freecompletion - file name completion

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

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

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

void freecompletion(Completion *c);

The complete function implements file name completion. Given a directory 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 identifies a file. If true, string will be suffixed with a blank, or a slash and a blank, depending on whether the resulting file name identifies a plain file or a directory.

The freecompletion function frees a Completion structure and its contents.

In and file name completion is triggered by a control-F character or an Insert character.

/src/libcomplete

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

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

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.