From 80ac9273eedc2174428e68f7772d3e7605b0a345 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Tue, 14 Jul 2009 13:26:19 +0000 Subject: [PATCH] Note geanyfunctions.h must be included last. Use triple quoted text for file header. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3965 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- plugins/geanyfunctions.h | 2 ++ plugins/genapi.py | 23 +++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/plugins/geanyfunctions.h b/plugins/geanyfunctions.h index 42fb5d57..afad5ee5 100644 --- a/plugins/geanyfunctions.h +++ b/plugins/geanyfunctions.h @@ -3,6 +3,8 @@ * @file geanyfunctions.h @ref geany_functions wrappers. * This allows the use of normal API function names in plugins. * You need to declare the @ref geany_functions symbol yourself. + * + * Note: This must be included after all other API headers. */ #ifndef GEANY_FUNCTIONS_H diff --git a/plugins/genapi.py b/plugins/genapi.py index 81499312..8ffc4ddd 100755 --- a/plugins/genapi.py +++ b/plugins/genapi.py @@ -55,6 +55,20 @@ def get_api_tuple(str): return 'p_' + m.group(1), m.group(2) +header = \ +'''/* This file is generated automatically by genapi.py - do not edit. + * + * @file %s @ref geany_functions wrappers. + * This allows the use of normal API function names in plugins. + * You need to declare the @ref geany_functions symbol yourself. + * + * Note: This must be included after all other API headers. + */ + +#ifndef GEANY_FUNCTIONS_H +#define GEANY_FUNCTIONS_H +''' + if __name__ == "__main__": outfile = 'geanyfunctions.h' @@ -63,15 +77,12 @@ if __name__ == "__main__": sys.exit("No function names read!") f = open(outfile, 'w') - print >>f, '/* This file is generated automatically by genapi.py - do not edit.\n *\n' +\ - ' * @file %s @ref geany_functions wrappers.\n' % (outfile) +\ - ' * This allows the use of normal API function names in plugins.\n' +\ - ' * You need to declare the @ref geany_functions symbol yourself.\n */\n' - print >>f, '#ifndef GEANY_FUNCTIONS_H' - print >>f, '#define GEANY_FUNCTIONS_H\n' + print >>f, header % (outfile) + for fname in fnames: ptr, name = get_api_tuple(fname) print >>f, '#define %s \\\n\tgeany_functions->%s->%s' % (fname, ptr, name) + print >>f, '\n#endif' f.close