After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 564048 - Split symbol-db-engine into several files
Split symbol-db-engine into several files
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: plugins: symbol-db
SVN TRUNK
Other Linux
: Normal normal
: ---
Assigned To: Massimo Cora'
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-10 23:10 UTC by Johannes Schmid
Modified: 2008-12-20 18:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Johannes Schmid 2008-12-10 23:10:08 UTC
symbol-db-engine.c is about 8600 lines which is far to much to have any sensible structure. This file has to be split up into several files with about 1000-2000 lines. This may envolve some refactoring but otherwise I assume maintaince won't be possible any longer.

BTW, there are several g_tree_compare() methods with exactly the same code - instead a single instance (maybe in symbol-db-utils.c) should be used.
Comment 1 Massimo Cora' 2008-12-19 22:08:29 UTC
(In reply to comment #0)
> symbol-db-engine.c is about 8600 lines which is far to much to have any
> sensible structure. This file has to be split up into several files with about
> 1000-2000 lines. This may envolve some refactoring but otherwise I assume
> maintaince won't be possible any longer.

well the structure exists, even if it's not suddenly visible. Functions are ordered and grouped with a logic in mind. The first ones are for general purposes, then there are the populations ones and at the end the iteratable queries.
I agree anyway that it'd be easy to split up the file.

> 
> BTW, there are several g_tree_compare() methods with exactly the same code -
> instead a single instance (maybe in symbol-db-utils.c) should be used.
> 

yep could be an idea.
Comment 2 Massimo Cora' 2008-12-20 17:58:21 UTC
I splitted the symbol-db-engine.c into

symbol-db-engine-utils.[ch],
symbol-db-engine-core.[ch],
symbol-db-engine-queries.[ch],
symbol-db-engine-priv.h

removed symbol-db-engine.c
and modified symbol-db-engine.h

now to use symbol-db-engine one can just include symbol-db-engine.h.

symbol-db-engine-core.c is still a 5700 lines file, but this is the core, and splitting it up more would just untidy and complicate the things.