Jason McKesson avatar Jason McKesson committed 7da03c6

Fixed issue with program listings all on one line.

Comments (0)

Files changed (1)

Style_Creation.wiki

 A good way to understand the nature of the functions is to show how the functions will be called by the system to build the header/source file. Here is the structure of a header file, as far as the system is concerned. Each function call represents the system calling that function with those parameters one or more times.
 
 {{{
-header.CreateFile(basename, options) //Return the name of the file. header.WriteBeginIncludeGuard(hFile, spec, options) header.WriteStdTypedefs(hFile, specData, spec, options) header.WriteSpecTypedefs(hFile, specData, spec, options) header.WriteBeginDecl(hFile, spec, options) //For each user-specified extension header.WriteExtVariableDecl(hFile, extName, specData, spec, options) header.WriteExtVariableDecl(hFile, ..., specData, spec, options) ... header.WriteBeginEnumDeclBlock(hFile, spec, options) //For each enum to be written, in order of extensions/core //Will call one or the other. header.WriteEnumDecl(hFile, enum, enumTable, spec, options) header.WriteEnumPrevDecl(hFile, enum, enumTable, spec, options, extName) header.WriteEndEnumDeclBlock(hFile, spec, options) header.WriteBeginFuncDeclBlock(hFile, spec, options) //For each user-specified extension: header.WriteBeginExtFuncDeclBlock(hFile, extName, spec, options) //For each function in that extension header.WriteFuncDecl(hFile, func, typemap, spec, options) header.WriteFuncDecl(hFile, ..., typemap, spec, options) ... header.WriteEndExtFuncDeclBlock(hFile, extName, spec, options) //For each version, where applicable: //For each core extension that was not user-specified: header.WriteBeginExtFuncDeclBlock(hFile, extName, spec, options) header.WriteFuncDecl(hFile, func, typemap, spec, options) header.WriteFuncDecl(hFile, ..., typemap, spec, options) ... header.WriteEndExtFuncDeclBlock(hFile, extName, spec, options) //For each core function from this version *not* in a core extension. header.WriteFuncDecl(hFile, func, typemap, spec, options) header.WriteFuncDecl(hFile, ..., typemap, spec, options) ... header.WriteBeginFuncDeclBlock(hFile, spec, options) header.WriteUtilityDecls(hFile, spec, options) header.WriteMainLoaderFuncDecl(hFile, spec, options) header.WriteVersioningFuncDecls(hFile, spec, options) //Only if the spec has versions. header.WriteEndDecl(hFile, spec, options) header.WriteEndIncludeGuard(hFile, spec, options)
+header.CreateFile(basename, options) //Return the name of the file.
+
+header.WriteBeginIncludeGuard(hFile, spec, options)
+  header.WriteStdTypedefs(hFile, specData, spec, options)
+  header.WriteSpecTypedefs(hFile, specData, spec, options)
+
+
+  header.WriteBeginDecl(hFile, spec, options)
+
+    //For each user-specified extension
+    header.WriteExtVariableDecl(hFile, extName, specData, spec, options)
+    header.WriteExtVariableDecl(hFile, ..., specData, spec, options)
+    ...
+
+    header.WriteBeginEnumDeclBlock(hFile, spec, options)
+
+      //For each enum to be written, in order of extensions/core
+      //Will call one or the other.
+      header.WriteEnumDecl(hFile, enum, enumTable, spec, options)
+      header.WriteEnumPrevDecl(hFile, enum, enumTable, spec, options, extName)
+
+    header.WriteEndEnumDeclBlock(hFile, spec, options)
+
+
+    header.WriteBeginFuncDeclBlock(hFile, spec, options)
+    
+      //For each user-specified extension:
+      header.WriteBeginExtFuncDeclBlock(hFile, extName, spec, options)
+      
+        //For each function in that extension
+        header.WriteFuncDecl(hFile, func, typemap, spec, options)
+        header.WriteFuncDecl(hFile, ..., typemap, spec, options)
+        ...
+      
+      header.WriteEndExtFuncDeclBlock(hFile, extName, spec, options)
+      
+      //For each version, where applicable:
+        //For each core extension that was not user-specified:
+        header.WriteBeginExtFuncDeclBlock(hFile, extName, spec, options)
+          
+          header.WriteFuncDecl(hFile, func, typemap, spec, options)
+          header.WriteFuncDecl(hFile, ..., typemap, spec, options)
+          ...
+          
+        header.WriteEndExtFuncDeclBlock(hFile, extName, spec, options)
+
+        //For each core function from this version *not* in a core extension.
+        header.WriteFuncDecl(hFile, func, typemap, spec, options)
+        header.WriteFuncDecl(hFile, ..., typemap, spec, options)
+        ...
+
+    header.WriteBeginFuncDeclBlock(hFile, spec, options)
+    
+    header.WriteUtilityDecls(hFile, spec, options)
+    header.WriteMainLoaderFuncDecl(hFile, spec, options)
+    header.WriteVersioningFuncDecls(hFile, spec, options) //Only if the spec has versions.
+
+  header.WriteEndDecl(hFile, spec, options)
+  
+header.WriteEndIncludeGuard(hFile, spec, options)
 }}}
 
 And here is the equivalent structure for the source files:
 
 {{{
-source.CreateFile(basename, options) //Name of the file. source.WriteIncludes(hFile, spec, options) #include "HEADER_FILENAME" source.WriteBeginDef(hFile, spec, options) //For each user-specified extension source.WriteExtVariableDef(hFile, extName, specData, spec, options) source.WriteExtVariableDef(hFile, ..., specData, spec, options) ... //For each user-specified extension: source.WriteBeginExtFuncDefBlock(hFile, extName, spec, options) //For each function in the extension: source.WriteFuncDef(hFile, func, typemap, spec, options) source.WriteFuncDef(hFile, ..., typemap, spec, options) ... source.WriteBeginExtLoaderBlock(hFile, extName, spec, options) //For each function in the extension source.WriteCoreFuncLoader(hFile, func, typemap, spec, options) source.WriteEndExtLoaderBlock(hFile, extName, spec, options) source.WriteEndExtFuncDefBlock(hFile, extName, spec, options) source.WriteBeginCoreFuncDefBlock(hFile, version, spec, options) //For each version, where applicable //For each core extension in that version which was not user-specified { //For each function in that core extension: source.WriteCoreFuncLoader(hFile, func, typemap, spec, options) source.WriteCoreFuncLoader(hFile, .., typemap, spec, options) ... } //For each function from that version not in a core extension: source.WriteCoreFuncLoader(hFile, func, typemap, spec, options) source.WriteCoreFuncLoader(hFile, .., typemap, spec, options) ... source.WriteBeginCoreLoaderBlock(hFile, version, spec, options) //For each version, where applicable //For each core extension in that version which was not user-specified { //For each function in that core extension: source.WriteCoreFuncLoader(hFile, func, typemap, spec, options) } //For each function from that version *not* in a core extension: source.WriteCoreFuncLoader(hFile, func, typemap, spec, options) source.WriteEndCoreLoaderBlock(hFile, version, spec, options) source.WriteEndCoreFuncDefBlock(hFile, version, spec, options) source.WriteUtilityDefs(hFile, specData, spec, options) source.WriteMainLoaderFunc(hFile, specData, spec, options) source.WriteVersioningFuncs(hFile, specData, spec, options) //Only if the spec has versions. source.WriteEndDef(hFile, spec, options)
+source.CreateFile(basename, options) //Name of the file.
+
+source.WriteIncludes(hFile, spec, options)
+#include "HEADER_FILENAME"
+
+source.WriteBeginDef(hFile, spec, options)
+
+  //For each user-specified extension
+  source.WriteExtVariableDef(hFile, extName, specData, spec, options)
+  source.WriteExtVariableDef(hFile, ..., specData, spec, options)
+  ...
+  
+  //For each user-specified extension:
+  source.WriteBeginExtFuncDefBlock(hFile, extName, spec, options)
+    //For each function in the extension:
+    source.WriteFuncDef(hFile, func, typemap, spec, options)
+    source.WriteFuncDef(hFile, ..., typemap, spec, options)
+    ...
+    
+    source.WriteBeginExtLoaderBlock(hFile, extName, spec, options)
+      //For each function in the extension
+      source.WriteCoreFuncLoader(hFile, func, typemap, spec, options)
+    source.WriteEndExtLoaderBlock(hFile, extName, spec, options)
+    
+  source.WriteEndExtFuncDefBlock(hFile, extName, spec, options)
+  
+  source.WriteBeginCoreFuncDefBlock(hFile, version, spec, options)
+    //For each version, where applicable
+      //For each core extension in that version which was not user-specified
+      {
+        //For each function in that core extension:
+        source.WriteCoreFuncLoader(hFile, func, typemap, spec, options)
+        source.WriteCoreFuncLoader(hFile, .., typemap, spec, options)
+        ...
+      }
+      
+      //For each function from that version not in a core extension:
+      source.WriteCoreFuncLoader(hFile, func, typemap, spec, options)
+      source.WriteCoreFuncLoader(hFile, .., typemap, spec, options)
+      ...
+
+    source.WriteBeginCoreLoaderBlock(hFile, version, spec, options)
+      //For each version, where applicable
+        //For each core extension in that version which was not user-specified
+        {
+          //For each function in that core extension:
+          source.WriteCoreFuncLoader(hFile, func, typemap, spec, options)
+        }
+          
+        //For each function from that version *not* in a core extension:
+        source.WriteCoreFuncLoader(hFile, func, typemap, spec, options)
+    source.WriteEndCoreLoaderBlock(hFile, version, spec, options)
+  source.WriteEndCoreFuncDefBlock(hFile, version, spec, options)
+  
+
+  source.WriteUtilityDefs(hFile, specData, spec, options)
+  source.WriteMainLoaderFunc(hFile, specData, spec, options)
+  source.WriteVersioningFuncs(hFile, specData, spec, options) //Only if the spec has versions.
+
+source.WriteEndDef(hFile, spec, options)
 }}}
 
 ==Style function reference==
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.