contents   index   previous   next



sePrecompile

 

syntax:

   ubyte *

sePrecompile(secontext se,

             const void *to_interpret,

             int interp_type,

             sememcount *len,

             struct seEvalParams *params); 

where:

se the context to precompile in

 

to_interpret the text of the script or the filename to compile

 

interp_type how to interpret to_interpret, either SE_TEXT or SE_FILE

 

len an output parameter, the length of the returned bytecodes in bytes.

 

params used to get the virtual file and line number only.

 

return:

The bytecodes

 

description:

This routine compiles a script into the corresponding bytecodes. The file to precompile is specified exactly like seEval and must be either SE_TEXT or SE_FILE. The given file is precompiled and the resulting bytecodes are returned. In addition, len is filled in with the size of the resulting bytecodes. Usually, these bytecodes are then written to disk for use later. The bytecodes should be treated as an array of *len bytes.

 

The bytecodes can be passed as the item to evaluate in a later seEval call with SE_PRECOMP as the type. The bytecodes must be freed using seFreeBytecodes. Although the script is precompiled, it is not added to the context or run. The context will be unchanged as a result of this call.

 

You can provide the optional params structure. Only the virtual filename and linenumber members of the structure are used.

 

see:

seFreeBytecodes

 


seFreeBytecodes