From 09f1bae2407ef6ca786bde06a620debea1b40dde Mon Sep 17 00:00:00 2001 From: batrick Date: Fri, 24 Oct 2008 17:35:01 +0000 Subject: [PATCH] Added C module NSEDoc generation documentation. --- docs/scripting.xml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/scripting.xml b/docs/scripting.xml index 0bdbd0b82..a1f93bfbd 100644 --- a/docs/scripting.xml +++ b/docs/scripting.xml @@ -1949,6 +1949,42 @@ categories = {"discovery", "external"} from the contents of a comment. @release has not been used with NSEDoc. --> + + NSE Documentation for C Modules + + NSEDoc documentation can be written for libraries as well as scripts. + While Lua modules can be documented in much the same way as your + scripts, a C module requires special consideration. You must write + a ".luadoc" file to accompany the C module in order for it to be + documented. The file will list all functions for the C module as though + they were written in Lua. You may however remove certain syntactical + structures (particularly, end) when writing this + document. The following example demonstrates how documentation was + written for the C bit module. + + + + Documentation for the C "bit" module + +--- Return the one's complement of a. +-- @param a Number. +-- @return The one's complement of a. +function bit.bnot(a) + +--- Returns the bitwise and of all its arguments. +-- @param ... A variable number of Numbers to and. +-- @return The anded result. +function bit.band(...) + + + + It is important to note that this documentation is being written for + a simple documentation parser and not Lua. The functions, + bit.bnot and bit.band, are placed there to assist in generating the + documentation. You may use the @class tag to also help the parser + know what it is you are documenting, especially for tables. + +