# -*- tcl -*- base32.pcx
# Syntax of the commands provided by package base32.
#
# For use by TclDevKit's static syntax checker (v4.1+).
# See http://www.activestate.com/solutions/tcl/
# See http://aspn.activestate.com/ASPN/docs/Tcl_Dev_Kit/4.0/Checker.html#pcx_api
# for the specification of the format of the code in this file.
#

package require pcx
pcx::register base32
pcx::tcldep   0.2 needs tcl 8.5

namespace eval ::base32 {}

pcx::message invalidStringLength {String is not a multiple of 8 characters long} err
#pcx::scan <VERSION> <NAME> <RULE>

pcx::check 0.2 std ::base32::decode \
    {checkSimpleArgs 1 1 {
	base32::checkEString
    }}
pcx::check 0.2 std ::base32::encode \
    {checkSimpleArgs 1 1 {
	checkWord
    }}

proc base32::checkEString {t i} {
    set w [lindex $t $i]
    if {[getLiteral $w str]} {
	if {[string length $str] % 8 != 0} {
	    logError base32::invalidStringLength [getTokenRange $w]
	}
    }
    return [checkWord $t $i]
}

# Initialization via pcx::init.
# Use a ::base32::init procedure for non-standard initialization.
pcx::complete
