[geany/geany] b512aa: Remove unused tm_project and all its references in docstrings

Jiří Techet git-noreply at xxxxx
Sun Oct 5 20:40:15 UTC 2014


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Sun, 05 Oct 2014 20:40:15 UTC
Commit:      b512aa0368b3431852e11a9ba93f5b9fdb5353f8
             https://github.com/geany/geany/commit/b512aa0368b3431852e11a9ba93f5b9fdb5353f8

Log Message:
-----------
Remove unused tm_project and all its references in docstrings


Modified Paths:
--------------
    tagmanager/src/Makefile.am
    tagmanager/src/tm_project.c
    tagmanager/src/tm_project.h
    tagmanager/src/tm_source_file.c
    tagmanager/src/tm_source_file.h
    tagmanager/src/tm_tagmanager.h
    tagmanager/src/tm_work_object.c
    tagmanager/src/tm_work_object.h
    tagmanager/src/tm_workspace.c
    tagmanager/src/tm_workspace.h
    wscript

Modified: tagmanager/src/Makefile.am
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -15,7 +15,6 @@ tagmanager_includedir = $(includedir)/geany/tagmanager
 tagmanager_include_HEADERS = \
 	tm_file_entry.h \
 	tm_parser.h \
-	tm_project.h \
 	tm_source_file.h \
 	tm_symbol.h \
 	tm_tag.h \
@@ -26,7 +25,6 @@ tagmanager_include_HEADERS = \
 
 libtagmanager_a_SOURCES =\
 	tm_file_entry.c \
-	tm_project.c \
 	tm_source_file.c \
 	tm_symbol.c \
 	tm_tag.c \


