Geany
0.20
|
Filetype detection, file extensions and filetype menu items. More...
Data Structures | |
struct | GeanyFiletype |
Represents a filetype. More... | |
Defines | |
#define | filetypes ((GeanyFiletype **)GEANY(filetypes_array)->pdata) |
Wraps filetypes_array so it can be used with C array syntax. | |
Functions | |
GeanyFiletype * | filetypes_detect_from_file (const gchar *utf8_filename) |
Detects filetype based on a shebang line in the file or the filename extension. | |
const gchar * | filetypes_get_display_name (GeanyFiletype *ft) |
Gets ft->name or a translation for filetype None. | |
GeanyFiletype * | filetypes_index (gint idx) |
Accessor function for GeanyData::filetypes_array items. | |
GeanyFiletype * | filetypes_lookup_by_name (const gchar *name) |
Finds a filetype pointer from its name field. | |
Variables | |
GSList * | filetypes_by_title |
List of filetype pointers sorted by name, but with filetypes_index(GEANY_FILETYPES_NONE) first, as this is usually treated specially. |
Filetype detection, file extensions and filetype menu items.
#define filetypes ((GeanyFiletype **)GEANY(filetypes_array)->pdata) |
Wraps filetypes_array so it can be used with C array syntax.
Example: filetypes[GEANY_FILETYPES_C]->name = ...;
GeanyFiletype* filetypes_detect_from_file | ( | const gchar * | utf8_filename | ) |
Detects filetype based on a shebang line in the file or the filename extension.
utf8_filename | The filename in UTF-8 encoding. |
filetypes
[GEANY_FILETYPES_NONE] if it could not be detected. const gchar* filetypes_get_display_name | ( | GeanyFiletype * | ft | ) |
Gets ft->name
or a translation for filetype None.
ft | . |
GeanyFiletype* filetypes_index | ( | gint | idx | ) |
Accessor function for GeanyData::filetypes_array items.
Example:
ft = filetypes_index(GEANY_FILETYPES_C);
idx | filetypes_array index. |
NULL
if idx is out of range.GeanyFiletype* filetypes_lookup_by_name | ( | const gchar * | name | ) |
Finds a filetype pointer from its name field.
name | Filetype name. |
NULL
.GSList* filetypes_by_title |
List of filetype pointers sorted by name, but with filetypes_index(GEANY_FILETYPES_NONE)
first, as this is usually treated specially.
The list does not change (after filetypes have been initialized), so you can use
g_slist_nth_data(filetypes_by_title, n)
and expect the same result at different times.