plugins: Replace geany_plugin_register() pdata with a separate API function
[geany-mirror.git] / tagmanager / src / tm_source_file.h
blob173b14a111d6a8550996ba9e816147d5fd649ba8
1 /*
3 * Copyright (c) 2001-2002, Biswapesh Chattopadhyay
5 * This source code is released for free distribution under the terms of the
6 * GNU General Public License.
8 */
10 #ifndef TM_SOURCE_FILE_H
11 #define TM_SOURCE_FILE_H
13 #include <stdio.h>
14 #include <glib.h>
16 #ifndef LIBCTAGS_DEFINED
17 typedef int langType;
18 typedef void tagEntryInfo;
19 #endif
21 #if !defined(tagEntryInfo)
22 #endif
24 #ifdef __cplusplus
25 extern "C"
27 #endif
29 /* Casts a pointer to a pointer to a TMSourceFile structure */
30 #define TM_SOURCE_FILE(source_file) ((TMSourceFile *) source_file)
32 /* Evaluates to X is X is defined, else evaluates to Y */
33 #define FALLBACK(X,Y) (X)?(X):(Y)
36 /**
37 The TMSourceFile structure represents the source file and its tags in the tag manager.
39 typedef struct
41 langType lang; /**< Programming language used */
42 char *file_name; /**< Full file name (inc. path) */
43 char *short_name; /**< Just the name of the file (without the path) */
44 GPtrArray *tags_array; /**< Sorted tag array obtained by parsing the object */
45 } TMSourceFile;
47 TMSourceFile *tm_source_file_new(const char *file_name, const char *name);
49 void tm_source_file_free(TMSourceFile *source_file);
51 gchar *tm_get_real_path(const gchar *file_name);
54 #ifdef GEANY_PRIVATE
56 const gchar *tm_source_file_get_lang_name(gint lang);
58 gint tm_source_file_get_named_lang(const gchar *name);
60 gboolean tm_source_file_parse(TMSourceFile *source_file, guchar* text_buf, gsize buf_size,
61 gboolean use_buffer);
63 #endif /* GEANY_PRIVATE */
65 #ifdef __cplusplus
67 #endif
69 #endif /* TM_SOURCE_FILE_H */