This macro, contained
within the mm_jsapi.h header, holds definitions necessary for the integration of the C-level extension
into Dreamweaver??™s JavaScript API. You must define MM_STATE only once.
Each library can be composed of numerous functions available to be called from within Dreamweaver. For
Dreamweaver??™s JavaScript interpreter to recognize the functions, each one must be declared in a special
function, JS_DefineFunction(), defined in the library. All the JS_DefineFunction() functions are
contained in the MM_Init() function. The syntax for JS_DefineFunction() is as follows:
JS_DefineFunction(jsName, call, nArgs)
where jsName is the JavaScript name for the function, call is a pointer to a C-level function, and nArgs is the
number of arguments that the function can expect. For example, the MM_Init() function for DWfile
might appear as follows:
void
MM_Init() {
JS_DefineFunction(???exist???, exist, 1);
JS_DefineFunction(???read???, exist, 1);
JS_DefineFunction(???write???, exist, 2);
}
Because MM_Init() depends on definitions included in the C header mm_jsapi.h, it must be called after
the header is included.
If you??™re building cross-platform C-level extensions, consider using Metrowerks CodeWarrior
integrated development environment.
Pages:
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780