SF.net SVN: geany:[3965] trunk/plugins

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Jul 14 13:26:19 UTC 2009


Revision: 3965
          http://geany.svn.sourceforge.net/geany/?rev=3965&view=rev
Author:   ntrel
Date:     2009-07-14 13:26:19 +0000 (Tue, 14 Jul 2009)

Log Message:
-----------
Note geanyfunctions.h must be included last.
Use triple quoted text for file header.

Modified Paths:
--------------
    trunk/plugins/geanyfunctions.h
    trunk/plugins/genapi.py

Modified: trunk/plugins/geanyfunctions.h
===================================================================
--- trunk/plugins/geanyfunctions.h	2009-07-14 13:05:51 UTC (rev 3964)
+++ trunk/plugins/geanyfunctions.h	2009-07-14 13:26:19 UTC (rev 3965)
@@ -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

Modified: trunk/plugins/genapi.py
===================================================================
--- trunk/plugins/genapi.py	2009-07-14 13:05:51 UTC (rev 3964)
+++ trunk/plugins/genapi.py	2009-07-14 13:26:19 UTC (rev 3965)
@@ -55,6 +55,20 @@
 	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 @@
 		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
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list