diff --git a/ChangeLog b/ChangeLog index 39a605fd8..cd4c490d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ Deprecate pluginmacros.h in favour of geanyfunctions.h. Move geany macro to plugindata.h. Remove geanyfunctions.h dependency on pluginmacros.h. + * src/plugins.c, plugins/geanyfunctions.h, plugins/genapi.py: + Allow generating macros for functions with digits in the name. + Don't generate dummyprefix_scintilla_send_message and lookup_widget + macros. 2008-12-03 Nick Treleaven diff --git a/plugins/geanyfunctions.h b/plugins/geanyfunctions.h index a430dd366..87ddf530f 100644 --- a/plugins/geanyfunctions.h +++ b/plugins/geanyfunctions.h @@ -53,8 +53,6 @@ You need to declare the @ref geany_functions symbol yourself. */ geany_functions->p_scintilla->send_message #define scintilla_new \ geany_functions->p_scintilla->new -#define dummyprefix_scintilla_send_message \ - geany_functions->p_dummyprefix->scintilla_send_message #define sci_cmd \ geany_functions->p_sci->cmd #define sci_start_undo_action \ @@ -137,10 +135,10 @@ You need to declare the @ref geany_functions symbol yourself. */ geany_functions->p_utils->get_file_list #define utils_write_file \ geany_functions->p_utils->write_file -#define utils_get_locale_from_utf \ - geany_functions->p_utils->get_locale_from_utf -#define utils_get_utf \ - geany_functions->p_utils->get_utf +#define utils_get_locale_from_utf8 \ + geany_functions->p_utils->get_locale_from_utf8 +#define utils_get_utf8_from_locale \ + geany_functions->p_utils->get_utf8_from_locale #define utils_remove_ext_from_filename \ geany_functions->p_utils->remove_ext_from_filename #define utils_mkdir \ @@ -185,8 +183,6 @@ You need to declare the @ref geany_functions symbol yourself. */ geany_functions->p_dialogs->show_msgbox #define dialogs_show_save_as \ geany_functions->p_dialogs->show_save_as -#define lookup_widget \ - geany_functions->p_lookup->widget #define msgwin_status_add \ geany_functions->p_msgwin->status_add #define msgwin_compiler_add_fmt \ @@ -197,10 +193,10 @@ You need to declare the @ref geany_functions symbol yourself. */ geany_functions->p_msgwin->clear_tab #define msgwin_switch_tab \ geany_functions->p_msgwin->switch_tab -#define encodings_convert_to_utf \ - geany_functions->p_encodings->convert_to_utf -#define encodings_convert_to_utf \ - geany_functions->p_encodings->convert_to_utf +#define encodings_convert_to_utf8 \ + geany_functions->p_encodings->convert_to_utf8 +#define encodings_convert_to_utf8_from_charset \ + geany_functions->p_encodings->convert_to_utf8_from_charset #define encodings_get_charset_from_index \ geany_functions->p_encodings->get_charset_from_index #define keybindings_send_command \ diff --git a/plugins/genapi.py b/plugins/genapi.py index d79688308..1c3cdf646 100755 --- a/plugins/genapi.py +++ b/plugins/genapi.py @@ -40,7 +40,7 @@ def get_function_names(): l = f.readline() if l == "": break; - m = re.match("^\t&([a-z_]+)", l) + m = re.match("^\t&([a-z][a-z0-9_]+)", l) if m: s = m.group(1) if not s.endswith('_funcs'): @@ -51,7 +51,7 @@ def get_function_names(): return names def get_api_tuple(str): - m = re.match("^([a-z]+)_([a-z_]+)$", str) + m = re.match("^([a-z]+)_([a-z][a-z0-9_]+)$", str) return 'p_' + m.group(1), m.group(2) diff --git a/src/plugins.c b/src/plugins.c index 928f80b96..07fb6a42f 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -145,10 +145,10 @@ static ScintillaFuncs scintilla_funcs = { }; /* Macro to prevent a duplicate macro being generated in geanyfunctions.h */ -#define dummyprefix_scintilla_send_message scintilla_send_message +#define _scintilla_send_message_macro scintilla_send_message static SciFuncs sci_funcs = { - &dummyprefix_scintilla_send_message, + &_scintilla_send_message_macro, &sci_cmd, &sci_start_undo_action, &sci_end_undo_action, @@ -228,9 +228,12 @@ static DialogFuncs dialog_funcs = { &dialogs_show_save_as }; +/* Macro to prevent confusing macro being generated in geanyfunctions.h */ +#define _lookup_widget_macro lookup_widget + /* deprecated */ static SupportFuncs support_funcs = { - &lookup_widget + &_lookup_widget_macro }; static MsgWinFuncs msgwin_funcs = {