Warning: Declaration of action_plugin_syntaxhighlighter3_action::register(Doku_Event_Handler &$controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler$controller) in /s/chopin/e/proj/AlphaZ/public_html/wiki/lib/plugins/syntaxhighlighter3/action/action.php on line 112
tutorial_external_function [AlphaZ]

# AlphaZ

### Site Tools

tutorial_external_function

# Differences

This shows you the differences between two versions of the page.

 tutorial_external_function [2017/04/19 12:44]waruna [Example] tutorial_external_function [2017/04/19 13:25] (current)waruna [Example] Both sides previous revision Previous revision 2017/04/19 13:25 waruna [Example] 2017/04/19 13:03 waruna [Example] 2017/04/19 12:44 waruna [Example] 2014/05/30 11:49 external edit Next revision Previous revision 2017/04/19 13:25 waruna [Example] 2017/04/19 13:03 waruna [Example] 2017/04/19 12:44 waruna [Example] 2014/05/30 11:49 external edit Line 23: Line 23: ====Example==== ====Example==== Let's take a simple example with two external functions. One is a function that computes square root, and another is some user function that returns float given an integer. Let's take a simple example with two external functions. One is a function that computes square root, and another is some user function that returns float given an integer. - + float sqrt(float);​ float sqrt(float);​ float userfunc(int);​ float userfunc(int);​ Line 40: Line 40: Generate code with the following script. Generate code with the following script. - + prog = ReadAlphabets("​exFuncExample.ab"​);​ prog = ReadAlphabets("​exFuncExample.ab"​);​ Line 51: Line 51: Along with the two C codes for ''​WriteC''​ and ''​Wrapper'',​ you will find a header file, ''​external_functions.h''​ with the following contents. Along with the two C codes for ''​WriteC''​ and ''​Wrapper'',​ you will find a header file, ''​external_functions.h''​ with the following contents. - + //External functions //External functions /​***PROTECTED REGION ID(external_functions) ENABLED START***/ /​***PROTECTED REGION ID(external_functions) ENABLED START***/ Line 63: Line 63: \\ \\ The other function needs a body, and it can be anything as long as it returns a floating point value. An example of the completed header file is shown below. The other function needs a body, and it can be anything as long as it returns a floating point value. An example of the completed header file is shown below. - <​sxh ​cttpp; gutter:false> + <​sxh ​c; gutter:true> //External functions //External functions /​***PROTECTED REGION ID(external_functions) ENABLED START***/ /​***PROTECTED REGION ID(external_functions) ENABLED START***/