geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

tm_tag.c File Reference
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include "tm_tag.h"
#include "tm_ctags.h"
Include dependency graph for tm_tag.c:

Go to the source code of this file.

Classes

struct  TMSortOptions
 

Macros

#define TAG_NEW(T)   ((T) = g_slice_new0(TMTag))
 
#define TAG_FREE(T)   g_slice_free(TMTag, (T))
 

Functions

GType tm_tag_get_type (void)
 Gets the GType for a TMTag. More...
 
TMTagtm_tag_new (void)
 
static void tm_tag_destroy (TMTag *tag)
 
void tm_tag_unref (TMTag *tag)
 
TMTagtm_tag_ref (TMTag *tag)
 
static gint tm_tag_compare (gconstpointer ptr1, gconstpointer ptr2, gpointer user_data)
 
gboolean tm_tags_equal (const TMTag *a, const TMTag *b)
 
void tm_tags_prune (GPtrArray *tags_array)
 
void tm_tags_dedup (GPtrArray *tags_array, TMTagAttrType *sort_attributes, gboolean unref_duplicates)
 
void tm_tags_sort (GPtrArray *tags_array, TMTagAttrType *sort_attributes, gboolean dedup, gboolean unref_duplicates)
 
void tm_tags_remove_file_tags (TMSourceFile *source_file, GPtrArray *tags_array)
 
static GPtrArray * merge (GPtrArray *big_array, GPtrArray *small_array, TMSortOptions *sort_options, gboolean unref_duplicates)
 
GPtrArray * tm_tags_merge (GPtrArray *big_array, GPtrArray *small_array, TMTagAttrType *sort_attributes, gboolean unref_duplicates)
 
GPtrArray * tm_tags_extract (GPtrArray *tags_array, TMTagType tag_types)
 
void tm_tags_array_free (GPtrArray *tags_array, gboolean free_all)
 
static gpointer binary_search (gpointer key, gpointer base, size_t nmemb, GCompareDataFunc compar, gpointer user_data)
 
static gint tag_search_cmp (gconstpointer ptr1, gconstpointer ptr2, gpointer user_data)
 
TMTag ** tm_tags_find (const GPtrArray *tags_array, const char *name, gboolean partial, guint *tagCount)
 
const TMTagtm_get_current_tag (GPtrArray *file_tags, const gulong line, const TMTagType tag_types)
 
gboolean tm_tag_is_anon (const TMTag *tag)
 

Macro Definition Documentation

◆ TAG_FREE

#define TAG_FREE (   T)    g_slice_free(TMTag, (T))

Definition at line 20 of file tm_tag.c.

◆ TAG_NEW

#define TAG_NEW (   T)    ((T) = g_slice_new0(TMTag))

Definition at line 19 of file tm_tag.c.

Function Documentation

◆ binary_search()

static gpointer binary_search ( gpointer  key,
gpointer  base,
size_t  nmemb,
GCompareDataFunc  compar,
gpointer  user_data 
)
static

Definition at line 545 of file tm_tag.c.

References NULL.

Referenced by tm_tags_find().

◆ merge()

static GPtrArray * merge ( GPtrArray *  big_array,
GPtrArray *  small_array,
TMSortOptions sort_options,
gboolean  unref_duplicates 
)
static

Definition at line 380 of file tm_tag.c.

References if(), tm_tag_compare(), and tm_tag_unref().

Referenced by styleset_from_mapping(), and tm_tags_merge().

◆ tag_search_cmp()

static gint tag_search_cmp ( gconstpointer  ptr1,
gconstpointer  ptr2,
gpointer  user_data 
)
static

Definition at line 570 of file tm_tag.c.

References TMSortOptions::first, TMSortOptions::tags_array, and tm_tag_compare().

Referenced by tm_tags_find().

◆ tm_get_current_tag()

const TMTag * tm_get_current_tag ( GPtrArray *  file_tags,
const gulong  line,
const TMTagType  tag_types 
)

Definition at line 646 of file tm_tag.c.

References line, TMTag::line, NULL, TM_TAG, and TMTag::type.

Referenced by get_current_tag_name().

◆ tm_tag_compare()

◆ tm_tag_destroy()

static void tm_tag_destroy ( TMTag tag)
static

Definition at line 121 of file tm_tag.c.

References TMTag::arglist, TMTag::inheritance, TMTag::name, TMTag::scope, and TMTag::var_type.

Referenced by tm_tag_unref().

◆ tm_tag_get_type()

GType tm_tag_get_type ( void  )

Gets the GType for a TMTag.

Returns
TMTag type
Since
1.32 (API 233)

Definition at line 91 of file tm_tag.c.

References tm_tag_ref(), and tm_tag_unref().

◆ tm_tag_is_anon()

gboolean tm_tag_is_anon ( const TMTag tag)

Definition at line 668 of file tm_tag.c.

References dummy, TMTag::lang, and TMTag::name.

Referenced by fill_find_tags_array_prefix(), find_scope_members(), and find_scope_members_tags().

◆ tm_tag_new()

TMTag * tm_tag_new ( void  )

Definition at line 106 of file tm_tag.c.

References TMTag::refcount, and TAG_NEW.

Referenced by new_tag_from_tags_file(), and write_entry().

◆ tm_tag_ref()

TMTag * tm_tag_ref ( TMTag tag)

Definition at line 152 of file tm_tag.c.

References TMTag::refcount.

Referenced by show_goto_popup(), and tm_tag_get_type().

◆ tm_tag_unref()

◆ tm_tags_array_free()

void tm_tags_array_free ( GPtrArray *  tags_array,
gboolean  free_all 
)

Definition at line 529 of file tm_tag.c.

References tm_tag_unref().

Referenced by tm_source_file_destroy(), tm_source_file_parse(), and tm_workspace_free().

◆ tm_tags_dedup()

void tm_tags_dedup ( GPtrArray *  tags_array,
TMTagAttrType sort_attributes,
gboolean  unref_duplicates 
)

◆ tm_tags_equal()

gboolean tm_tags_equal ( const TMTag a,
const TMTag b 
)

◆ tm_tags_extract()

GPtrArray * tm_tags_extract ( GPtrArray *  tags_array,
TMTagType  tag_types 
)

Definition at line 505 of file tm_tag.c.

References NULL.

Referenced by merge_extracted_tags(), tm_workspace_load_global_tags(), and tm_workspace_update().

◆ tm_tags_find()

TMTag ** tm_tags_find ( const GPtrArray *  tags_array,
const char *  name,
gboolean  partial,
guint *  tagCount 
)

◆ tm_tags_merge()

GPtrArray * tm_tags_merge ( GPtrArray *  big_array,
GPtrArray *  small_array,
TMTagAttrType sort_attributes,
gboolean  unref_duplicates 
)

◆ tm_tags_prune()

void tm_tags_prune ( GPtrArray *  tags_array)

Definition at line 246 of file tm_tag.c.

References count, and NULL.

Referenced by find_calltip(), tm_tags_dedup(), and tm_tags_remove_file_tags().

◆ tm_tags_remove_file_tags()

void tm_tags_remove_file_tags ( TMSourceFile source_file,
GPtrArray *  tags_array 
)

◆ tm_tags_sort()

void tm_tags_sort ( GPtrArray *  tags_array,
TMTagAttrType sort_attributes,
gboolean  dedup,
gboolean  unref_duplicates 
)