diff --git a/PLUGINS.html b/PLUGINS.html index 4f8a70ed..bbe1a1de 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -183,6 +183,40 @@ its memory. You don't need to worry about the details behind all this.
If your plugin requires additional source files, simply add them to your plugin's source directory and adjust the Makefile accordingly. +
+
+Header files usually contain preprocessor statements that prevent the same
+file (or rather its contents, to be precise) from being included more than once, like
+
+
+ +The example shown here is the way VDR does this in its core source files. +It takes the header file's name, converts it to all uppercase, replaces the +dot with an underline and preceedes the whole thing with two underlines. +The GNU library header files do this pretty much the same way, except that they +usually precede the name with only one underline (there are exceptions, though). + +As long as you make shure that none of your plugin's header files will be named +like one of VDR's header files, you can use the same method as VDR. However, +if you want to name a header file like one that is already existing in VDR's +source (i18n.h would be a possible candidate for this), you may want +to make sure that the macros used here don't clash. How you do this is completely +up to you. You could, for instance, prepend the macro with a 'P', as in +P__I18N_H, or leave out the trailing _H, as in __I18N, +or use a completely different way to make sure a header file is included only once. + +The 'hello' example that comes with VDR makes use of internationalization +and implements a file named i18n.h. To make sure it won't clash with VDR's +i18n.h it uses the macro _I18N__H (one underline at the beginning +and two replacing the dot). + |