Move DOC_VALID() macro to document.h, add dox.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/document-pointer@2691 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-06-13 15:02:29 +00:00
parent f87ac06b49
commit 45af150af0
3 changed files with 10 additions and 3 deletions

View File

@ -3,6 +3,8 @@
* src/msgwindow.c:
Fix a segfault after clicking on a messages window Find Usage item
after the relevant document has been closed.
* src/msgwindow.c, src/document.h:
Move DOC_VALID() macro to document.h, add dox.
2008-06-12 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

View File

@ -130,6 +130,14 @@ extern GPtrArray *documents_array;
**/
#define documents ((GeanyDocument **)documents_array->pdata)
/** Check that the @a doc_ptr document still exists (has not been closed).
* This is useful when @a doc_ptr was stored some time earlier and documents may have been
* closed since then.
* @note This should not be used to check the result of the main API functions,
* these only need a NULL-pointer check - @c p_document->get_current() != @c NULL. */
#define DOC_VALID(doc_ptr) \
((doc_ptr) != NULL && (doc_ptr)->is_valid)
/** NULL-safe way to get the index of @a doc_ptr in the documents array. */
#define DOC_IDX(doc_ptr) \
(doc_ptr ? doc_ptr->index : -1)

View File

@ -791,9 +791,6 @@ void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir, gch
}
#define DOC_VALID(doc_ptr) \
((doc_ptr) != NULL && (doc_ptr)->is_valid)
gboolean msgwin_goto_messages_file_line()
{
GtkTreeIter iter;