{* * Copyright (C) 2024, 2025 Mikulas Patocka * * This file is part of Ajla. * * Ajla is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * Ajla. If not, see . *} unit common; uses io; uses charset; uses timezone; record acmd_ro [ h : list(handle); env : treemap(bytes, bytes); home : maybe(bytes); loc : locale; tz : timezone; ] const months~cache := [ `Jan`, `Feb`, `Mar`, `Apr`, `May`, `Jun`, `Jul`, `Aug`, `Sep`, `Oct`, `Nov`, `Dec` ]; const weekdays~cache := [ `Sun`, `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` ]; fn ex_str(t : type, e : t) : bytes; implementation fn ex_str(t : type, e : t) : bytes [ var p := exception_payload e; if len_greater_than(p, 0) then return p; return exception_string e; ]