pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:4030:    while(1)    Builtin.__backend(3600.0);    };    master()->handle_error(err);    }   }      #if constant(thread_local)   object inhibit_compile_errors = thread_local();    - void set_inhibit_compile_errors(mixed f) + //! Set the compile error, warning and exception behaviour. + //! + //! @param behaviour + //! The desired behaviour. One of: + //! @mixed + //! @type int(0..0) + //! Output compilation errors and warnings to @tt{stderr@}. + //! This is the default behaviour. + //! @type int(1..1) + //! Inhibit output of compilator diagnostics. + //! @type function(string, int, string:void) + //! Function to call for compilation errors. Compilation + //! warnings and exceptions are inhibited. + //! + //! The function will be called with the same arguments + //! as those passed to @[compile_error()]. + //! @type CompilationHandler + //! Compilation handler to use for diagnostics. + //! @endmixed + //! + //! @note + //! Note that the behaviour is thread local, and is not copied + //! to new threads when they are created. + //! + //! @seealso + //! @[get_inhibit_compile_errors()] + void set_inhibit_compile_errors(mixed behaviour)   { -  inhibit_compile_errors->set(f); +  inhibit_compile_errors->set(behaviour);   }    -  + //! Get the current compile error, warning and exception behaviour. + //! + //! See @[set_inhibit_compile_errors()] for details. + //! + //! @seealso + //! @[set_inhibit_compile_errors()]   mixed get_inhibit_compile_errors()   {    return inhibit_compile_errors->get();   }   #else /* !constant(thread_local) */   mixed inhibit_compile_errors;      void set_inhibit_compile_errors(mixed f)   {    inhibit_compile_errors=f;
pike.git/lib/master.pike.in:4088:   {    function(string:string) f=_trim_file_name_cb;    _trim_file_name_cb=s;    return f;   }         //! This function is called whenever a compile error occurs. @[line]   //! is zero for errors that aren't associated with any specific line.   //! @[err] is not newline terminated. + //! + //! @seealso + //! @[compile_warning()], @[compile_exception()], + //! @[get_inhibit_compile_errors()], @[set_inhibit_compile_errors()],   void compile_error(string file,int line,string err)   {    mixed val;    if(! (val = get_inhibit_compile_errors() ))    {    werror( "%s:%s:%s\n",trim_file_name(file),    line?(string)line:"-",err );    }    else if(objectp(val) ||    programp(val) ||
pike.git/lib/master.pike.in:4112:    } else if (callablep(val)) {    val(file, line, err);    }    }   }         //! This function is called whenever a compile warning occurs. @[line]   //! is zero for warnings that aren't associated with any specific   //! line. @[err] is not newline terminated. + //! + //! @seealso + //! @[compile_error()], @[compile_exception()], + //! @[get_inhibit_compile_errors()], @[set_inhibit_compile_errors()],   void compile_warning(string file,int line,string err)   {    mixed val;       if(!(val = get_inhibit_compile_errors() ))    {    if(want_warnings)    werror( "%s:%s: Warning: %s\n",trim_file_name(file),    line?(string)line:"-",err );    }    else if (objectp(val) && val->compile_warning) {    ([function(string,int,string:void)]([object]val)    ->compile_warning)(file, line, err);    }   }         //! This function is called when an exception is caught during   //! compilation. Its message is also reported to @[compile_error] if   //! this function returns zero. -  + //! + //! @seealso + //! @[compile_error()], @[compile_warning()], + //! @[get_inhibit_compile_errors()], @[set_inhibit_compile_errors()],   int compile_exception (array|object trace)   {    if (objectp (trace) && ([object]trace)->is_cpp_or_compilation_error)    // Errors thrown by cpp(), compile() or a compile callback should    // be reported as a normal compile error, so let the caller do    // just that.    return 0;    if (mixed val = get_inhibit_compile_errors()) {    if (objectp(val) && ([object]val)->compile_exception)    return ([function(object:int)]([object]val)