Files
Copyright 2008, 2012 Neil Edelman, distributed under the terms of the
GNU General Public License, see copying.txt, or
https://opensource.org/licenses/GPL-3.0.
Files is a list of File (private class defiend below,) the Files can have
a relation to other Files by 'parent' and 'favourite' (@(pwd) uses this.)
- minimum standard
- POSIX
- author
- Neil
- version
- 1.1; 2017-03 fixed pedantic warnings; command-line improvements
- since
- 0.6; 2008-03-24
Declarations
struct Files
struct Files
See Files.
typedef int (*FilesFilter)(struct Files *const, const char *)
typedef int (*FilesFilter)(struct Files *const, const char *)
Returns a boolean value.
Function Summary
Return Type | Function Name | Argument List |
struct Files * |
Files |
struct Files *const parent, const FilesFilter filter |
void |
Files_ |
struct Files *files |
int |
FilesAdvance |
struct Files *f |
int |
FilesIsRoot |
const struct Files *f |
void |
FilesSetPath |
struct Files *f |
const char * |
FilesEnumPath |
struct Files *const files |
const char * |
FilesName |
const struct Files *const files |
int |
FilesSize |
const struct Files *files |
int |
FilesIsDir |
const struct Files *files |
Function Detail
Files
struct Files * Files (struct Files *const parent, const FilesFilter filter)
Directory information.
- parameter: parent
- parent->this must be the 'file' (directory) that you want to
create.
- parameter: filter
- This returns true on the files that you want included.
Files_
void Files_ (struct Files *files)
Destructor.
FilesAdvance
int FilesAdvance (struct Files *f)
This is how we access the files sequentially.
FilesIsRoot
int FilesIsRoot (const struct Files *f)
Doesn't have a parent?
FilesSetPath
void FilesSetPath (struct Files *f)
Resets the list of favourites.
FilesEnumPath
const char * FilesEnumPath (struct Files *const files)
- return
- After FilesSetFarourite, this enumerates them.
FilesName
const char * FilesName (const struct Files *const files)
- return
- The file name of the selected file.
FilesSize
int FilesSize (const struct Files *files)
- return
- File size of the selected file.
FilesIsDir
int FilesIsDir (const struct Files *files)
- return
- Whether the file is a directory.