[anjuta/system-db-refactor] libanjuta: Cleanup anjuta-pkg-config.[ch]
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta/system-db-refactor] libanjuta: Cleanup anjuta-pkg-config.[ch]
- Date: Mon, 31 Jan 2011 22:04:13 +0000 (UTC)
commit 7cb3a4abb65c9983c3eb98262ec7bb13a5d6174c
Author: Johannes Schmid <jhs gnome org>
Date: Mon Jan 31 23:03:55 2011 +0100
libanjuta: Cleanup anjuta-pkg-config.[ch]
libanjuta/anjuta-pkg-config.c | 120 -----------------------------------------
libanjuta/anjuta-pkg-config.h | 67 ++++-------------------
2 files changed, 11 insertions(+), 176 deletions(-)
---
diff --git a/libanjuta/anjuta-pkg-config.c b/libanjuta/anjuta-pkg-config.c
index 3e6fb32..1bbef0d 100644
--- a/libanjuta/anjuta-pkg-config.c
+++ b/libanjuta/anjuta-pkg-config.c
@@ -84,126 +84,6 @@ anjuta_pkg_config_list_dependencies (const gchar* package, GError** error)
return deps;
}
-
-static void
-fixme_files_visit_dir (GList **children, GFile *dir)
-{
- GFileEnumerator *list;
-
- list = g_file_enumerate_children (dir,
- G_FILE_ATTRIBUTE_STANDARD_NAME,
- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
- NULL,
- NULL);
-
- if (list != NULL)
- {
- GFileInfo *info;
-
- while ((info = g_file_enumerator_next_file (list, NULL, NULL)) != NULL)
- {
- const gchar *name;
- GFile *file;
-
- name = g_file_info_get_name (info);
- file = g_file_get_child (dir, name);
- g_object_unref (info);
-
- if (g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY)
- {
- fixme_files_visit_dir (children, file);
- g_object_unref (file);
- }
- else
- {
- *children = g_list_prepend (*children, file);
- }
- }
- g_file_enumerator_close (list, NULL, NULL);
- g_object_unref (list);
- }
-}
-
-GList*
-anjuta_pkg_config_get_abs_headers (const gchar* pkg_name, gboolean no_deps, GError** error)
-{
- GList *directories = NULL;
- GList *dir_node = NULL;
- /* a GList list of all headers found */
- GList *headers = NULL;
- /* a gchar version of headers list */
- GList *abs_headers = NULL;
-
- g_return_val_if_fail (pkg_name != NULL, NULL);
-
- /* get a GList of gchar(s) */
- directories = anjuta_pkg_config_get_directories (pkg_name, no_deps, error);
-
- if (error != NULL)
- return NULL;
-
- dir_node = directories;
- while (dir_node != NULL)
- {
- GList *children = NULL;
- GFile *file;
-
- g_message ("creating gfile for %s", (gchar*)dir_node->data);
- file = g_file_new_for_path (dir_node->data);
- fixme_files_visit_dir (&children, file);
- g_object_unref (file);
-
- if (children != NULL)
- {
- GList *foo_node;
- foo_node = children;
-/*/
- while (foo_node != NULL)
- {
- g_message ("children %s", g_file_get_path (foo_node->data));
-
- foo_node = g_list_next (foo_node);
- }
-
- foo_node = headers;
- while (foo_node != NULL)
- {
- g_message ("headers %s", g_file_get_path (foo_node->data));
-
- foo_node = g_list_next (foo_node);
- }
-/*/
- headers = g_list_concat (headers, children);
-
- }
- dir_node = g_list_next (dir_node);
- }
-
- GList *foo_node;
- foo_node = headers;
- while (foo_node != NULL)
- {
- g_message ("headers %s", g_file_get_path (foo_node->data));
- foo_node = g_list_next (foo_node);
- }
-
- abs_headers = anjuta_util_convert_gfile_list_to_path_list (headers);
-
- GList *hnode = abs_headers;
- while (hnode != NULL)
- {
-// DEBUG_PRINT ("ready header %s", g_file_get_path (hnode->data));
-
- g_message ("ready header %s", hnode->data);
- hnode = g_list_next (hnode);
- }
-
- g_list_foreach (headers, (GFunc) g_object_unref, NULL);
- g_list_free (headers);
-
- return abs_headers;
-}
-
GList*
anjuta_pkg_config_get_directories (const gchar* pkg_name, gboolean no_deps, GError** error)
{
diff --git a/libanjuta/anjuta-pkg-config.h b/libanjuta/anjuta-pkg-config.h
index 2c7da50..72ab573 100644
--- a/libanjuta/anjuta-pkg-config.h
+++ b/libanjuta/anjuta-pkg-config.h
@@ -16,59 +16,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
-#ifndef __ANJUTA_PKG_CONFIG__
-#define __ANJUTA_PKG_CONFIG__
-
-#include <glib.h>
-
-/**
- * anjuta_pkg_config_list_dependencies:
- * @pkg_name: Name of the package to get the include directories for
- * @error: Error handling
- *
- * This does (potentially) blocking, call from a thread if necessary
- *
- * Returns: a list of packages @pkg depends on
- */
-GList* anjuta_pkg_config_list_dependencies (const gchar* pkg_name,
- GError** error);
-
-/**
- * anjuta_pkg_config_get_abs_headers:
- * @pkg_name: Name of the package to get the include directories for
- * @error: Error handling
- *
- * Returns a list of absolute path files (gchar*) of the headers of the #pkg_name.
- */
-GList* anjuta_pkg_config_get_abs_headers (const gchar* pkg_name,
- gboolean no_deps,
- GError** error);
-/**
- * anjuta_pkg_config_get_directories:
- * @pkg_name: Name of the package to get the include directories for
- * @no_deps: Don't include directories of the dependencies
- * @error: Error handling
- *
- * This does (potentially) blocking, call from a thread if necessary
- *
- * Returns: a list of include directories (gchar(s)) of the package
- */
-GList* anjuta_pkg_config_get_directories (const gchar* pkg_name,
- gboolean no_deps,
- GError** error);
-
-
-/**
- * anjuta_pkg_config_ignore_package:
- * @pkg_name: Name of the package to ignore
- *
- * Returns: TRUE if the package does not contain
- * valid information for the build system and should be
- * ignored.
- */
-gboolean anjuta_pkg_config_ignore_package (const gchar* pkg_name);
-
-gchar* anjuta_pkg_config_get_version (const gchar* package);
-
-#endif
+
+ #include <glib.h>
+
+GList* anjuta_pkg_config_list_dependencies (const gchar* package,
+ GError** error);
+GList* anjuta_pkg_config_get_directories (const gchar* pkg_name,
+ gboolean no_deps,
+ GError** error);
+gboolean anjuta_pkg_config_ignore_package (const gchar* name);
+
+gchar* anjuta_pkg_config_get_version (const gchar* package);
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]