Modified: tagmanager/src/tm_project.c
568 lines changed, 0 insertions(+), 568 deletions(-)
===================================================================
@@ -1,568 +0,0 @@
-/*
-*
-*   Copyright (c) 2001-2002, Biswapesh Chattopadhyay
-*
-*   This source code is released for free distribution under the terms of the
-*   GNU General Public License.
-*
-*/
-#include "general.h"
-
-#include <stdio.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#ifdef HAVE_FNMATCH_H
-# include <fnmatch.h>
-#endif
-#include <glib/gstdio.h>
-
-
-#include "options.h"
-#define LIBCTAGS_DEFINED
-#include "tm_tag.h"
-#include "tm_workspace.h"
-#include "tm_source_file.h"
-#include "tm_file_entry.h"
-#include "tm_project.h"
-
-#define TM_FILE_NAME ".tm_project.cache"
-
-static const char *s_sources[] = { "*.c", "*.pc" /* C/Pro*C files */
-	, "*.C", "*.cpp", "*.cc", "*.cxx", "*.c++" /* C++ files */
-	, "*.h", "*.hh", "*.hpp", "*.H", "*.h++", "*.i" /* Header files */
-	, "*.oaf", "*.gob", "*.idl" /* CORBA/Bonobo files */
-	, "*.l", "*.y" /* Lex/Yacc files */
-#if 0
-	, "*.ui", "*.moc" /* KDE/QT Files */
-	, "*.glade" /* UI files */
-#endif
-	, "*.java", "*.pl", "*.pm", "*.py", "*.sh" /* Other languages */
-	, NULL /* Must terminate with NULL */
-};
-
-static const char *s_ignore[] = { "CVS", "intl", "po", NULL };
-
-static GList *glist_from_array(const char **arr)
-{
-	GList *l = NULL;
-	int i;
-	for (i =0; arr[i]; ++ i)
-		l = g_list_prepend(l, (gpointer) arr[i]);
-	return g_list_reverse(l);
-}
-
-guint project_class_id = 0;
-
-gboolean tm_project_init(TMProject *project, const char *dir
-  , const char **sources, const char **ignore, gboolean force)
-{
-	struct stat s;
-	char *path;
-
-	g_return_val_if_fail((project && dir), FALSE);
-#ifdef TM_DEBUG
-	g_message("Initializing project %s", dir);
-#endif
-	if (0 == project_class_id)
-	{
-		project_class_id = tm_work_object_register(tm_project_free, tm_project_update
-		  , tm_project_find_file);
-	}
-
-	if ((0 != g_stat(dir, &s)) || (!S_ISDIR(s.st_mode)))
-	{
-		g_warning("%s: Not a valid directory", dir);
-		return FALSE;
-	}
-	project->dir = tm_get_real_path(dir);
-	if (sources)
-		project->sources = sources;
-	else
-		project->sources = s_sources;
-	if (ignore)
-		project->ignore = ignore;
-	else
-		project->ignore = s_ignore;
-	project->file_list = NULL;
-	path = g_strdup_printf("%s/%s", project->dir, TM_FILE_NAME);
-	if ((0 != g_stat(path, &s)) || (0 == s.st_size))
-		force = TRUE;
-	if (FALSE == tm_work_object_init(&(project->work_object),
-		  project_class_id, path, force))
-	{
-		g_warning("Unable to init project file %s", path);
-		g_free(project->dir);
-		g_free(path);
-		return FALSE;
-	}
-	if (! tm_workspace_add_object(TM_WORK_OBJECT(project)))
-	{
-		g_warning("Unable to init project file %s", path);
-		g_free(project->dir);
-		g_free(path);
-		return FALSE;
-	}
-	g_free(path);
-	tm_project_open(project, force);
-	if (!project->file_list || (0 == project->file_list->len))
-		tm_project_autoscan(project);
-#ifdef TM_DEBUG
-	tm_workspace_dump();
-#endif
-	return TRUE;
-}
-
-TMWorkObject *tm_project_new(const char *dir, const char **sources
-  , const char **ignore, gboolean force)
-{
-	TMProject *project = g_new(TMProject, 1);
-	if (FALSE == tm_project_init(project, dir, sources, ignore, force))
-	{
-		g_free(project);
-		return NULL;
-	}
-	return (TMWorkObject *) project;
-}
-
-void tm_project_destroy(TMProject *project)
-{
-	g_return_if_fail (project != NULL);
-#ifdef TM_DEBUG
-	g_message("Destroying project: %s", project->work_object.file_name);
-#endif
-
-	if (project->file_list)
-	{
-		guint i;
-		for (i = 0; i < project->file_list->len; ++i)
-			tm_source_file_free(project->file_list->pdata[i]);
-		g_ptr_array_free(project->file_list, TRUE);
-	}
-	tm_workspace_remove_object(TM_WORK_OBJECT(project), FALSE, TRUE);
-	g_free(project->dir);
-	tm_work_object_destroy(&(project->work_object));
-}
-
-void tm_project_free(gpointer project)
-{
-	if (NULL != project)
-	{
-		tm_project_destroy(TM_PROJECT(project));
-		g_free(project);
-	}
-}
-
-gboolean tm_project_add_file(TMProject *project, const char *file_name
-  ,gboolean update)
-{
-	TMWorkObject *source_file;
-	const TMWorkObject *workspace = TM_WORK_OBJECT(tm_get_workspace());
-	char *path;
-	gboolean exists = FALSE;
-
-	g_return_val_if_fail((project && file_name), FALSE);
-	path = tm_get_real_path(file_name);
-#ifdef TM_DEBUG
-	g_message("Adding %s to project", path);
-#endif
-	/* Check if the file is already loaded in the workspace */
-	source_file = tm_workspace_find_object(TM_WORK_OBJECT(workspace), path, FALSE);
-	if (NULL != source_file)
-	{
-		if ((workspace == source_file->parent) || (NULL == source_file->parent))
-		{
-#ifdef TM_DEBUG
-			g_message("%s moved from workspace to project", path);
-#endif
-			tm_workspace_remove_object(source_file, FALSE, TRUE);
-		}
-		else if (TM_WORK_OBJECT(project) == source_file->parent)
-				{
-#ifdef TM_DEBUG
-			g_message("%s already exists in project", path);
-#endif
-			exists = TRUE;
-				}
-		else
-		{
-			g_warning("Source file %s is shared among projects - will be duplicated!", path);
-			source_file = NULL;
-			}
-		}
-	if (NULL == source_file)
-	{
-	if (NULL == (source_file = tm_source_file_new(file_name, TRUE, NULL)))
-	{
-		g_warning("Unable to create source file for file %s", file_name);
-		g_free(path);
-		return FALSE;
-	}
-	}
-	source_file->parent = TM_WORK_OBJECT(project);
-	if (NULL == project->file_list)
-		project->file_list = g_ptr_array_new();
-	if (!exists)
-	g_ptr_array_add(project->file_list, source_file);
-	TM_SOURCE_FILE(source_file)->inactive = FALSE;
-	if (update)
-		tm_project_update(TM_WORK_OBJECT(project), TRUE, FALSE, TRUE);
-	g_free(path);
-	return TRUE;
-}
-
-TMWorkObject *tm_project_find_file(TMWorkObject *work_object
-  , const char *file_name, gboolean name_only)
-{
-	TMProject *project;
-
-	g_return_val_if_fail(work_object && file_name, NULL);
-	if (!IS_TM_PROJECT(work_object))
-	{
-		g_warning("Non project pointer passed to tm_project_find_file(%s)", file_name);
-		return NULL;
-	}
-	project = TM_PROJECT(work_object);
-	if ((NULL == project->file_list) || (0 == project->file_list->len))
-		return NULL;
-	else
-	{
-		guint i;
-		char *name, *name1;
-		if (name_only)
-		{
-			name = strrchr(file_name, '/');
-			if (name)
-				name = g_strdup(name + 1);
-			else
-				name = g_strdup(file_name);
-		}
-		else
-			name = tm_get_real_path(file_name);
-		for (i=0; i < project->file_list->len; ++i)
-		{
-			if (name_only)
-				name1 = TM_WORK_OBJECT(project->file_list->pdata[i])->short_name;
-			else
-				name1 = TM_WORK_OBJECT(project->file_list->pdata[i])->file_name;
-			if (0 == strcmp(name, name1))
-			{
-				g_free(name);
-				return TM_WORK_OBJECT(project->file_list->pdata[i]);
-			}
-		}
-		g_free(name);
-	}
-	return NULL;
-}
-
-gboolean tm_project_remove_object(TMProject *project, TMWorkObject *w)
-{
-	guint i;
-
-	g_return_val_if_fail((project && w), FALSE);
-	if (!project->file_list)
-		return FALSE;
-	for (i=0; i < project->file_list->len; ++i)
-	{
-		if (w == project->file_list->pdata[i])
-		{
-			tm_work_object_free(w);
-			g_ptr_array_remove_index(project->file_list, i);
-			tm_project_update(TM_WORK_OBJECT(project), TRUE, FALSE, TRUE);
-			return TRUE;
-		}
-	}
-	return FALSE;
-}
-
-void tm_project_recreate_tags_array(TMProject *project)
-{
-	guint i, j;
-	TMWorkObject *source_file;
-
-	g_return_if_fail(project);
-#ifdef TM_DEBUG
-	g_message("Recreating tags for project: %s", project->work_object.file_name);
-#endif
-
-	if (NULL != project->work_object.tags_array)
-		g_ptr_array_set_size(project->work_object.tags_array, 0);
-	else
-		project->work_object.tags_array = g_ptr_array_new();
-
-	if (!project->file_list)
-		return;
-	for (i=0; i < project->file_list->len; ++i)
-	{
-		source_file = TM_WORK_OBJECT(project->file_list->pdata[i]);
-		if ((NULL != source_file) && !(TM_SOURCE_FILE(source_file)->inactive) &&
-		  (NULL != source_file->tags_array) && (source_file->tags_array->len > 0))
-		{
-			for (j = 0; j < source_file->tags_array->len; ++j)
-			{
-				g_ptr_array_add(project->work_object.tags_array,
-					  source_file->tags_array->pdata[j]);
-			}
-		}
-	}
-	tm_tags_sort(project->work_object.tags_array, NULL, FALSE);
-}
-
-gboolean tm_project_update(TMWorkObject *work_object, gboolean force
-  , gboolean recurse, gboolean update_parent)
-{
-	TMProject *project;
-	guint i;
-	gboolean update_tags = force;
-
-	if (!work_object || !IS_TM_PROJECT(work_object))
-	{
-		g_warning("Non project pointer passed to project update");
-		return FALSE;
-	}
-
-#ifdef TM_DEBUG
-	g_message("Updating project: %s", work_object->file_name);
-#endif
-
-	project = TM_PROJECT(work_object);
-	if ((NULL != project->file_list) && (project->file_list->len > 0))
-	{
-		if (recurse)
-		{
-			for (i=0; i < project->file_list->len; ++i)
-			{
-				if (TRUE == tm_source_file_update(TM_WORK_OBJECT(
-					  project->file_list->pdata[i]), FALSE, FALSE, FALSE))
-					update_tags = TRUE;
-			}
-		}
-		if (update_tags || (TM_WORK_OBJECT (project)->tags_array == NULL))
-		{
-#ifdef TM_DEBUG
-			g_message ("Tags updated, recreating tags array");
-#endif
-			tm_project_recreate_tags_array(project);
-		}
-	}
-	/* work_object->analyze_time = time(NULL); */
-	if ((work_object->parent) && (update_parent))
-		tm_workspace_update(work_object->parent, TRUE, FALSE, FALSE);
-	return update_tags;
-}
-
-
-#define IGNORE_FILE ".tm_ignore"
-static void tm_project_set_ignorelist(TMProject *project)
-{
-	struct stat s;
-	char *ignore_file = g_strconcat(project->dir, "/", IGNORE_FILE, NULL);
-	if (0 == g_stat(ignore_file, &s))
-	{
-		if (NULL != Option.ignore)
-			stringListClear(Option.ignore);
-		addIgnoreListFromFile(ignore_file);
-	}
-	g_free(ignore_file);
-}
-
-gboolean tm_project_open(TMProject *project, gboolean force)
-{
-	FILE *fp;
-	TMSourceFile *source_file = NULL;
-	TMTag *tag;
-
-	if (!project || !IS_TM_PROJECT(TM_WORK_OBJECT(project)))
-		return FALSE;
-#ifdef TM_DEBUG
-	g_message("Opening project %s", project->work_object.file_name);
-#endif
-	tm_project_set_ignorelist(project);
-	if (NULL == (fp = g_fopen(project->work_object.file_name, "r")))
-		return FALSE;
-	while (NULL != (tag = tm_tag_new_from_file(source_file, fp, 0, FALSE)))
-	{
-		if (tm_tag_file_t == tag->type)
-		{
-			if (!(source_file = TM_SOURCE_FILE(
-			  tm_source_file_new(tag->name, FALSE, NULL))))
-			{
-#ifdef TM_DEBUG
-				g_warning("Unable to create source file %s", tag->name);
-#endif
-				if (!force)
-				{
-					tm_tag_unref(tag);
-					fclose(fp);
-					return FALSE;
-				}
-				else
-					source_file = NULL;
-			}
-			else
-			{
-				source_file->work_object.parent = TM_WORK_OBJECT(project);
-				source_file->lang = tag->atts.file.lang;
-				source_file->inactive = tag->atts.file.inactive;
-				if (!project->file_list)
-					project->file_list = g_ptr_array_new();
-				g_ptr_array_add(project->file_list, source_file);
-			}
-			tm_tag_unref(tag);
-		}
-		else
-		{
-			if ((NULL == source_file) || (source_file->inactive)) /* Dangling tag */
-			{
-#ifdef TM_DEBUG
-				g_warning("Dangling tag %s", tag->name);
-#endif
-				tm_tag_unref(tag);
-				if (!force)
-				{
-					fclose(fp);
-					return FALSE;
-				}
-			}
-			else
-			{
-				if (NULL == source_file->work_object.tags_array)
-					source_file->work_object.tags_array = g_ptr_array_new();
-				g_ptr_array_add(source_file->work_object.tags_array, tag);
-#ifdef TM_DEBUG
-				g_message ("Added tag %s", tag->name);
-#endif
-			}
-		}
-	}
-	fclose(fp);
-	tm_project_update((TMWorkObject *) project, FALSE, TRUE, TRUE);
-	return TRUE;
-}
-
-gboolean tm_project_save(TMProject *project)
-{
-	guint i;
-	FILE *fp;
-
-	if (!project)
-		return FALSE;
-	if (NULL == (fp = g_fopen(project->work_object.file_name, "w")))
-	{
-		g_warning("Unable to save project %s", project->work_object.file_name);
-		return FALSE;
-	}
-	if (project->file_list)
-	{
-		for (i=0; i < project->file_list->len; ++i)
-		{
-			if (FALSE == tm_source_file_write(TM_WORK_OBJECT(project->file_list->pdata[i])
-				, fp, tm_tag_attr_max_t))
-			{
-				fclose(fp);
-				return FALSE;
-			}
-		}
-	}
-	fclose(fp);
-	return TRUE;
-}
-
-static void tm_project_add_file_recursive(TMFileEntry *entry
-  , gpointer user_data, guint UNUSED level)
-{
-	TMProject *project;
-	if (!user_data || !entry || (tm_file_dir_t == entry->type))
-		return;
-	project = TM_PROJECT(user_data);
-	tm_project_add_file(project, entry->path, FALSE);
-}
-
-gboolean tm_project_autoscan(TMProject *project)
-{
-	TMFileEntry *root_dir;
-	GList *file_match;
-	GList *dir_unmatch;
-
-	file_match = glist_from_array(project->sources);
-	dir_unmatch = glist_from_array(project->ignore);
-
-	if (!project || !IS_TM_PROJECT(TM_WORK_OBJECT(project))
-	  || (!project->dir))
-		return FALSE;
-	if (!(root_dir = tm_file_entry_new(project->dir, NULL, TRUE
-		, file_match, NULL, NULL, dir_unmatch, TRUE, TRUE)))
-	{
-		g_warning("Unable to create file entry");
-		return FALSE;
-	}
-	g_list_free(file_match);
-	g_list_free(dir_unmatch);
-	tm_file_entry_foreach(root_dir, tm_project_add_file_recursive
-	  , project, 0, FALSE);
-	tm_file_entry_free(root_dir);
-	tm_project_update(TM_WORK_OBJECT(project), TRUE, FALSE, TRUE);
-	return TRUE;
-}
-
-gboolean tm_project_sync(TMProject *project, GList *files)
-{
-	GList *tmp;
-	guint i;
-
-	if (project->file_list)
-	{
-		for (i = 0; i < project->file_list->len; ++i)
-			tm_source_file_free(project->file_list->pdata[i]);
-		g_ptr_array_free(project->file_list, TRUE);
-		project->file_list = NULL;
-		if (project->work_object.tags_array)
-		{
-			g_ptr_array_free(project->work_object.tags_array, TRUE);
-			project->work_object.tags_array = NULL;
-		}
-	}
-	for (tmp = files; tmp; tmp = g_list_next(tmp))
-	{
-		tm_project_add_file(project, (const char *) tmp->data, FALSE);
-	}
-	tm_project_update(TM_WORK_OBJECT(project), TRUE, FALSE, TRUE);
-	return TRUE;
-}
-
-void tm_project_dump(const TMProject *p)
-{
-	if (p)
-	{
-		tm_work_object_dump(TM_WORK_OBJECT(p));
-		if (p->file_list)
-		{
-			guint i;
-			for (i=0; i < p->file_list->len; ++i)
-			{
-				fprintf(stderr, "->\t");
-				tm_work_object_dump(TM_WORK_OBJECT(p->file_list->pdata[i]));
-			}
-		}
-		fprintf(stderr, "-------------------------\n");
-	}
-}
-
-gboolean tm_project_is_source_file(TMProject *project, const char *file_name)
-{
-	const char **pr_extn;
-
-	if (!(project && IS_TM_PROJECT(TM_WORK_OBJECT(project))
-	  && file_name && project->sources))
-		return FALSE;
-	for (pr_extn = project->sources; pr_extn && *pr_extn; ++ pr_extn)
-	{
-		if (0 == fnmatch(*pr_extn, file_name, 0))
-			return TRUE;
-	}
-	return FALSE;
-}


