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.
10 #ifndef TM_SOURCE_FILE_H
11 #define TM_SOURCE_FILE_H
15 #include <glib-object.h>
17 #include "tm_parser.h"
21 /* Casts a pointer to a pointer to a TMSourceFile structure */
22 #define TM_SOURCE_FILE(source_file) ((TMSourceFile *) source_file)
24 /* Evaluates to X is X is defined, else evaluates to Y */
25 #define FALLBACK(X,Y) (X)?(X):(Y)
29 * The TMSourceFile structure represents the source file and its tags in the tag manager.
31 typedef struct TMSourceFile
33 TMParserType lang
; /* Programming language used */
34 char *file_name
; /**< Full file name (inc. path) */
35 char *short_name
; /**< Just the name of the file (without the path) */
36 GPtrArray
*tags_array
; /**< Sorted tag array obtained by parsing the object */
39 GType
tm_source_file_get_type(void);
41 TMSourceFile
*tm_source_file_new(const char *file_name
, const char *name
);
43 void tm_source_file_free(TMSourceFile
*source_file
);
45 gchar
*tm_get_real_path(const gchar
*file_name
);
49 const gchar
*tm_source_file_get_lang_name(TMParserType lang
);
51 TMParserType
tm_source_file_get_named_lang(const gchar
*name
);
53 gboolean
tm_source_file_parse(TMSourceFile
*source_file
, guchar
* text_buf
, gsize buf_size
,
56 GPtrArray
*tm_source_file_read_tags_file(const gchar
*tags_file
, TMParserType mode
);
58 gboolean
tm_source_file_write_tags_file(const gchar
*tags_file
, GPtrArray
*tags_array
);
60 #endif /* GEANY_PRIVATE */
64 #endif /* TM_SOURCE_FILE_H */