pike.git / src / modules / _Stdio / sendfile.c

version» Context lines:

pike.git/src/modules/_Stdio/sendfile.c:147:   /*    * Globals    */      static struct program *pike_sendfile_prog = NULL;      /*    * Struct init code.    */    - static void init_pike_sendfile(struct object *UNUSED(o)) - { -  memset(THIS, 0, sizeof(struct pike_sendfile)); -  -  /* callback doesn't actually need to be initialized since it is a -  * mapped variable, but since we just zapped it with zeroes we need -  * to set the type to T_INT again.. /Hubbe -  */ -  SET_SVAL(THIS->callback, T_INT, NUMBER_NUMBER, integer, 0); - } -  +    static void exit_pike_sendfile(struct object *UNUSED(o))   {    SF_DFPRINTF((stderr, "sendfile: Exiting...\n"));       if (THIS->iovs) {    free(THIS->iovs);    THIS->iovs = NULL;    }    if (THIS->buffer) {    free(THIS->buffer);
pike.git/src/modules/_Stdio/sendfile.c:1214: Inside #if defined(_REENTRANT)
   PIKE_MAP_VARIABLE("_args", OFFSETOF(pike_sendfile, args),    tArray, T_ARRAY, 0);    PIKE_MAP_VARIABLE("_callback", OFFSETOF(pike_sendfile, callback),    tFuncV(tInt,tMix,tVoid), T_MIXED, 0);       /* function(array(string),object,int,int,array(string),object,function(int,mixed...:void),mixed...:void) */    ADD_FUNCTION("create", sf_create,    tFuncV(tArr(tStr) tObj tInt tInt tArr(tStr) tObj    tFuncV(tInt, tMix, tVoid), tMix, tVoid), 0);    -  set_init_callback(init_pike_sendfile); +     set_exit_callback(exit_pike_sendfile);       pike_sendfile_prog = end_program();    add_program_constant("sendfile", pike_sendfile_prog, 0);   #endif /* _REENTRANT */   }      void exit_stdio_sendfile(void)   {   #ifdef _REENTRANT    if (pike_sendfile_prog) {    free_program(pike_sendfile_prog);    pike_sendfile_prog = NULL;    }   #endif /* _REENTRANT */   }      /*! @endmodule    */