Modified: tagmanager/src/tm_project.h
207 lines changed, 0 insertions(+), 207 deletions(-)
===================================================================
@@ -1,207 +0,0 @@
-/*
-*
-*   Copyright (c) 2001-2002, Biswapesh Chattopadhyay
-*
-*   This source code is released for free distribution under the terms of the
-*   GNU General Public License.
-*
-*/
-
-#ifndef TM_PROJECT_H
-#define TM_PROJECT_H
-
-#include <glib.h>
-#include "tm_work_object.h"
-
-
-/*! \file
- The TMProject structure and associated functions can be used to group together
- related source files in a "project". The update, open and save functions take
- care of automatically updating the project database whenever one or more
- files are changed. The following example demonstrates the use of TMProject.
-
- \include tm_project_test.c
-*/
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/*! Casts a pointer to a pointer to a TMProject structure */
-#define TM_PROJECT(work_object) ((TMProject *) (work_object))
-
-/*! Checks whether the object is a TMProject */
-#define IS_TM_PROJECT(work_object) ((work_object)->type == project_class_id)
-
-/*!
- This example demonstrates the use of TMProject and associated functions
- for managing tags for a group of related source files.
-
- \example tm_project_test.c
-*/
-
-/*!
- The TMProject structure is derived from TMWorkObject and contains all it's
- attributes, plus a project name and a list of source files constituting the project.
-*/
-typedef struct _TMProject
-{
-	TMWorkObject work_object; /*!< The parent work object */
-	char *dir; /*!< Top project directory */
-	const char **sources; /*!< Extensions for source files (wildcards, NULL terminated) */
-	const char **ignore; /*!< File patters to ignore */
-	GPtrArray *file_list; /*!< Array of TMSourceFile present in the project */
-} TMProject;
-
-/*! Initializes a TMProject structure from specified parameters
- \param project The TMProject structure to initialize.
- \param dir The top level directory of the project.
- \param sources The source files you are interested in (as wildcards).
- \param ignore The files you are not interested in (as wildcards).
- \param force Ignore cache (do full-scan of project directory)
- */
-gboolean tm_project_init(TMProject *project, const char *dir
-  , const char **sources, const char **ignore, gboolean force);
-
-/*! Initializes a TMProject structure with the given parameters and
- returns a pointer to it. The function looks for a file called 'tm.tags'
- inside the top level directory to load the project. If such a file is not
- found, it assumes autoscan mode and imports all source files
- by recursively scanning the directory for Makefile.am and importing them.
- If top Makefile.am is missing as well, it simply imports all source files.
- \param dir The top level directory for the project.
- \param sources The list of source extensions. This should be a NULL terminated
- list of wildcards for the source types that you want to get displayed
- in the source tree. If the default list is acceptable, use NULL.
- \param ignore A NULL terminated list of wildcards for files to ignore
- \param force Ignore cache if present (treat as new project)
- \sa tm_project_init() , tm_project_autoscan()
-*/
-TMWorkObject *tm_project_new(const char *dir, const char **sources
-  , const char **ignore, gboolean force);
-
-/*! Destroys the contents of the project. Note that the tags are owned by the
- source files of the project, so they are also destroyed as each source file
- is deallocated using tm_source_file_free(). If the tags are to be used after
- the project has been destroyed, they should be deep-copied and any arrys
- containing pointers to them should be rebuilt. Destroying a project will
- automatically update and save teh project if required. You should not have
- to use this function since this is automatically called by tm_project_free().
- \param project The project to be destriyed.
-*/
-void tm_project_destroy(TMProject *project);
-
-/*! Destroys the project contents by calling tm_project_destroy() and frees the
- memory allocated to the project structure.
- \sa tm_project_destroy()
-*/
-void tm_project_free(gpointer project);
-
-/*! Opens a project by reading contents from the project database. The project
- should have been initialized prior to this using tm_project_new(). You should
- not have to use this since tm_project_new() will open the project if it already
- exists.
- \param project The project to open.
- \param force Whether the cache should be ignored.
- \return TRUE on success, FALSE on failure
-*/
-gboolean tm_project_open(TMProject *project, gboolean force);
-
-/*! Saves the project in the project database file.
- \param project The project to save.
- \return TRUE on success, FALSE on failure.
-*/
-gboolean tm_project_save(TMProject *project);
-
-/*! Adds a file to the project by creating a TMSourceFile from the file name
- and pushing it at the end of the project's file list.
- \param project The project to add the file to.
- \param file_name Full path of the file to be added to the project.
- \param update Whether to update tags image after addition.
- \return TRUE on success, FALSE on failure.
-*/
-gboolean tm_project_add_file(TMProject *project, const char *file_name
-  , gboolean update);
-
-/*! Finds a file in a project. If the file exists, returns a pointer to it,
- else returns NULL. This is the overloaded function TMFindFunc for TMProject.
- You should not have to call this function directly since this is automatically
- called by tm_work_object_find().
- \param project The project in which the file is to be searched.
- \param The name of the file to be searched.
- \param name_only Whether the comparison is to be only on name (not full path)
- \return Pointer the file (TMSourceFile) in the project. NULL if the file was not found.
-*/
-TMWorkObject *tm_project_find_file(TMWorkObject *work_object, const char *file_name
-  , gboolean name_only);
-
-/*! Destroys a member object and removes it from the project list.
- \param project The project from the file is to be removed.
- \param w The member work object (source file) to be removed
- \return TRUE on success, FALSE on failure
-*/
-gboolean tm_project_remove_object(TMProject *project, TMWorkObject *w);
-
-/*! Removes only the project-tags associated with the object. Then resort the project's tags.
- \param project The project from which the file's tags are to be removed.
- \param w The member work object (source file) to remove the tags.
- \return TRUE on success, FALSE on failure
-*/
-gboolean tm_project_remove_tags_from_list(TMProject *project, TMWorkObject *w);
-
-/*! Updates the project database and all the source files contained in the
- project. All sorting and deduping is lost and should be redone.
- \param work_object The project to update.
- \param force If set to TRUE, the cache is ignored.
- \param recurse If set to TRUE, checks all child objects, otherwise just recreates the
- tag array.
- \param update_parent If set to TRUE, sends an update signal to it's parent if required.
- If you are calling this function directly, you should always set this to TRUE.
- \return TRUE on success, FALSE on failure
-*/
-gboolean tm_project_update(TMWorkObject *work_object, gboolean force
-  , gboolean recurse, gboolean update_parent);
-
-/*! Syncs a project with the given list of file names, i.e., removes all files
-** which are not in the list and adding the files which are in the list but not
-** in the project.
-\param project The project pointer
-\param files - A list of file names relative to the top directory.
-*/
-gboolean tm_project_sync(TMProject *project, GList *files);
-
-/*! Recreates the tags array of the project from the tags arrays of the contituent
- source files. Note that unlike TMSourceFile , the projects tags are not owned
- by the project but by the member source files. So, do not do a tm_tag_free() on
- a tag of the project's tag list
-*/
-void tm_project_recreate_tags_array(TMProject *project);
-
-/*! Automatically imports all source files from the given directory
- into the project. This is done automatically if tm_project_new() is
- supplied with a directory name as parameter. Auto-scan will occur only
- if the directory is a valid top-level project directory, i.e, if the
- directory contains one of Makefile.am, Makefile.in or Makefile.
-*/
-gboolean tm_project_autoscan(TMProject *project);
-
-/*! Dumps the current project structure - useful for debugging */
-void tm_project_dump(const TMProject *p);
-
-/*! Returns TRUE if the passed file is a source file as matched by the project
-  source extensions (project->extn)
-*/
-gboolean tm_project_is_source_file(TMProject *project, const char *file_name);
-
-/*! Contains the id obtained by registering the TMProject class as a child of
- TMWorkObject.
- \sa tm_work_object_register()
-*/
-extern guint project_class_id;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* TM_PROJECT_H */


