SF.net SVN: geany:[4833] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Sun Apr 18 21:42:38 UTC 2010
Revision: 4833
http://geany.svn.sourceforge.net/geany/?rev=4833&view=rev
Author: eht16
Date: 2010-04-18 21:42:38 +0000 (Sun, 18 Apr 2010)
Log Message:
-----------
Add tm_source_file_set_tag_arglist() to manually set the argument list of a tag.
Modified Paths:
--------------
trunk/ChangeLog
trunk/tagmanager/entry.c
trunk/tagmanager/entry.h
trunk/tagmanager/include/tm_source_file.h
trunk/tagmanager/parse.c
trunk/tagmanager/parse.h
trunk/tagmanager/tm_source_file.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-04-18 21:42:22 UTC (rev 4832)
+++ trunk/ChangeLog 2010-04-18 21:42:38 UTC (rev 4833)
@@ -1,3 +1,12 @@
+2010-04-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+
+ * tagmanager/entry.c, tagmanager/entry.h,
+ tagmanager/include/tm_source_file.h, tagmanager/parse.c,
+ tagmanager/parse.h, tagmanager/tm_source_file.c:
+ Add tm_source_file_set_tag_arglist() to manually set the argument
+ list of a tag.
+
+
2010-04-17 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* tagmanager/txt2tags.c:
Modified: trunk/tagmanager/entry.c
===================================================================
--- trunk/tagmanager/entry.c 2010-04-18 21:42:22 UTC (rev 4832)
+++ trunk/tagmanager/entry.c 2010-04-18 21:42:38 UTC (rev 4833)
@@ -395,6 +395,12 @@
}
}
+extern void setTagArglistByName (const char *tag_name, const char *arglist)
+{
+ if (NULL != TagEntrySetArglistFunction)
+ TagEntrySetArglistFunction(tag_name, arglist);
+}
+
extern void initTagEntry (tagEntryInfo *const e, const char *const name)
{
Assert (File.source.name != NULL);
Modified: trunk/tagmanager/entry.h
===================================================================
--- trunk/tagmanager/entry.h 2010-04-18 21:42:22 UTC (rev 4832)
+++ trunk/tagmanager/entry.h 2010-04-18 21:42:38 UTC (rev 4833)
@@ -95,6 +95,7 @@
extern void beginEtagsFile (void);
extern void endEtagsFile (const char *const name);
extern void makeTagEntry (const tagEntryInfo *const tag);
+extern void setTagArglistByName (const char *tag_name, const char *arglist);
extern void initTagEntry (tagEntryInfo *const e, const char *const name);
#endif /* _ENTRY_H */
Modified: trunk/tagmanager/include/tm_source_file.h
===================================================================
--- trunk/tagmanager/include/tm_source_file.h 2010-04-18 21:42:22 UTC (rev 4832)
+++ trunk/tagmanager/include/tm_source_file.h 2010-04-18 21:42:38 UTC (rev 4833)
@@ -150,6 +150,9 @@
*/
gint tm_source_file_get_named_lang(const gchar *name);
+/* Set the argument list of tag identified by its name */
+void tm_source_file_set_tag_arglist(const char *tag_name, const char *arglist);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/tagmanager/parse.c
===================================================================
--- trunk/tagmanager/parse.c 2010-04-18 21:42:22 UTC (rev 4832)
+++ trunk/tagmanager/parse.c 2010-04-18 21:42:38 UTC (rev 4833)
@@ -32,6 +32,7 @@
parserDefinition** LanguageTable = NULL;
static unsigned int LanguageCount = 0;
tagEntryFunction TagEntryFunction = NULL;
+tagEntrySetArglistFunction TagEntrySetArglistFunction = NULL;
/*
* FUNCTION DEFINITIONS
Modified: trunk/tagmanager/parse.h
===================================================================
--- trunk/tagmanager/parse.h 2010-04-18 21:42:22 UTC (rev 4832)
+++ trunk/tagmanager/parse.h 2010-04-18 21:42:38 UTC (rev 4833)
@@ -37,6 +37,7 @@
typedef boolean (*rescanParser) (const unsigned int passCount);
typedef void (*parserInitialize) (langType language);
typedef int (*tagEntryFunction) (const tagEntryInfo *const tag);
+typedef void (*tagEntrySetArglistFunction) (const char *tag_name, const char *arglist);
typedef struct sKindOption {
boolean enabled; /* are tags for kind enabled? */
@@ -128,6 +129,7 @@
/* Extra stuff for Tag Manager */
extern tagEntryFunction TagEntryFunction;
+extern tagEntrySetArglistFunction TagEntrySetArglistFunction;
extern void setTagEntryFunction(tagEntryFunction entry_function);
#endif /* _PARSE_H */
Modified: trunk/tagmanager/tm_source_file.c
===================================================================
--- trunk/tagmanager/tm_source_file.c 2010-04-18 21:42:22 UTC (rev 4832)
+++ trunk/tagmanager/tm_source_file.c 2010-04-18 21:42:38 UTC (rev 4833)
@@ -55,6 +55,8 @@
installLanguageMapDefaults();
if (NULL == TagEntryFunction)
TagEntryFunction = tm_source_file_tags;
+ if (NULL == TagEntrySetArglistFunction)
+ TagEntrySetArglistFunction = tm_source_file_set_tag_arglist;
}
if (name == NULL)
@@ -120,6 +122,8 @@
installLanguageMapDefaults();
if (NULL == TagEntryFunction)
TagEntryFunction = tm_source_file_tags;
+ if (NULL == TagEntrySetArglistFunction)
+ TagEntrySetArglistFunction = tm_source_file_set_tag_arglist;
}
current_source_file = source_file;
@@ -178,6 +182,8 @@
installLanguageMapDefaults();
if (NULL == TagEntryFunction)
TagEntryFunction = tm_source_file_tags;
+ if (NULL == TagEntrySetArglistFunction)
+ TagEntrySetArglistFunction = tm_source_file_set_tag_arglist;
}
current_source_file = source_file;
if (LANG_AUTO == source_file->lang)
@@ -225,6 +231,28 @@
return status;
}
+void tm_source_file_set_tag_arglist(const char *tag_name, const char *arglist)
+{
+ int count;
+ TMTag **tags, *tag;
+
+ if (NULL == arglist ||
+ NULL == tag_name ||
+ NULL == current_source_file ||
+ NULL == current_source_file->work_object.tags_array)
+ {
+ return;
+ }
+
+ tags = tm_tags_find(current_source_file->work_object.tags_array, tag_name, FALSE, &count);
+ if (tags != NULL && count == 1)
+ {
+ tag = tags[0];
+ g_free(tag->atts.entry.arglist);
+ tag->atts.entry.arglist = g_strdup(arglist);
+ }
+}
+
int tm_source_file_tags(const tagEntryInfo *tag)
{
if (NULL == current_source_file)
@@ -319,6 +347,8 @@
installLanguageMapDefaults();
if (NULL == TagEntryFunction)
TagEntryFunction = tm_source_file_tags;
+ if (NULL == TagEntrySetArglistFunction)
+ TagEntrySetArglistFunction = tm_source_file_set_tag_arglist;
}
return getLanguageName(lang);
}
@@ -331,6 +361,8 @@
installLanguageMapDefaults();
if (NULL == TagEntryFunction)
TagEntryFunction = tm_source_file_tags;
+ if (NULL == TagEntrySetArglistFunction)
+ TagEntrySetArglistFunction = tm_source_file_set_tag_arglist;
}
return getNamedLanguage(name);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list