From 3489b63b7d84a5a353c2d26a691f895fae4135a3 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 27 Apr 2007 10:58:41 +0000 Subject: [PATCH] Add tm_source_file_get_lang_name() as a wrapper for getLanguageName() in parse.c. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1479 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- tagmanager/include/tm_source_file.h | 6 ++++++ tagmanager/tm_source_file.c | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/tagmanager/include/tm_source_file.h b/tagmanager/include/tm_source_file.h index bff02e30..64c36b2a 100644 --- a/tagmanager/include/tm_source_file.h +++ b/tagmanager/include/tm_source_file.h @@ -123,6 +123,12 @@ gboolean tm_source_file_write(TMWorkObject *source_file, FILE *fp, guint attrs); */ extern guint source_file_class_id; +/*! Gets the name associated with the language index. + \param lang The language index. + \return The language name, or NULL. +*/ +const gchar *tm_source_file_get_lang_name(gint lang); + #ifdef __cplusplus } #endif diff --git a/tagmanager/tm_source_file.c b/tagmanager/tm_source_file.c index e48efceb..10d8688d 100644 --- a/tagmanager/tm_source_file.c +++ b/tagmanager/tm_source_file.c @@ -200,3 +200,16 @@ gboolean tm_source_file_write(TMWorkObject *source_file, FILE *fp, guint attrs) } return TRUE; } + +const gchar *tm_source_file_get_lang_name(gint lang) +{ + if (NULL == LanguageTable) + { + initializeParsing(); + installLanguageMapDefaults(); + if (NULL == TagEntryFunction) + TagEntryFunction = tm_source_file_tags; + } + return getLanguageName(lang); +} +