Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
G
geany
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
geany
Commits
17375793
Kaydet (Commit)
17375793
authored
Eki 05, 2014
tarafından
Colomban Wendling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #347 from techee/master
Remove unused tag manager files
üst
3e089e4c
ce46f8f0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
23 additions
and
655 deletions
+23
-655
Makefile.am
tagmanager/src/Makefile.am
+0
-5
tm_project.c
tagmanager/src/tm_project.c
+0
-0
tm_project.h
tagmanager/src/tm_project.h
+0
-207
tm_source_file.c
tagmanager/src/tm_source_file.c
+1
-1
tm_source_file.h
tagmanager/src/tm_source_file.h
+2
-2
tm_symbol.c
tagmanager/src/tm_symbol.c
+0
-319
tm_symbol.h
tagmanager/src/tm_symbol.h
+0
-80
tm_tagmanager.c
tagmanager/src/tm_tagmanager.c
+0
-11
tm_tagmanager.h
tagmanager/src/tm_tagmanager.h
+1
-3
tm_work_object.c
tagmanager/src/tm_work_object.c
+1
-1
tm_work_object.h
tagmanager/src/tm_work_object.h
+6
-6
tm_workspace.c
tagmanager/src/tm_workspace.c
+3
-7
tm_workspace.h
tagmanager/src/tm_workspace.h
+7
-8
wscript
wscript
+2
-5
No files found.
tagmanager/src/Makefile.am
Dosyayı görüntüle @
17375793
...
...
@@ -15,9 +15,7 @@ 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
\
tm_tagmanager.h
\
tm_work_object.h
\
...
...
@@ -26,10 +24,7 @@ tagmanager_include_HEADERS = \
libtagmanager_a_SOURCES
=
\
tm_file_entry.c
\
tm_project.c
\
tm_source_file.c
\
tm_symbol.c
\
tm_tag.c
\
tm_tagmanager.c
\
tm_work_object.c
\
tm_workspace.c
tagmanager/src/tm_project.c
deleted
100644 → 0
Dosyayı görüntüle @
3e089e4c
This diff is collapsed.
Click to expand it.
tagmanager/src/tm_project.h
deleted
100644 → 0
Dosyayı görüntüle @
3e089e4c
/*
*
* 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 */
tagmanager/src/tm_source_file.c
Dosyayı görüntüle @
17375793
...
...
@@ -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
);
}
...
...
tagmanager/src/tm_source_file.h
Dosyayı görüntüle @
17375793
...
...
@@ -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
);
...
...
tagmanager/src/tm_symbol.c
deleted
100644 → 0
Dosyayı görüntüle @
3e089e4c
/*
*
* Copyright (c) 2001-2002, Biswapesh Chattopadhyay
*
* This source code is released for free distribution under the terms of the
* GNU General Public License.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tm_symbol.h"
#define SYM_NEW(T) ((T) = g_slice_new0(TMSymbol))
#define SYM_FREE(T) g_slice_free(TMSymbol, (T))
void
tm_symbol_print
(
TMSymbol
*
sym
,
guint
level
)
{
guint
i
;
g_return_if_fail
(
sym
!=
NULL
);
for
(
i
=
0
;
i
<
level
;
++
i
)
fputc
(
'\t'
,
stderr
);
fprintf
(
stderr
,
"%s
\n
"
,
(
sym
->
tag
)
?
sym
->
tag
->
name
:
"Root"
);
if
(
sym
->
info
.
children
)
{
if
(
sym
->
tag
&&
tm_tag_function_t
==
sym
->
tag
->
type
)
tm_tag_print
(
sym
->
info
.
equiv
,
stderr
);
else
{
for
(
i
=
0
;
i
<
sym
->
info
.
children
->
len
;
++
i
)
tm_symbol_print
(
TM_SYMBOL
(
sym
->
info
.
children
->
pdata
[
i
])
,
level
+
1
);
}
}
}
#define SYM_ORDER(T) (((tm_tag_class_t == (T)->type) || (tm_tag_struct_t ==\
(T)->type))?1:(((tm_tag_enum_t == (T)->type) || (tm_tag_interface_t ==\
(T)->type))?2:3))
/* Comparison function for sorting symbols alphabetically */
int
tm_symbol_compare
(
const
void
*
p1
,
const
void
*
p2
)
{
TMSymbol
*
s1
,
*
s2
;
if
(
!
p1
&&
!
p2
)
return
0
;
else
if
(
!
p2
)
return
1
;
else
if
(
!
p1
)
return
-
1
;
s1
=
*
(
TMSymbol
**
)
p1
;
s2
=
*
(
TMSymbol
**
)
p2
;
if
(
!
s1
&&
!
s2
)
return
0
;
else
if
(
!
s2
)
return
1
;
else
if
(
!
s1
)
return
-
1
;
if
(
!
s1
->
tag
&&
!
s2
->
tag
)
return
0
;
else
if
(
!
s2
->
tag
)
return
1
;
else
if
(
!
s1
->
tag
)
return
-
1
;
return
strcmp
(
s1
->
tag
->
name
,
s2
->
tag
->
name
);
}
/*
* Compares function argument lists.
* FIXME: Compare based on types, not an exact string match.
*/
int
tm_arglist_compare
(
const
TMTag
*
t1
,
const
TMTag
*
t2
)
{
return
strcmp
(
FALLBACK
(
t1
->
atts
.
entry
.
arglist
,
""
),
FALLBACK
(
t2
->
atts
.
entry
.
arglist
,
""
));
}
/* Need this custom compare function to generate a symbol tree
in a simgle pass from tag list */
int
tm_symbol_tag_compare
(
const
TMTag
**
t1
,
const
TMTag
**
t2
)
{
gint
s1
,
s2
;
if
(
!
t1
&&
!
t2
)
return
0
;
if
(
t1
&&
t2
&&
!*
t1
&&
!*
t2
)
return
0
;
else
if
(
!
t1
||
!*
t1
)
return
-
1
;
else
if
(
!
t2
||
!*
t2
)
return
1
;
if
((
tm_tag_file_t
==
(
*
t1
)
->
type
)
&&
(
tm_tag_file_t
==
(
*
t2
)
->
type
))
return
0
;
else
if
(
tm_tag_file_t
==
(
*
t1
)
->
type
)
return
-
1
;
else
if
(
tm_tag_file_t
==
(
*
t2
)
->
type
)
return
1
;
/* Compare on depth of scope - less depth gets higher priortity */
s1
=
tm_tag_scope_depth
(
*
t1
);
s2
=
tm_tag_scope_depth
(
*
t2
);
if
(
s1
!=
s2
)
return
(
s1
-
s2
);
/* Compare of tag type using a symbol ordering routine */
s1
=
SYM_ORDER
(
*
t1
);
s2
=
SYM_ORDER
(
*
t2
);
if
(
s1
!=
s2
)
return
(
s1
-
s2
);
/* Compare names alphabetically */
s1
=
strcmp
((
*
t1
)
->
name
,
(
*
t2
)
->
name
);
if
(
s1
!=
0
)
return
(
s1
);
/* Compare scope alphabetically */
s1
=
strcmp
(
FALLBACK
((
*
t1
)
->
atts
.
entry
.
scope
,
""
),
FALLBACK
((
*
t2
)
->
atts
.
entry
.
scope
,
""
));
if
(
s1
!=
0
)
return
s1
;
/* If none of them are function/prototype, they are effectively equal */
if
((
tm_tag_function_t
!=
(
*
t1
)
->
type
)
&&
(
tm_tag_prototype_t
!=
(
*
t1
)
->
type
)
&&
(
tm_tag_function_t
!=
(
*
t2
)
->
type
)
&&
(
tm_tag_prototype_t
!=
(
*
t2
)
->
type
))
return
0
;
/* Whichever is not a function/prototype goes first */
if
((
tm_tag_function_t
!=
(
*
t1
)
->
type
)
&&
(
tm_tag_prototype_t
!=
(
*
t1
)
->
type
))
return
-
1
;
if
((
tm_tag_function_t
!=
(
*
t2
)
->
type
)
&&
(
tm_tag_prototype_t
!=
(
*
t2
)
->
type
))
return
1
;
/* Compare the argument list */
s1
=
tm_arglist_compare
(
*
t1
,
*
t2
);
if
(
s1
!=
0
)
return
s1
;
/* Functions go before prototypes */
if
((
tm_tag_function_t
==
(
*
t1
)
->
type
)
&&
(
tm_tag_function_t
!=
(
*
t2
)
->
type
))
return
-
1
;
if
((
tm_tag_function_t
!=
(
*
t1
)
->
type
)
&&
(
tm_tag_function_t
==
(
*
t2
)
->
type
))
return
1
;
/* Give up */
return
0
;
}
TMSymbol
*
tm_symbol_tree_new
(
GPtrArray
*
tags_array
)
{
TMSymbol
*
root
=
NULL
;
GPtrArray
*
tags
;
#ifdef TM_DEBUG
g_message
(
"Building symbol tree.."
);
#endif
if
((
!
tags_array
)
||
(
tags_array
->
len
<=
0
))
return
NULL
;
#ifdef TM_DEBUG
fprintf
(
stderr
,
"Dumping all tags..
\n
"
);
tm_tags_array_print
(
tags_array
,
stderr
);
#endif
tags
=
tm_tags_extract
(
tags_array
,
tm_tag_max_t
);
#ifdef TM_DEBUG
fprintf
(
stderr
,
"Dumping unordered tags..
\n
"
);
tm_tags_array_print
(
tags
,
stderr
);
#endif
if
(
tags
&&
(
tags
->
len
>
0
))
{
guint
i
;
int
j
;
int
max_parents
=
-
1
;
TMTag
*
tag
;
TMSymbol
*
sym
=
NULL
,
*
sym1
;
char
*
parent_name
;
char
*
scope_end
;
gboolean
matched
;
int
str_match
;
SYM_NEW
(
root
);
tm_tags_custom_sort
(
tags
,
(
TMTagCompareFunc
)
tm_symbol_tag_compare
,
FALSE
);
#ifdef TM_DEBUG
fprintf
(
stderr
,
"Dumping ordered tags.."
);
tm_tags_array_print
(
tags
,
stderr
);
fprintf
(
stderr
,
"Rebuilding symbol table..
\n
"
);
#endif
for
(
i
=
0
;
i
<
tags
->
len
;
++
i
)
{
tag
=
TM_TAG
(
tags
->
pdata
[
i
]);
if
(
tm_tag_prototype_t
==
tag
->
type
)
{
if
(
sym
&&
(
tm_tag_function_t
==
sym
->
tag
->
type
)
&&
(
!
sym
->
info
.
equiv
)
&&
(
0
==
strcmp
(
FALLBACK
(
tag
->
atts
.
entry
.
scope
,
""
)
,
FALLBACK
(
sym
->
tag
->
atts
.
entry
.
scope
,
""
))))
{
sym
->
info
.
equiv
=
tag
;
continue
;
}
}
if
(
max_parents
<
0
)
{
if
(
SYM_ORDER
(
tag
)
>
2
)
{
max_parents
=
i
;
if
(
max_parents
>
0
)
qsort
(
root
->
info
.
children
->
pdata
,
max_parents
,
sizeof
(
gpointer
),
tm_symbol_compare
);
}
}
SYM_NEW
(
sym
);
sym
->
tag
=
tag
;
if
((
max_parents
<=
0
)
||
(
!
tag
->
atts
.
entry
.
scope
))
{
sym
->
parent
=
root
;
if
(
!
root
->
info
.
children
)
root
->
info
.
children
=
g_ptr_array_new
();
g_ptr_array_add
(
root
->
info
.
children
,
sym
);
}
else
{
parent_name
=
tag
->
atts
.
entry
.
scope
;
scope_end
=
strstr
(
tag
->
atts
.
entry
.
scope
,
"::"
);
if
(
scope_end
)
*
scope_end
=
'\0'
;
matched
=
FALSE
;
if
((
'\0'
!=
parent_name
[
0
])
&&
(
0
!=
strcmp
(
parent_name
,
"<anonymous>"
)))
{
for
(
j
=
0
;
j
<
max_parents
;
++
j
)
{
sym1
=
TM_SYMBOL
(
root
->
info
.
children
->
pdata
[
j
]);
str_match
=
strcmp
(
sym1
->
tag
->
name
,
parent_name
);
if
(
str_match
==
0
)
{
matched
=
TRUE
;
sym
->
parent
=
sym1
;
if
(
!
sym1
->
info
.
children
)
sym1
->
info
.
children
=
g_ptr_array_new
();
g_ptr_array_add
(
sym1
->
info
.
children
,
sym
);
break
;
}
else
if
(
str_match
>
0
)
break
;
}
}
if
(
!
matched
)
{
sym
->
parent
=
root
;
if
(
!
root
->
info
.
children
)
root
->
info
.
children
=
g_ptr_array_new
();
g_ptr_array_add
(
root
->
info
.
children
,
sym
);
}
if
(
scope_end
)
*
scope_end
=
':'
;
}
}
#ifdef TM_DEBUG
fprintf
(
stderr
,
"Done.Dumping symbol tree.."
);
tm_symbol_print
(
root
,
0
);
#endif
}
if
(
tags
)
g_ptr_array_free
(
tags
,
TRUE
);
return
root
;
}
static
void
tm_symbol_free
(
TMSymbol
*
sym
)
{
if
(
!
sym
)
return
;
if
((
!
sym
->
tag
)
||
((
tm_tag_function_t
!=
sym
->
tag
->
type
)
&&
(
tm_tag_prototype_t
!=
sym
->
tag
->
type
)))
{
if
(
sym
->
info
.
children
)
{
guint
i
;
for
(
i
=
0
;
i
<
sym
->
info
.
children
->
len
;
++
i
)
tm_symbol_free
(
TM_SYMBOL
(
sym
->
info
.
children
->
pdata
[
i
]));
g_ptr_array_free
(
sym
->
info
.
children
,
TRUE
);
sym
->
info
.
children
=
NULL
;
}
}
SYM_FREE
(
sym
);
}
void
tm_symbol_tree_free
(
gpointer
root
)
{
if
(
root
)
tm_symbol_free
(
TM_SYMBOL
(
root
));
}
TMSymbol
*
tm_symbol_tree_update
(
TMSymbol
*
root
,
GPtrArray
*
tags
)
{
if
(
root
)
tm_symbol_free
(
root
);
if
((
tags
)
&&
(
tags
->
len
>
0
))
return
tm_symbol_tree_new
(
tags
);
else
return
NULL
;
}
tagmanager/src/tm_symbol.h
deleted
100644 → 0
Dosyayı görüntüle @
3e089e4c
/*
*
* 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_SYMBOL_H
#define TM_SYMBOL_H
/*! \file
The TMSymbol structure and related routines are used by TMProject to maintain a symbol
hierarchy. The top level TMSymbol maintains a pretty simple hierarchy, consisting of
compounds (classes and structs) and their children (member variables and functions).
*/
#include <glib.h>
#include "tm_tag.h"
#ifdef __cplusplus
extern
"C"
{
#endif
/*! This structure defines a symbol */
typedef
struct
_TMSymbol
{
TMTag
*
tag
;
/*!< The tag corresponding to this symbol */
struct
_TMSymbol
*
parent
;
/*!< Parent class/struct for functions/variables */
union
{
GPtrArray
*
children
;
/*!< Array of child symbols */
TMTag
*
equiv
;
/*!< Prototype tag for functions */
}
info
;
}
TMSymbol
;
#define TM_SYMBOL(S) ((TMSymbol *) (S))
/*! Creates a symbol tree from an array of tags.
\param tags The array of tags from which to create the symbol tree.
\return The root symbol (starting point of the symbol tree)
*/
TMSymbol
*
tm_symbol_tree_new
(
GPtrArray
*
tags
);
/*! Given a symbol, frees it and all its children.
\param root The symbol to free.
*/
void
tm_symbol_tree_free
(
gpointer
root
);
/*! Given a symbol tree and an array of tags, updates the symbol tree. Note
that the returned pointer may be different from the passed root pointer,
so don't throw it away. This is basically a convinience function that calls
tm_symbol_tree_free() and tm_symbol_tree_new().
\param root The original root symbol.
\param tags The array of tags from which to rebuild the tree.
\return The new root symbol.
*/
TMSymbol
*
tm_symbol_tree_update
(
TMSymbol
*
root
,
GPtrArray
*
tags
);
/*! Arglist comparison function */
int
tm_arglist_compare
(
const
TMTag
*
t1
,
const
TMTag
*
t2
);
/*! Symbol comparison function - can be used for sorting purposes. */
int
tm_symbol_compare
(
const
void
*
p1
,
const
void
*
p2
);
/*! Tag comparison function tailor made for creating symbol view */
int
tm_symbol_tag_compare
(
const
TMTag
**
t1
,
const
TMTag
**
t2
);
/*! Prints the symbol hierarchy to standard error */
void
tm_symbol_print
(
TMSymbol
*
sym
,
guint
level
);
#ifdef __cplusplus
}
#endif
#endif
/* TM_SYMBOL_H */
tagmanager/src/tm_tagmanager.c
deleted
100644 → 0
Dosyayı görüntüle @
3e089e4c
/*
*
* Copyright (c) 2001-2002, Biswapesh Chattopadhyay
*
* This source code is released for free distribution under the terms of the
* GNU General Public License.
*
*/
#include "tm_tagmanager.h"
tagmanager/src/tm_tagmanager.h
Dosyayı görüntüle @
17375793
...
...
@@ -11,12 +11,10 @@
#define TM_TAGMANAGER_H
#include "tm_tag.h"
#include "tm_symbol.h"
#include "tm_file_entry.h"
#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 +33,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 */
tagmanager/src/tm_work_object.c
Dosyayı görüntüle @
17375793
...
...
@@ -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 */
...
...
tagmanager/src/tm_work_object.h
Dosyayı görüntüle @
17375793
...
...
@@ -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
);
...
...
tagmanager/src/tm_workspace.c
Dosyayı görüntüle @
17375793
...
...
@@ -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
]));
}
}
}
...
...
tagmanager/src/tm_workspace.h
Dosyayı görüntüle @
17375793
...
...
@@ -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
);
...
...
wscript
Dosyayı görüntüle @
17375793
...
...
@@ -119,11 +119,8 @@ 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',
'tagmanager/src/tm_tagmanager.c',
'tagmanager/src/tm_work_object.c',
'tagmanager/src/tm_workspace.c'])
...
...
@@ -551,9 +548,9 @@ 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_tag.h
tagmanager/src/tm_tagmanager.h tagmanager/src/tm_work_object.h
tagmanager/src/tm_workspace.h ''')
# Docs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment