Revision: 2539 http://geany.svn.sourceforge.net/geany/?rev=2539&view=rev Author: ntrel Date: 2008-04-28 09:15:08 -0700 (Mon, 28 Apr 2008)
Log Message: ----------- Add GEANY_MAX_BUILT_IN_FILETYPES for accessing built_in_filetypes[].
Modified Paths: -------------- branches/custom-filetypes/ChangeLog branches/custom-filetypes/src/filetypes.c branches/custom-filetypes/src/filetypes.h
Modified: branches/custom-filetypes/ChangeLog =================================================================== --- branches/custom-filetypes/ChangeLog 2008-04-28 14:41:09 UTC (rev 2538) +++ branches/custom-filetypes/ChangeLog 2008-04-28 16:15:08 UTC (rev 2539) @@ -6,6 +6,8 @@ Replace filetypes_get_from_uid() with filetypes_lookup_by_name(). Use a hash table for filetypes, but keep the old filetypes array available for now. + * src/filetypes.c, src/filetypes.h: + Add GEANY_MAX_BUILT_IN_FILETYPES for accessing built_in_filetypes[].
2008-04-27 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: branches/custom-filetypes/src/filetypes.c =================================================================== --- branches/custom-filetypes/src/filetypes.c 2008-04-28 14:41:09 UTC (rev 2538) +++ branches/custom-filetypes/src/filetypes.c 2008-04-28 16:15:08 UTC (rev 2539) @@ -42,7 +42,7 @@ GHashTable *filetypes_hash = NULL; /**< Array of filetype pointers */
/* built-in filetypes only */ -filetype *builtin_filetypes[GEANY_MAX_FILE_TYPES] = {NULL}; +filetype *built_in_filetypes[GEANY_MAX_BUILT_IN_FILETYPES] = {NULL};
/* This is the order of unique ids used in the config file. @@ -480,11 +480,11 @@ }
-static void create_builtin_filetypes(void) +static void create_built_in_filetypes(void) { filetype_id ft_id;
- for (ft_id = 0; ft_id < GEANY_MAX_FILE_TYPES; ft_id++) + for (ft_id = 0; ft_id < GEANY_MAX_BUILT_IN_FILETYPES; ft_id++) { filetypes[ft_id] = g_new0(filetype, 1); filetypes[ft_id]->programs = g_new0(struct build_programs, 1); @@ -501,11 +501,11 @@
g_return_if_fail(filetypes_hash == NULL);
- create_builtin_filetypes(); + create_built_in_filetypes();
filetypes_hash = g_hash_table_new(g_str_hash, g_str_equal);
- for (ft_id = 0; ft_id < GEANY_MAX_FILE_TYPES; ft_id++) + for (ft_id = 0; ft_id < GEANY_MAX_BUILT_IN_FILETYPES; ft_id++) { filetypes_add(filetypes[ft_id]); }
Modified: branches/custom-filetypes/src/filetypes.h =================================================================== --- branches/custom-filetypes/src/filetypes.h 2008-04-28 14:41:09 UTC (rev 2538) +++ branches/custom-filetypes/src/filetypes.h 2008-04-28 16:15:08 UTC (rev 2539) @@ -78,7 +78,8 @@ GEANY_FILETYPES_SQL,
GEANY_FILETYPES_ALL, /* must be last filetype, used for 'None' item. */ - GEANY_MAX_FILE_TYPES + GEANY_MAX_BUILT_IN_FILETYPES, + GEANY_MAX_FILE_TYPES = GEANY_MAX_BUILT_IN_FILETYPES } filetype_id;
/* Safe wrapper to get the id field of a possibly NULL filetype pointer. */ @@ -121,8 +122,8 @@ struct build_actions *actions; };
-#define filetypes builtin_filetypes -extern filetype *builtin_filetypes[GEANY_MAX_FILE_TYPES]; +#define filetypes built_in_filetypes +extern filetype *built_in_filetypes[GEANY_MAX_BUILT_IN_FILETYPES];
void filetypes_add(filetype *ft);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.