An implementation of Unix dc and POSIX bc with GNU and BSD extensions. Finished, but well-maintained.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

113 lines
4.2 KiB

$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:
$ $
$ * Redistributions of source code must retain the above copyright notice, this
$ list of conditions and the following disclaimer.
$ $
$ * Redistributions in binary form must reproduce the above copyright notice,
$ this list of conditions and the following disclaimer in the documentation
$ and/or other materials provided with the distribution.
$ $
$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
$ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
$ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
$ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
$ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
$ POSSIBILITY OF SUCH DAMAGE.
$ $
$quote "
$ ÀÐ×ÝëÕ áÞÞÑéÕÝØï.
$set 1
1 "ÄãÝÚæØï:"
$ ÂØßë ÞèØÑÞÚ.
$set 2
1 "¼ÐâÕÜÐâØçÕáÚÐï ÞèØÑÚÐ:"
2 "¾èØÑÚÐ ßàØ àÐ×ÑÞàÕ:"
3 "¾èØÑÚÐ ÒëßÞÛÝÕÝØï:"
4 "ÄÐâÐÛìÝÐï ÞèØÑÚÐ:"
5 "¿àÕÔãßàÕÖÔÕÝØÕ:"
$ ¼ÐâÕÜÐâØçÕáÚØÕ ÞèØÑÚØ.
$set 3
1 "ÞâàØæÐâÕÛìÝÞÕ çØáÛÞ"
2 "ÝÕØÝâÕÓàØàÞÒÐÝÝÞÕ çØáÛÞ"
3 "ßÕàÕßÞÛÝÕÝØÕ: ÝÞÜÕà ÝÕ ßÞÜÕéÐÕâáï Ò ÐßßÐàÐâÝëÙ ÝÞÜÕà"
4 "ÔÕÛØâì ÝÐ 0"
$ ¾èØÑÚØ ßàØ àÐ×ÑÞàÕ.
$set 4
1 "ÚÞÝÕæ äÐÙÛÐ"
2 "ÝÕÔÞßãáâØÜëÙ áØÜÒÞÛ '%c'"
3 "ÚÞÝÕæ áâàÞÚØ ÝÕ ÝÐÙÔÕÝ"
4 "ÚÞÝÕæ ÚÞÜÜÕÝâÐàØï ÝÕ ÝÐÙÔÕÝ"
5 "ÝÕÔÕÙáâÒØâÕÛìÝëÙ ÖÕâÞÝ"
6 "ÝÕßàÐÒØÛìÝÞÕ ÒëàÐÖÕÝØÕ"
7 "ßãáâÞÕ ÒëàÐÖÕÝØÕ"
8 "×ÐïÒÛÕÝØÕ Þ ÝÕÔÕÙáâÒØâÕÛìÝÞáâØ ßÕçÐâØ ØÛØ ßÞâÞÚÐ"
9 "ÞßàÕÔÕÛÕÝØÕ ÝÕÔÕÙáâÒØâÕÛìÝÞÙ äãÝÚæØØ"
10 "ÝÕÒÕàÝÞÕ ßàØáÒÞÕÝØÕ: ÛÕÒÐï áâÞàÞÝÐ ÔÞÛÖÝÐ Ñëâì scale, ibase, obase, last, ÒÐàÞÜ ØÛØ íÛÕÜÕÝâÞÜ ÜÐááØÒÐ"
11 "ÐÒâÞÜÐâØçÕáÚÐï ßÕàÕÜÕÝÝÐï ÝÕ ÝÐÙÔÕÝÐ"
12 "ßÐàÐÜÕâà äãÝÚæØØ ØÛØ auto \"%s%s\" ãÖÕ áãéÕáâÒãÕâ"
13 "ÚÞÝÕæ ÑÛÞÚÐ ÝÕ ÝÐÙÔÕÝ"
14 "ÝÕ ÜÞÖÕâ ÒÕàÝãâì ×ÝÐçÕÝØÕ Ø× äãÝÚæØØ void: %s()"
15 "var ÝÕ ÜÞÖÕâ Ñëâì ááëÛÚÞÙ: %s"
16 "POSIX ÝÕ ÔÞßãáÚÐÕâ ØÜÕÝ ÔÛØÝÝÕÕ 1 áØÜÒÞÛÐ: %s"
17 "POSIX ÝÕ ÔÞßãáÚÐÕâ ÚÞÜÜÕÝâÐàØÕÒ Ú áæÕÝÐàØî '#'"
18 "POSIX ÝÕ ÔÞßãáÚÐÕâ áÛÕÔãîéÕÕ ÚÛîçÕÒÞÕ áÛÞÒÞ: %s"
19 "POSIX ÝÕ ÔÞßãáÚÐÕâ âÞçÚã ('.') Ò ÚÐçÕáâÒÕ ïàÛëÚÐ ÔÛï ßÞáÛÕÔÝÕÓÞ àÕ×ãÛìâÐâÐ"
20 "POSIX âàÕÑãÕâ áÚÞÑÞÚ ÒÞÚàãÓ ÒëàÐÖÕÝØÙ ÒÞ×ÒàÐâÐ"
21 "POSIX ÝÕ àÐ×àÕèÐÕâ ØáßÞÛì×ÞÒÐâì áÛÕÔãîéØÙ ÞßÕàÐâÞà: %s"
22 "POSIX ÝÕ àÐ×àÕèÐÕâ ÞßÕàÐâÞàÐÜ áàÐÒÝÕÝØï ÒëåÞÔØâì ×Ð ßàÕÔÕÛë, ÕáÛØ ãâÒÕàÖÔÕÝØï ØÛØ æØÚÛë"
23 "POSIX âàÕÑãÕâ 0 ØÛØ 1 ÞßÕàÐâÞàÐ áàÐÒÝÕÝØï ÝÐ ãáÛÞÒØÕ"
24 "POSIX âàÕÑãÕâ, çâÞÑë ÒáÕ 3 çÐáâØ ßÕâÛØ ÑëÛØ ÝÕßãáâëÜØ"
25 "POSIX âàÕÑãÕâ ÝÐÛØçØï ÝÞÒÞÙ áâàÞÚØ ÜÕÖÔã âÞçÚÞÙ á ×ÐßïâÞÙ Ø ÞßàÕÔÕÛÕÝØÕÜ äãÝÚæØØ"
26 "POSIX ÝÕ ÔÞßãáÚÐÕâ íÚáßÞÝÕÝæØÐÛìÝÞÙ ÝÞâÐæØØ"
27 "POSIX ÝÕ ÔÞßãáÚÐÕâ ááëÛÚØ ÝÐ ÜÐááØÒ Ò ÚÐçÕáâÒÕ ßÐàÐÜÕâàÞÒ äãÝÚæØØ"
28 "POSIX ÝÕ àÐ×àÕèÐÕâ äãÝÚæØØ ßãáâÞâë"
29 "POSIX âàÕÑãÕâ, çâÞÑë ÛÕÒÐï áÚÞÑÚÐ ÑëÛÐ ÝÐ âÞÙ ÖÕ ÛØÝØØ, çâÞ Ø ×ÐÓÞÛÞÒÞÚ äãÝÚæØØ"
30 "POSIX ÝÕ ßÞ×ÒÞÛïÕâ ßàØáÒÐØÒÐâì áâàÞÚØ ßÕàÕÜÕÝÝëÜ ØÛØ ÜÐááØÒÐÜ"
$ ¾èØÑÚØ ÒëßÞÛÝÕÝØï.
$set 5
1 "½ÕÔÕÙáâÒØâÕÛìÝëÙ ibase: ÔÞÛÖÕÝ Ñëâì [%lu, %lu]"
2 "½ÕÔÕÙáâÒØâÕÛìÝëÙ obase: ÔÞÛÖÕÝ Ñëâì [%lu, %lu]"
3 "ÝÕÔÕÙáâÒØâÕÛìÝÐï scale: ÔÞÛÖÝÐ Ñëâì [%lu, %lu]"
4 "ÝÕÔÕÙáâÒØâÕÛìÝÞÕ ÒëàÐÖÕÝØÕ read()"
5 "àÕÚãàáØÒÝëÙ Òë×ÞÒ read()"
6 "ßÕàÕÜÕÝÝÐï ØÛØ íÛÕÜÕÝâ ÜÐááØÒÐ ïÒÛïÕâáï ÝÕßàÐÒØÛìÝëÜ âØßÞÜ"
7 "áâÞßÚÐ ØÜÕÕâ áÛØèÚÞÜ ÜÐÛÞ íÛÕÜÕÝâÞÒ"
8 "áâÞßÚÐ ØÜÕÕâ ÔÛï àÕÓØáâàÐ \"%s\" áÛØèÚÞÜ ÜÐÛÞ íÛÕÜÕÝâÞÒ"
9 "ÝÕßàÐÒØÛìÝÞÕ ÚÞÛØçÕáâÒÞ ßÐàÐÜÕâàÞÒ; ÝãÖÝÞ %zu, ÝãÖÝÞ %zu"
10 "ÝÕÞßàÕÔÕÛÕÝÝÐï äãÝÚæØï: %s()"
11 "ÝÕ ÜÞÖÕâ ØáßÞÛì×ÞÒÐâì ßãáâÞÕ ×ÝÐçÕÝØÕ Ò ÒëàÐÖÕÝØØ"
$ ÄÐâÐÛìÝëÕ ÞèØÑÚØ.
$set 6
1 "½Õ ãÔÐÛÞáì ÒëÔÕÛØâì ßÐÜïâì"
2 "¾èØÑÚÐ ÒÒÞÔÐ/ÒëÒÞÔÐ"
3 "ÝÕ áÜÞÓ ÞâÚàëâì äÐÙÛ: %s"
4 "äÐÙÛ ÝÕ ïÒÛïÕâáï âÕÚáâÞÒëÜ: %s"
5 "ßãâì - íâÞ ÚÐâÐÛÞÓ: %s"
6 "ÝÕÒÕàÝÐï ÞßæØï ÚÞÜÐÝÔÝÞÙ áâàÞÚØ: \"%s\""
7 "ÞßæØï âàÕÑãÕâ ÐàÓãÜÕÝâÐ: '%c' (\"%s\")"
8 "ÞßæØï ÝÕ ßàØÝØÜÐÕâ ÐàÓãÜÕÝâÞÒ: '%c' (\"%s\")"
9 "ÝÕÒÕàÝëÙ ÐàÓãÜÕÝâ ÞßæØØ ÚÞÜÐÝÔÝÞÙ áâàÞÚØ: \"%s\""