pike.git / lib / modules / Stdio.pmod / Terminfo.pmod

version» Context lines:

pike.git/lib/modules/Stdio.pmod/Terminfo.pmod:1: - // $Id: Terminfo.pmod,v 1.12 2001/10/23 20:10:12 nilsson Exp $ + // $Id: Terminfo.pmod,v 1.13 2002/10/25 15:27:04 jonasw Exp $   #pike __REAL_VERSION__         #if constant(thread_create)   #define LOCK object m_key = mutex->lock()   #define UNLOCK destruct(m_key)   #define MUTEX static private object(Thread.Mutex) mutex = Thread.Mutex();   #else   #define LOCK   #define UNLOCK
pike.git/lib/modules/Stdio.pmod/Terminfo.pmod:783:   //!   //! @seealso   //! Stdio.Terminfo.getTerminfo, Stdio.Terminfo.getTermcap, Stdio.getFallbackTerm   object(Termcap) getTerm(string|void term)   {    if (!term) {    object(Termcap) t = defterm;    if (!t)    {    string tc = [string]getenv("TERMCAP"); -  t = (tc && sizeof(tc) && tc[0]!='/'? -  Termcap(tc) : getTerm(getenv("TERM")||"dumb")); +  if (mixed err = catch { +  t = tc && sizeof(tc) && tc[0] != '/' && Termcap(tc); +  }) +  werror("%s", describe_backtrace(err)); +  if (!t) +  t = getTerm(getenv("TERM") || "dumb");    LOCK;    if (!defterm)    defterm = t;    UNLOCK;    }    return t;    }    return getTerminfo(term) || getTermcap(term) || getFallbackTerm(term);   }      //! Returns an object describing the fallback terminal for the terminal   //! @[term]. This is usually equvivalent to @[Stdio.Terminfo.getTerm("dumb")].   //!   //! @seealso   //! Stdio.Terminfo.getTerm   static object(Termcap) getFallbackTerm(string term)   {    return (term=="dumb"? Termcap("dumb:\\\n\t:am:co#80:do=^J:") :    getTerm("dumb"));   }