View Single Post
Old 05-11-2010, 07:09 PM   #9
igorsk
Wizard
igorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfolded
 
Posts: 3,443
Karma: 52235
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
The function table is filled in a what I call "bind function" pointed by the structure at the fskGrammar symbol. In case of ebook.so, fskGrammar -> ebookGrammar -> "bind function". That function fills the "@" array with wrapped functions, constructors and destructors, usually taken from a table with the entries of the following format:
Code:
struct fskNativeFn
{
  uint16_t type;  // 0: function, 1: constructor, 2: host object destructor
  uint16_t nargs; // number of arguments for function or constructor
  void *funcptr;
}
For example, in 600's ebook.so function @[0] is eBook_checkScreenLock, function @[1] is eBook_debugProcess and so on.
The actual functions all call into the Fsk bytecode machine and can be pretty hard to follow.
igorsk is offline   Reply With Quote