1# -*- tcl -*- fileutil::magic::rt.pcx 2# Syntax of the commands provided by package fileutil::magic::rt. 3# 4# For use by TclDevKit's static syntax checker (v4.1+). 5# See http://www.activestate.com/solutions/tcl/ 6# See http://aspn.activestate.com/ASPN/docs/Tcl_Dev_Kit/4.0/Checker.html#pcx_api 7# for the specification of the format of the code in this file. 8# 9 10package require pcx 11pcx::register fileutil::magic::rt 12pcx::tcldep 1.2.0 needs tcl 8.5 13 14namespace eval ::fileutil::magic::rt {} 15 16#pcx::message FOO {... text ...} type 17#pcx::scan <VERSION> <NAME> <RULE> 18 19pcx::check 1.0 std ::fileutil::magic::rt::I \ 20 {checkSimpleArgs 3 3 { 21 checkWholeNum 22 fileutil::magic::rt::checkType 23 checkInt 24 }} 25pcx::check 1.0 std ::fileutil::magic::rt::L \ 26 {checkSimpleArgs 1 1 { 27 checkWholeNum 28 }} 29pcx::check 1.0 std ::fileutil::magic::rt::N \ 30 {checkSimpleArgs 4 5 { 31 fileutil::magic::rt::checkType 32 checkWholeNum 33 {checkKeyword 1 {x < > <= >= == !=}} 34 checkInt 35 checkWord 36 }} 37# TODO: syntax of qualifiers. 38pcx::check 1.0 std ::fileutil::magic::rt::Nv \ 39 {checkSimpleArgs 2 3 { 40 fileutil::magic::rt::checkType 41 checkWholeNum 42 checkWord 43 }} 44pcx::check 1.0 std ::fileutil::magic::rt::Nvx \ 45 {checkSimpleArgs 3 4 { 46 checkWholeNum 47 fileutil::magic::rt::checkType 48 checkWholeNum 49 checkWord 50 }} 51pcx::check 1.0 std ::fileutil::magic::rt::Nx \ 52 {checkSimpleArgs 5 6 { 53 checkWholeNum 54 fileutil::magic::rt::checkType 55 checkWholeNum 56 {checkKeyword 1 {x < > <= >= == !=}} 57 checkInt 58 checkWord 59 }} 60pcx::check 1.0 std ::fileutil::magic::rt::R \ 61 {checkSimpleArgs 1 1 { 62 checkWholeNum 63 }} 64pcx::check 1.0 std ::fileutil::magic::rt::S \ 65 {checkSimpleArgs 3 4 { 66 checkWholeNum 67 {checkKeyword 1 {x < > <= >= == !=}} 68 checkInt 69 checkWord 70 71 }} 72pcx::check 1.0 std ::fileutil::magic::rt::Sx \ 73 {checkSimpleArgs 4 -5 { 74 checkWholeNum 75 checkWholeNum 76 {checkKeyword 1 {x < > <= >= == !=}} 77 checkInt 78 checkWord 79 }} 80pcx::check 1.0 std ::fileutil::magic::rt::close \ 81 {checkAtEnd} 82# TODO: check string for the special placeholders 83pcx::check 1.0 std ::fileutil::magic::rt::emit \ 84 {checkSimpleArgs 1 1 { 85 checkWord 86 }} 87pcx::check 1.0 std ::fileutil::magic::rt::file_start \ 88 {checkSimpleArgs 1 1 { 89 checkWord 90 }} 91# TODO: syntax of complex offsets. 92pcx::check 1.0 std ::fileutil::magic::rt::offset \ 93 {checkSimpleArgs 1 1 { 94 checkWord 95 }} 96pcx::check 1.0 std ::fileutil::magic::rt::open \ 97 {checkSimpleArgs 1 1 { 98 checkFileName 99 }} 100# TODO: check string for the special placeholders 101pcx::check 1.0 std ::fileutil::magic::rt::result \ 102 {checkSimpleArgs 0 1 { 103 checkWord 104 }} 105pcx::check 1.0 std ::fileutil::magic::rt::resultv \ 106 {checkSimpleArgs 0 1 { 107 checkWord 108 }} 109 110proc fileutil::magic::rt::checkType {t i} { 111 return [checkKeyword 1 {c s S i I Q Y date bedate ledate ldatebeldate leldate byte short beshort leshort long belong lelong ubyte ushort ubeshort uleshort ulong ubelong ulelong} $t $i] 112} 113 114# Initialization via pcx::init. 115# Use a ::fileutil::magic::rt::init procedure for non-standard initialization. 116pcx::complete 117