Modified: tagmanager/src/tm_source_file.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -301,7 +301,7 @@ gboolean tm_source_file_buffer_update(TMWorkObject *source_file, guchar* text_bu
 	if ((source_file->parent) && update_parent)
 	{
 #ifdef TM_DEBUG
-		g_message("Updating parent [project] from buffer..");
+		g_message("Updating parent from buffer..");
 #endif
 		tm_work_object_update(source_file->parent, TRUE, FALSE, TRUE);
 	}


Modified: tagmanager/src/tm_source_file.h
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -73,7 +73,7 @@ void tm_source_file_free(gpointer source_file);
  \param update_parent If set to TRUE, sends an update signal to parent if required. You should
  always set this to TRUE if you are calling this function directly.
  \return TRUE if the file was parsed, FALSE otherwise.
- \sa tm_work_object_update(), tm_project_update(), tm_workspace_update()
+ \sa tm_work_object_update(), tm_workspace_update()
 */
 gboolean tm_source_file_update(TMWorkObject *source_file, gboolean force
   , gboolean recurse, gboolean update_parent);
@@ -93,7 +93,7 @@ gboolean tm_source_file_update(TMWorkObject *source_file, gboolean force
  \param update_parent If set to TRUE, sends an update signal to parent if required. You should
  always set this to TRUE if you are calling this function directly.
  \return TRUE if the file was parsed, FALSE otherwise.
- \sa tm_work_object_update(), tm_project_update(), tm_workspace_update()
+ \sa tm_work_object_update(), tm_workspace_update()
 */
 gboolean tm_source_file_buffer_update(TMWorkObject *source_file, guchar* text_buf,
 			gint buf_size, gboolean update_parent);


Modified: tagmanager/src/tm_tagmanager.h
3 lines changed, 1 insertions(+), 2 deletions(-)
===================================================================
@@ -16,7 +16,6 @@
 #include "tm_workspace.h"
 #include "tm_work_object.h"
 #include "tm_source_file.h"
-#include "tm_project.h"
 #include "tm_parser.h"
 
 /*! \mainpage Introduction
@@ -35,7 +34,7 @@
 /*! \file
  Include this file in all programs using the tag manager library. Including this
  automatically includes all the necessary files, namely, tm_tag.h, tm_source_file.h
- , tm_project.h and tm_workspace.h
+ and tm_workspace.h
 */
 
 #endif /* TM_TAGMANAGER_H */


Modified: tagmanager/src/tm_work_object.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -9,7 +9,7 @@
 
 /**
  * @file tm_work_object.h
- * A TMWorkObject structure is the base class for TMSourceFile and TMProject.
+ * A TMWorkObject structure is the base class for TMSourceFile.
 */
 
 #include "general.h"	/* must always come first */


Modified: tagmanager/src/tm_work_object.h
12 lines changed, 6 insertions(+), 6 deletions(-)
===================================================================
@@ -26,7 +26,7 @@ extern "C"
 #define TM_WORK_OBJECT(work_object) ((TMWorkObject *) work_object)
 
 /*!
- A TMWorkObject structure is the base class for TMSourceFile and TMProject.
+ A TMWorkObject structure is the base class for TMSourceFile.
  This struct contains data common to all work objects, namely, a file name,
  time when the file was analyzed (for caching) and an array of tags which
  should be populated when the object is analyzed.
@@ -45,7 +45,7 @@ typedef struct TMWorkObject
  derived from TMWorkObject. The function should take a pointer to the
  object and a flag indicating whether the cache should be ignored, and
  update the object's tag array accordingly.
- \sa tm_work_object_update(), tm_workspace_update(), tm_project_update(),
+ \sa tm_work_object_update(), tm_workspace_update(),
  tm_source_file_update().
 */
 typedef gboolean (*TMUpdateFunc) (TMWorkObject *work_object, gboolean force
@@ -104,7 +104,7 @@ gboolean tm_work_object_init(TMWorkObject *work_object, guint type, const char *
  Initializes a new TMWorkObject structure and returns a pointer to it. You shouldn't
  have to call this function.
  \return NULL on failure
- \sa tm_source_file_new() , tm_project_new()
+ \sa tm_source_file_new()
 */
 TMWorkObject *tm_work_object_new(guint type, const char *file_name, gboolean create);
 
@@ -139,7 +139,7 @@ void tm_work_object_free(gpointer work_object);
  \param free_func The function to call to free the derived object.
  \param update_func The function to call to update the derived object.
  \return A unique ID for the derived class.
- \sa TMSourceFile , TMProject
+ \sa TMSourceFile
 */
 guint tm_work_object_register(GFreeFunc free_func, TMUpdateFunc update_func, TMFindFunc find_func);
 
@@ -156,11 +156,11 @@ void tm_work_object_write_tags(TMWorkObject *work_object, FILE *file, guint attr
  of the type to which the object belongs.
  \param work_object Pointer to a work object or an object derived from it.
  \param force Whether the cache is to be ignored.
- \param recurse Whether to recurse into child work objects (for workspace and projects).
+ \param recurse Whether to recurse into child work objects (for workspace).
  \param update_parent If set to TRUE, calls the update function of the parent if required.
  If you are calling this function, you should set this to TRUE.
  \return TRUE on success, FALSE on failure.
- \sa tm_source_file_update() , tm_project_update()
+ \sa tm_source_file_update()
 */
 gboolean tm_work_object_update(TMWorkObject *work_object, gboolean force
   , gboolean recurse, gboolean update_parent);


Modified: tagmanager/src/tm_workspace.c
10 lines changed, 3 insertions(+), 7 deletions(-)
===================================================================
@@ -13,9 +13,9 @@
  wide tag information.
 
  The workspace is intended to contain a list of global tags
- and a set of work objects (projects or individual files). You need not use the
+ and a set of work objects (individual files). You need not use the
  workspace, though, to use tag manager, unless you need things like global tags
- and a place to store all current open projects and individual files. TMWorkspace
+ and a place to store all current open files. TMWorkspace
  is derived from TMWorkObject.
 */
 
@@ -35,7 +35,6 @@
 
 #include "tm_tag.h"
 #include "tm_workspace.h"
-#include "tm_project.h"
 
 
 static TMWorkspace *theWorkspace = NULL;
@@ -567,10 +566,7 @@ void tm_workspace_dump(void)
 			guint i;
 			for (i=0; i < theWorkspace->work_objects->len; ++i)
 			{
-				if (IS_TM_PROJECT(TM_WORK_OBJECT(theWorkspace->work_objects->pdata[i])))
-					tm_project_dump(TM_PROJECT(theWorkspace->work_objects->pdata[i]));
-				else
-					tm_work_object_dump(TM_WORK_OBJECT(theWorkspace->work_objects->pdata[i]));
+				tm_work_object_dump(TM_WORK_OBJECT(theWorkspace->work_objects->pdata[i]));
 			}
 		}
 	}


Modified: tagmanager/src/tm_workspace.h
15 lines changed, 7 insertions(+), 8 deletions(-)
===================================================================
@@ -23,10 +23,9 @@ extern "C"
 
 
 /*! The Tag Manager Workspace. This is a singleton work object containing a list
- of work objects. These can be either individual files or project containing
- multiple files. There is also a global tag list which can be loaded or
- created. This contains global tags gleaned from /usr/include, etc. and
- should be used for autocompletion, calltips, etc.
+ of work objects - individual source files. There is also a global tag list 
+ which can be loaded or created. This contains global tags gleaned from 
+ /usr/include, etc. and should be used for autocompletion, calltips, etc.
 */
 typedef struct
 {
@@ -43,8 +42,8 @@ typedef struct
 */
 const TMWorkspace *tm_get_workspace(void);
 
-/*! Adds a work object (source file or project) to the workspace.
- \param work_object The work object to add to the project.
+/*! Adds a work object (source file) to the workspace.
+ \param work_object The work object to add to the workspace.
  \return TRUE on success, FALSE on failure (e.g. object already exixts).
 */
 gboolean tm_workspace_add_object(TMWorkObject *work_object);
@@ -56,7 +55,7 @@ gboolean tm_workspace_add_object(TMWorkObject *work_object);
  \param file_name The name of the file to search.
  \param name_only If you want to match just the name and not the full path.
  \return Pointer to the work object matching the file name (NULL if not found).
- \sa tm_work_object_find(), tm_project_find_file().
+ \sa tm_work_object_find().
 */
 TMWorkObject *tm_workspace_find_object(TMWorkObject *work_object, const char *file_name
   ,gboolean name_only);
@@ -105,7 +104,7 @@ void tm_workspace_recreate_tags_array(void);
  \param recurse If set to TRUE, updates all children before updating the tag image.
  \param update_parent This parameter is ignored for the workspace since it is at the
  top of the work object hierarchy.
- \sa tm_work_object_update(), tm_source_file_update(), tm_project_update()
+ \sa tm_work_object_update(), tm_source_file_update()
 */
 gboolean tm_workspace_update(TMWorkObject *workspace, gboolean force
   , gboolean recurse, gboolean update_parent);


Modified: wscript
3 lines changed, 1 insertions(+), 2 deletions(-)
===================================================================
@@ -119,7 +119,6 @@ ctags_sources = set([
 
 tagmanager_sources = set([
     'tagmanager/src/tm_file_entry.c',
-    'tagmanager/src/tm_project.c',
     'tagmanager/src/tm_source_file.c',
     'tagmanager/src/tm_symbol.c',
     'tagmanager/src/tm_tag.c',
@@ -551,7 +550,7 @@ def build(bld):
         scintilla/include/SciLexer.h scintilla/include/Scintilla.h
         scintilla/include/Scintilla.iface scintilla/include/ScintillaWidget.h ''')
     bld.install_files('${PREFIX}/include/geany/tagmanager', '''
-        tagmanager/src/tm_file_entry.h tagmanager/src/tm_project.h
+        tagmanager/src/tm_file_entry.h
         tagmanager/src/tm_source_file.h tagmanager/src/tm_parser.h
         tagmanager/src/tm_symbol.h tagmanager/src/tm_tag.h
         tagmanager/src/tm_tagmanager.h tagmanager/src/tm_work_object.h



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list