Branch: refs/heads/master
Author: LarsGit223 <LarsGit223(a)users.noreply.github.com>
Committer: elextr <elextr(a)gmail.com>
Date: Mon, 21 Aug 2017 23:38:31 UTC
Commit: f1b84c995bac5df2effa3d291a48533ec0aa43ac
https://github.com/geany/geany/commit/f1b84c995bac5df2effa3d291a48533ec0aa4…
Log Message:
-----------
Mention G_GNUC_UNUSED macro. (#1582)
Mention G_GNUC_UNUSED as an alternative to `-Wno-unused-parameter`.
Modified Paths:
--------------
…
[View More] HACKING
Modified: HACKING
5 lines changed, 4 insertions(+), 1 deletions(-)
===================================================================
@@ -229,7 +229,10 @@ to set warning options (as well as anything else e.g. -g -O2).
* Enable warnings - for gcc use '-Wall -Wextra' (and optionally
-Wno-unused-parameter to avoid unused parameter warnings in Glade
- callbacks).
+ callbacks). Alternatively you can use the Glib macro G_GNUC_UNUSED
+ to suppress warnings on single parameters, e.g.
+ ``void examplefunction(G_GNUC_UNUSED gchar *foo)``. Also see
+ https://developer.gnome.org/glib/stable/glib-Miscellaneous-Macros.html.
* You should try to write ISO C99 code for portability, so always
use C ``/* */`` comments and function_name(void) instead of
function_name(). This is for compatibility with various Unix-like
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
[View Less]
Branch: refs/heads/master
Author: kloun <andrey0bolkonsky(a)gmail.com>
Committer: elextr <elextr(a)gmail.com>
Date: Tue, 08 Aug 2017 04:40:58 UTC
Commit: adc22a453b546b05f507fd6522ea13f3a92943c2
https://github.com/geany/geany/commit/adc22a453b546b05f507fd6522ea13f3a9294…
Log Message:
-----------
bash may not found in the system (#1574)
exampe openbsd.
Modified Paths:
--------------
tests/ctags/runner.sh
Modified: tests/ctags/runner.sh
2 …
[View More]lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# error out on undefined variable expansion, useful for debugging
set -u
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
[View Less]
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <mbrush(a)codebrainz.ca>
Date: Fri, 04 Aug 2017 10:44:31 UTC
Commit: 44f96d08a8c4b171e637b8964fbf4e38c83040e6
https://github.com/geany/geany/commit/44f96d08a8c4b171e637b8964fbf4e38c8304…
Log Message:
-----------
Mark tm_get_real_path with G_DEPRECATED_FOR
This will allow the compiler to notify any callers that it's deprecated.
The macro is guarded-out …
[View More]for when Geany is compiling so it won't cause
warnings when tagmanager uses it internally and for the utils_ wrapper.
Modified Paths:
--------------
src/tagmanager/tm_source_file.c
src/tagmanager/tm_source_file.h
src/utils.c
Modified: src/tagmanager/tm_source_file.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -115,7 +115,7 @@ static char *realpath (const char *pathname, char *resolved_path)
of the file.
@param file_name The original file_name
@return A newly allocated string containing the real path to the file. NULL if none is available.
- @deprecated since 1.29 (ABI 230)
+ @deprecated since 1.32 (ABI 235)
@see utils_get_real_path()
*/
GEANY_API_SYMBOL
Modified: src/tagmanager/tm_source_file.h
6 lines changed, 5 insertions(+), 1 deletions(-)
===================================================================
@@ -42,7 +42,11 @@ TMSourceFile *tm_source_file_new(const char *file_name, const char *name);
void tm_source_file_free(TMSourceFile *source_file);
-gchar *tm_get_real_path(const gchar *file_name);
+gchar *tm_get_real_path(const gchar *file_name)
+#ifndef GEANY_PRIVATE
+G_DEPRECATED_FOR(utils_get_real_path)
+#endif
+;
#ifdef GEANY_PRIVATE
Modified: src/utils.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2196,7 +2196,7 @@ void utils_start_new_geany_instance(const gchar *doc_path)
* should be freed with `g_free()` when no longer needed, or @c NULL
* if the real path cannot be obtained.
*
- * @since 1.29 (API 230)
+ * @since 1.32 (API 235)
*/
GEANY_API_SYMBOL
gchar *utils_get_real_path(const gchar *file_name)
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
[View Less]
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <mbrush(a)codebrainz.ca>
Date: Fri, 04 Aug 2017 10:31:25 UTC
Commit: 4a60cdd12727f8f252a3e0d6921e26377ef84904
https://github.com/geany/geany/commit/4a60cdd12727f8f252a3e0d6921e26377ef84…
Log Message:
-----------
Add utils_get_real_path() and use it
This is a wrapper around tm_get_real_path() but is in a more suitable
namespace/module.
Modified Paths:
--…
[View More]------------
src/app.h
src/document.c
src/libmain.c
src/plugindata.h
src/tagmanager/tm_source_file.c
src/utils.c
src/utils.h
Modified: src/app.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -41,7 +41,7 @@ typedef struct GeanyApp
{
gboolean debug_mode; /**< @c TRUE if debug messages should be printed. */
/** User configuration directory, usually @c ~/.config/geany.
- * This is a full path read by @ref tm_get_real_path().
+ * This is a full path read by @ref utils_get_real_path().
* @note Plugin configuration files should be saved as:
* @code g_build_path(G_DIR_SEPARATOR_S, geany->app->configdir, "plugins", "pluginname",
* "file.conf", NULL); @endcode */
Modified: src/document.c
8 lines changed, 4 insertions(+), 4 deletions(-)
===================================================================
@@ -126,7 +126,7 @@ static GtkWidget* document_show_message(GeanyDocument *doc, GtkMessageType msgty
* Finds a document whose @c real_path field matches the given filename.
*
* @param realname The filename to search, which should be identical to the
- * string returned by @c tm_get_real_path().
+ * string returned by @c utils_get_real_path().
*
* @return @transfer{none} @nullable The matching document, or @c NULL.
* @note This is only really useful when passing a @c TMSourceFile::file_name.
@@ -163,7 +163,7 @@ GeanyDocument* document_find_by_real_path(const gchar *realname)
static gchar *get_real_path_from_utf8(const gchar *utf8_filename)
{
gchar *locale_name = utils_get_locale_from_utf8(utf8_filename);
- gchar *realname = tm_get_real_path(locale_name);
+ gchar *realname = utils_get_real_path(locale_name);
g_free(locale_name);
return realname;
@@ -1348,7 +1348,7 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
g_return_val_if_fail(doc != NULL, NULL); /* really should not happen */
/* file exists on disk, set real_path */
- SETPTR(doc->real_path, tm_get_real_path(locale_filename));
+ SETPTR(doc->real_path, utils_get_real_path(locale_filename));
doc->priv->is_remote = utils_is_remote_path(locale_filename);
monitor_file_setup(doc);
@@ -2029,7 +2029,7 @@ static gchar *save_doc(GeanyDocument *doc, const gchar *locale_filename,
/* now the file is on disk, set real_path */
if (doc->real_path == NULL)
{
- doc->real_path = tm_get_real_path(locale_filename);
+ doc->real_path = utils_get_real_path(locale_filename);
doc->priv->is_remote = utils_is_remote_path(locale_filename);
monitor_file_setup(doc);
}
Modified: src/libmain.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -772,7 +772,7 @@ static gint setup_config_dir(void)
}
/* make configdir a real path */
if (g_file_test(app->configdir, G_FILE_TEST_EXISTS))
- SETPTR(app->configdir, tm_get_real_path(app->configdir));
+ SETPTR(app->configdir, utils_get_real_path(app->configdir));
return mkdir_result;
}
Modified: src/plugindata.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -59,7 +59,7 @@ G_BEGIN_DECLS
* @warning You should not test for values below 200 as previously
* @c GEANY_API_VERSION was defined as an enum value, not a macro.
*/
-#define GEANY_API_VERSION 234
+#define GEANY_API_VERSION 235
/* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins
* with GTK3-linked Geany leads to crash */
Modified: src/tagmanager/tm_source_file.c
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -115,6 +115,8 @@ static char *realpath (const char *pathname, char *resolved_path)
of the file.
@param file_name The original file_name
@return A newly allocated string containing the real path to the file. NULL if none is available.
+ @deprecated since 1.29 (ABI 230)
+ @see utils_get_real_path()
*/
GEANY_API_SYMBOL
gchar *tm_get_real_path(const gchar *file_name)
Modified: src/utils.c
29 lines changed, 28 insertions(+), 1 deletions(-)
===================================================================
@@ -37,6 +37,7 @@
#include "sciwrappers.h"
#include "spawn.h"
#include "support.h"
+#include "tm_source_file.h" // for tm_get_real_path()
#include "templates.h"
#include "ui_utils.h"
#include "win32.h"
@@ -1761,7 +1762,7 @@ gboolean utils_is_remote_path(const gchar *path)
/* Remove all relative and untidy elements from the path of @a filename.
* @param filename must be a valid absolute path.
- * @see tm_get_real_path() - also resolves links. */
+ * @see utils_get_real_path() - also resolves links. */
void utils_tidy_path(gchar *filename)
{
GString *str;
@@ -2176,3 +2177,29 @@ void utils_start_new_geany_instance(const gchar *doc_path)
else
g_printerr("Unable to find 'geany'");
}
+
+
+/**
+ * Get a link-dereferenced, absolute version of a file name.
+ *
+ * This is similar to the POSIX `realpath` function when passed a
+ * @c NULL argument.
+ *
+ * @warning This function suffers the same problems as the POSIX
+ * function `realpath()`, namely that it's impossible to determine
+ * a suitable size for the returned buffer, and so it's limited to a
+ * maximum of `PATH_MAX`.
+ *
+ * @param file_name The file name to get the real path of.
+ *
+ * @return A newly-allocated string containing the real path which
+ * should be freed with `g_free()` when no longer needed, or @c NULL
+ * if the real path cannot be obtained.
+ *
+ * @since 1.29 (API 230)
+ */
+GEANY_API_SYMBOL
+gchar *utils_get_real_path(const gchar *file_name)
+{
+ return tm_get_real_path(file_name);
+}
Modified: src/utils.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -211,6 +211,7 @@ gchar *utils_find_open_xml_tag(const gchar sel[], gint size);
const gchar *utils_find_open_xml_tag_pos(const gchar sel[], gint size);
+gchar *utils_get_real_path(const gchar *file_name);
#ifdef GEANY_PRIVATE
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
[View Less]
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <mbrush(a)codebrainz.ca>
Date: Fri, 04 Aug 2017 09:33:40 UTC
Commit: 7261742f8169b19fd5ac7f10a0845a684287e2d9
https://github.com/geany/geany/commit/7261742f8169b19fd5ac7f10a0845a684287e…
Log Message:
-----------
Allow plugins to get the data they set
Modified Paths:
--------------
src/plugindata.h
src/pluginutils.c
Modified: src/plugindata.h
3 …
[View More]lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -59,7 +59,7 @@ G_BEGIN_DECLS
* @warning You should not test for values below 200 as previously
* @c GEANY_API_VERSION was defined as an enum value, not a macro.
*/
-#define GEANY_API_VERSION 233
+#define GEANY_API_VERSION 234
/* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins
* with GTK3-linked Geany leads to crash */
@@ -315,6 +315,7 @@ gboolean geany_plugin_register(GeanyPlugin *plugin, gint api_version,
gboolean geany_plugin_register_full(GeanyPlugin *plugin, gint api_version,
gint min_api_version, gint abi_version,
gpointer data, GDestroyNotify free_func);
+gpointer geany_plugin_get_data(const GeanyPlugin *plugin);
void geany_plugin_set_data(GeanyPlugin *plugin, gpointer data, GDestroyNotify free_func);
/** Convenience macro to register a plugin.
Modified: src/pluginutils.c
18 lines changed, 18 insertions(+), 0 deletions(-)
===================================================================
@@ -570,6 +570,24 @@ void plugin_builder_connect_signals(GeanyPlugin *plugin,
}
+/** Get the additional data that corresponds to the plugin.
+ *
+ * @param plugin The plugin provided by Geany
+ * @return The data corresponding to the plugin or @c NULL if none set.
+ *
+ * @since 1.32 (API 234)
+ *
+ * @see geany_plugin_set_data()
+ */
+gpointer geany_plugin_get_data(const GeanyPlugin *plugin)
+{
+ g_return_val_if_fail (plugin != NULL, NULL);
+ g_return_val_if_fail (PLUGIN_LOADED_OK (plugin->priv), NULL);
+
+ return plugin->priv->cb_data;
+}
+
+
/** Add additional data that corresponds to the plugin.
*
* @p pdata is the pointer going to be passed to the individual plugin callbacks
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
[View Less]
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <mbrush(a)codebrainz.ca>
Date: Fri, 04 Aug 2017 09:22:04 UTC
Commit: a108f9162cc98e501e2458cd8b35c499b7f87384
https://github.com/geany/geany/commit/a108f9162cc98e501e2458cd8b35c499b7f87…
Log Message:
-----------
Re-enable SIGTERM handling
Now that a new enough GLib is available the signal can be
handled cleanly on the main loop using the GSource for Unix …
[View More]signals.
This replaces the illegal SIGTERM handling that was disabled in
fbb89f523af47b35e238678d348cfa98e56c760a.
Closes #1255
Modified Paths:
--------------
src/libmain.c
Modified: src/libmain.c
21 lines changed, 14 insertions(+), 7 deletions(-)
===================================================================
@@ -76,6 +76,10 @@
#include <glib/gstdio.h>
+#ifdef G_OS_UNIX
+# include <glib-unix.h>
+#endif
+
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
@@ -773,16 +777,20 @@ static gint setup_config_dir(void)
return mkdir_result;
}
-/* Signal handling removed since main_quit() uses functions that are
- * illegal in signal handlers
-static void signal_cb(gint sig)
+
+#ifdef G_OS_UNIX
+static gboolean signal_cb(gpointer user_data)
{
+ gint sig = GPOINTER_TO_INT(user_data);
if (sig == SIGTERM)
{
+ geany_debug("Received SIGTERM signal");
main_quit();
}
+ return G_SOURCE_REMOVE;
}
- */
+#endif
+
/* Used for command-line arguments at startup or from socket.
* this will strip any :line:col filename suffix from locale_filename */
@@ -1068,10 +1076,9 @@ gint main_lib(gint argc, gchar **argv)
g_thread_init(NULL);
#endif
- /* removed as signal handling was wrong, see signal_cb()
- signal(SIGTERM, signal_cb); */
-
#ifdef G_OS_UNIX
+ g_unix_signal_add(SIGTERM, signal_cb, GINT_TO_POINTER(SIGTERM));
+
/* ignore SIGPIPE signal for preventing sudden death of program */
signal(SIGPIPE, SIG_IGN);
#endif
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
[View Less]
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <mbrush(a)codebrainz.ca>
Date: Fri, 04 Aug 2017 09:09:45 UTC
Commit: fd38a49b55d7a4bfdb98069ac3bc839bf49d803b
https://github.com/geany/geany/commit/fd38a49b55d7a4bfdb98069ac3bc839bf49d8…
Log Message:
-----------
Add note about data types to HACKING
Closes #1282
Modified Paths:
--------------
HACKING
Modified: HACKING
5 lines changed, 5 insertions(+…
[View More]), 0 deletions(-)
===================================================================
@@ -214,6 +214,11 @@ Coding
to will not be mutated within the function.
* Don't let variable names shadow outer variables - use gcc's -Wshadow
option.
+* Use the strictest possible data type where practical. For example
+ for an enumeration, use the actual enum type rather than just a
+ ``gint``, use a ``gchar`` for individual (ASCII/UTF-8) string
+ characters rather than ``gint``, and use a ``guint`` for integers
+ which cannot be negative rather than ``gint``.
* Do not use G_LIKELY or G_UNLIKELY (except in critical loops). These
add noise to the code with little real benefit.
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
[View Less]
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <mbrush(a)codebrainz.ca>
Date: Fri, 04 Aug 2017 09:09:37 UTC
Commit: 092f2a936af3d2973055d7d4125f19a4a6d8e5c1
https://github.com/geany/geany/commit/092f2a936af3d2973055d7d4125f19a4a6d8e…
Log Message:
-----------
Fixups
Modified Paths:
--------------
HACKING
Modified: HACKING
6 lines changed, 3 insertions(+), 3 deletions(-)
==========================…
[View More]=========================================
@@ -209,9 +209,9 @@ Coding
initialization part of a for loop.
* Local variables that will not be modified should be marked as ``const``
to indicate intention. This allows the compiler to give a warning if
- part of the code accidentally tries to change the value. This does not
- apply to non-pointer parameters where it needlessly exposes the
- implementation and it's obvious a copy is made anyway.
+ part of the code accidentally tries to change the value.
+* Pointer parameters should be marked ``const`` if the value they point
+ to will not be mutated within the function.
* Don't let variable names shadow outer variables - use gcc's -Wshadow
option.
* Do not use G_LIKELY or G_UNLIKELY (except in critical loops). These
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
[View Less]