1 #include <ming.h>
2 #include <ch.h>
3 
4 static ChInterp_t interp;
5 static void *fileOutputMethod_funptr;
6 static void fileOutputMethod_funarg(byte b, void *data);
7 
SWFMovie_output_chdl(void * varg)8 EXPORTCH int SWFMovie_output_chdl(void *varg) {
9     va_list ap;
10     SWFMovie movie;
11     SWFByteOutputMethod method;
12     void *data;
13   //  int level;
14     int retval;
15 
16     Ch_VaStart(interp, ap, varg);
17     movie = Ch_VaArg(interp, ap, SWFMovie);
18     method = Ch_VaArg(interp, ap, SWFByteOutputMethod);
19     if(method != NULL)
20     {
21        fileOutputMethod_funptr = (void *)method;
22        method = (SWFByteOutputMethod)fileOutputMethod_funarg;
23     }
24     data = Ch_VaArg(interp, ap, void *);
25     /* level = Ch_VaArg(interp, ap, int); */
26     retval = SWFMovie_output(movie, method, data); //, level);
27     Ch_VaEnd(interp, ap);
28     return retval;
29 }
30 
fileOutputMethod_funarg(byte b,void * data)31 static void fileOutputMethod_funarg(byte b, void *data)
32 {
33     Ch_CallFuncByAddr(interp, fileOutputMethod_funptr, NULL, b, data);
34 }
35