pike.git / src / dynamic_load.c

version» Context lines:

pike.git/src/dynamic_load.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: dynamic_load.c,v 1.89 2006/07/05 19:06:32 mast Exp $ + || $Id: dynamic_load.c,v 1.90 2008/04/14 10:14:38 grubba Exp $   */      #ifdef TESTING   #define NO_PIKE_INCLUDES   #define CREATE_MAIN   #define NO_PIKE_GUTS   #endif      #ifndef NO_PIKE_INCLUDES   # include "global.h"
pike.git/src/dynamic_load.c:382:    struct lex lex;    int compilation_depth;   };      static void cleanup_compilation(struct compilation_save *save)   {    struct program *p = end_program();    if (p) {    free_program(p);    } -  free_string(lex.current_file); +     compilation_depth = save->compilation_depth; -  lex = save->lex; +    }      /*! @decl program load_module(string module_name)    *!    *! Load a binary module.    *!    *! This function loads a module written in C or some other language    *! into Pike. The module is initialized and any programs or constants    *! defined will immediately be available.    *!
pike.git/src/dynamic_load.c:531:       new_module=ALLOC_STRUCT(module_list);    new_module->next=dynamic_module_list;    dynamic_module_list=new_module;    new_module->module=module;    copy_shared_string(new_module->name, Pike_sp[-args].u.string);    new_module->module_prog = NULL;    new_module->init=init;    new_module->exit=exit;    -  save.lex = lex; -  lex.current_line=1; -  lex.current_file=make_shared_string("-"); +  enter_compiler(new_module->name, 1); +     save.compilation_depth=compilation_depth;    compilation_depth=-1;    start_new_program();       global_callable_flags|=CALLABLE_DYNAMIC;      #ifdef PIKE_DEBUG    { struct svalue *save_sp=Pike_sp;   #endif    SET_ONERROR(err, cleanup_compilation, &save);
pike.git/src/dynamic_load.c:563: Inside #if defined(PIKE_DEBUG)
   if(Pike_sp != save_sp)    Pike_fatal("load_module(%s) left %ld droppings on stack!\n",    module_name->str,    PTRDIFF_T_TO_LONG(Pike_sp - save_sp));    }   #endif       pop_n_elems(args);    {    struct program *p = end_program(); -  free_string(lex.current_file); +  exit_compiler();    compilation_depth = save.compilation_depth; -  lex = save.lex; +     if (p) {    if (   #if 0    p->num_identifier_references   #else /* !0 */    1   #endif /* 0 */    ) {    push_program(p);    add_ref(new_module->module_prog = Pike_sp[-1].u.program);