Allow generating macros for functions with digits in the name.

Don't generate dummyprefix_scintilla_send_message and lookup_widget
macros.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3312 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2008-12-04 13:55:11 +00:00
parent 5e85300f65
commit 2d015b6fb2
4 changed files with 20 additions and 17 deletions

View File

@ -6,6 +6,10 @@
Deprecate pluginmacros.h in favour of geanyfunctions.h. Deprecate pluginmacros.h in favour of geanyfunctions.h.
Move geany macro to plugindata.h. Move geany macro to plugindata.h.
Remove geanyfunctions.h dependency on pluginmacros.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 <nick(dot)treleaven(at)btinternet(dot)com> 2008-12-03 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -53,8 +53,6 @@ You need to declare the @ref geany_functions symbol yourself. */
geany_functions->p_scintilla->send_message geany_functions->p_scintilla->send_message
#define scintilla_new \ #define scintilla_new \
geany_functions->p_scintilla->new geany_functions->p_scintilla->new
#define dummyprefix_scintilla_send_message \
geany_functions->p_dummyprefix->scintilla_send_message
#define sci_cmd \ #define sci_cmd \
geany_functions->p_sci->cmd geany_functions->p_sci->cmd
#define sci_start_undo_action \ #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 geany_functions->p_utils->get_file_list
#define utils_write_file \ #define utils_write_file \
geany_functions->p_utils->write_file geany_functions->p_utils->write_file
#define utils_get_locale_from_utf \ #define utils_get_locale_from_utf8 \
geany_functions->p_utils->get_locale_from_utf geany_functions->p_utils->get_locale_from_utf8
#define utils_get_utf \ #define utils_get_utf8_from_locale \
geany_functions->p_utils->get_utf geany_functions->p_utils->get_utf8_from_locale
#define utils_remove_ext_from_filename \ #define utils_remove_ext_from_filename \
geany_functions->p_utils->remove_ext_from_filename geany_functions->p_utils->remove_ext_from_filename
#define utils_mkdir \ #define utils_mkdir \
@ -185,8 +183,6 @@ You need to declare the @ref geany_functions symbol yourself. */
geany_functions->p_dialogs->show_msgbox geany_functions->p_dialogs->show_msgbox
#define dialogs_show_save_as \ #define dialogs_show_save_as \
geany_functions->p_dialogs->show_save_as geany_functions->p_dialogs->show_save_as
#define lookup_widget \
geany_functions->p_lookup->widget
#define msgwin_status_add \ #define msgwin_status_add \
geany_functions->p_msgwin->status_add geany_functions->p_msgwin->status_add
#define msgwin_compiler_add_fmt \ #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 geany_functions->p_msgwin->clear_tab
#define msgwin_switch_tab \ #define msgwin_switch_tab \
geany_functions->p_msgwin->switch_tab geany_functions->p_msgwin->switch_tab
#define encodings_convert_to_utf \ #define encodings_convert_to_utf8 \
geany_functions->p_encodings->convert_to_utf geany_functions->p_encodings->convert_to_utf8
#define encodings_convert_to_utf \ #define encodings_convert_to_utf8_from_charset \
geany_functions->p_encodings->convert_to_utf geany_functions->p_encodings->convert_to_utf8_from_charset
#define encodings_get_charset_from_index \ #define encodings_get_charset_from_index \
geany_functions->p_encodings->get_charset_from_index geany_functions->p_encodings->get_charset_from_index
#define keybindings_send_command \ #define keybindings_send_command \

View File

@ -40,7 +40,7 @@ def get_function_names():
l = f.readline() l = f.readline()
if l == "": if l == "":
break; break;
m = re.match("^\t&([a-z_]+)", l) m = re.match("^\t&([a-z][a-z0-9_]+)", l)
if m: if m:
s = m.group(1) s = m.group(1)
if not s.endswith('_funcs'): if not s.endswith('_funcs'):
@ -51,7 +51,7 @@ def get_function_names():
return names return names
def get_api_tuple(str): 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) return 'p_' + m.group(1), m.group(2)

View File

@ -145,10 +145,10 @@ static ScintillaFuncs scintilla_funcs = {
}; };
/* Macro to prevent a duplicate macro being generated in geanyfunctions.h */ /* 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 = { static SciFuncs sci_funcs = {
&dummyprefix_scintilla_send_message, &_scintilla_send_message_macro,
&sci_cmd, &sci_cmd,
&sci_start_undo_action, &sci_start_undo_action,
&sci_end_undo_action, &sci_end_undo_action,
@ -228,9 +228,12 @@ static DialogFuncs dialog_funcs = {
&dialogs_show_save_as &dialogs_show_save_as
}; };
/* Macro to prevent confusing macro being generated in geanyfunctions.h */
#define _lookup_widget_macro lookup_widget
/* deprecated */ /* deprecated */
static SupportFuncs support_funcs = { static SupportFuncs support_funcs = {
&lookup_widget &_lookup_widget_macro
}; };
static MsgWinFuncs msgwin_funcs = { static MsgWinFuncs msgwin_funcs = {