home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / code / asm_desk.sit < prev    next >
Encoding:
Text File  |  1988-05-14  |  38.8 KB  |  1,580 lines

  1. 11-May-88 21:23:16-MDT,41255;000000000000
  2. Return-Path: <u-lchoqu%sunset@cs.utah.edu>
  3. Received: from cs.utah.edu by SIMTEL20.ARPA with TCP; Wed, 11 May 88 21:22:14 MDT
  4. Received: by cs.utah.edu (5.54/utah-2.0-cs)
  5.     id AA03329; Wed, 11 May 88 21:22:39 MDT
  6. Received: by sunset.utah.edu (5.54/utah-2.0-leaf)
  7.     id AA29224; Wed, 11 May 88 21:22:33 MDT
  8. Date: Wed, 11 May 88 21:22:33 MDT
  9. From: u-lchoqu%sunset@cs.utah.edu (Lee Choquette)
  10. Message-Id: <8805120322.AA29224@sunset.utah.edu>
  11. To: rthum@simtel20.arpa
  12. Subject: DeskCheck.asm.shar
  13.  
  14. #! /bin/sh
  15. #
  16. # This is a shell archive.  Save this into a file, edit it
  17. # and delete all lines above this comment.  Then give this
  18. # file to sh by executing the command "sh file".  The files
  19. # will be extracted into the current directory owned by
  20. # you with default permissions.
  21. #
  22. # The files contained herein are:
  23. #
  24. #   22 DeskCheck.asm
  25. #    3 FCensus.asm
  26. #    7 DeskCheck.r
  27. #    5 Alerts
  28. #
  29. echo 'Extracting DeskCheck.asm'
  30. if test -f DeskCheck.asm; then echo 'shar: will not overwrite DeskCheck.asm'; else
  31. sed 's/^X//' << '________This_Is_The_END________' > DeskCheck.asm
  32. X
  33. XDebug    equ    0        ; make non-zero for debugging
  34. X
  35. X    String_Format    0    ; no string padding
  36. X
  37. X
  38. X;    DeskCheck.asm: Find out whether everyone's bundle is legit.
  39. X;    Ephraim Vishniac / P.O. Box 1357 / East Arlington, MA 02174
  40. X;    This program is in the public domain.
  41. X
  42. X;    Checks all resource files on a volume to ensure that their
  43. X;    bundles are put together properly.
  44. X
  45. X;
  46. X
  47. X    Include    Traps.D
  48. X    Include    SysEquX.D
  49. X    Include    FSEqu.D
  50. X    Include    ToolEqu.D
  51. X    Include    SysErr.D
  52. X    Include    PackMacs.Txt
  53. X
  54. X;    Our Macros
  55. X
  56. XMACRO    DoAlert        AlertNumber =
  57. X    IF Debug
  58. X    _Debugger
  59. X    ENDIF
  60. X    ; Alert (AlertNumber:INT, NIL:ProcPtr) : INT;
  61. X    clr.w        -(sp)            ; space for result
  62. X    move.w        #{AlertNumber},-(sp)    ; alert number
  63. X    clr.l        -(sp)            ; NIL filter
  64. X    _Alert
  65. X    move.w        (sp)+,d0        ; d0 = button hit
  66. X    cmp.w        #OKitem,d0        ; standard test
  67. X    |
  68. X
  69. XMACRO    DebugPoint =
  70. X    IF Debug
  71. X    _Debugger
  72. X    ENDIF
  73. X    |
  74. X
  75. XMACRO    UseUs =
  76. X    move.w        OurMap(a5),CurMap    ; make ours the current map
  77. X    |
  78. X
  79. XMACRO    UseThem =
  80. X    move.w        TheirMap(a5),CurMap    ; make theirs the current map
  81. X    |
  82. X
  83. XMACRO    SetParamText =
  84. X    move.l    ParamZero(a5),-(sp)    ; push our paramtext pointers
  85. X    move.l    ParamOne(a5),-(sp)
  86. X    move.l    ParamTwo(a5),-(sp)
  87. X    move.l    ParamThree(a5),-(sp)
  88. X    _ParamText
  89. X    |
  90. X
  91. Xmacro   DNAME   Name =
  92. X        dc.b    '{Name|0:8}'
  93. X    .align    2
  94. X    |
  95. X
  96. X
  97. X;    Our alerts
  98. X
  99. XGreeting    equ    128    ; say hello
  100. XFarewell    equ    129    ; say goodbye
  101. XSetVolFailed    equ    130    ; couldn't SetVol
  102. XOpenResFailed    equ    131    ; couldn't OpenResFile
  103. XBundleBitClear    equ    132    ; has bundles, but no bundle bit
  104. XNumberOfTypes    equ    133    ; bundles has unusual number of types
  105. XNoSigResource    equ    134    ; couldn't load signature resource
  106. XNovelType    equ    135    ; neither ICN#, nor FREF
  107. XMissingBundle    equ    136    ; bundle is too short
  108. XExcessBundle    equ    137    ; bundle runs too long
  109. XFunnyIcon    equ    138    ; ICN# isn't 256 bytes
  110. XSmallFREF    equ    139    ; FREF is less than six bytes
  111. XBigFREF        equ    140    ; FREF is more than 262 bytes
  112. XMissingResource    equ    141    ; can't find some bundled resource
  113. XDoVolumeAlert    equ    142    ; should we do this volume?
  114. XNoIcons        equ    143    ; no ICN# list in bundle
  115. XNoFREFs        equ    144    ; no FREF list in bundle
  116. XBadLocalID    equ    145    ; local ID unresolved
  117. XOrphanType    equ    146    ; no FREF with this file type
  118. XOrphanCreator    equ    147    ; no BNDL with matching signature
  119. X
  120. X
  121. X;    Our dialogs
  122. X
  123. XCurrentFile    equ    150
  124. X
  125. X;    Other miscellaneous equates
  126. X
  127. XOKitem        equ    1    ; Item number for OK button
  128. XQuitItem    equ    2    ; Item number for Quit button
  129. X
  130. X;    Our globals
  131. X
  132. XOurMap        ds.w    1    ; a word from our sponsor
  133. XTheirMap    ds.w    1    ; equal time for the other guy
  134. XDialogPtr    ds.l    1    ; current dialog
  135. XOtherBNDLs    ds.w    1    ; 'background count' of BNDL resources
  136. XParamZero    ds.l    1    ; our param zero text pointer
  137. XParamOne    ds.l    1    ; our param one text pointer
  138. XParamTwo    ds.l    1    ; our param two text pointer
  139. XParamThree    ds.l    1    ; our param three text pointer
  140. XFileType    ds.l    1    ; File Type of current file
  141. XFileCreator    ds.l    1    ; File Creator of current file
  142. XTypeMatch    ds.b    1    ; flag for file type matched
  143. XCreatorMatch    ds.b    1    ; flag for file creator matched
  144. X
  145. X    XDef    FCensus
  146. X
  147. XDeskCheck
  148. X;------------------------------- Init Managers ----------------------------
  149. X
  150. X    pea    -4(A5)            ; Quickdraw's global area
  151. X    _InitGraf            ; Init Quickdraw
  152. X    _InitFonts            ; Init Font Manager
  153. X    move.l    #$FFFF,D0        ; Flush all events
  154. X    _FlushEvents
  155. X    _InitWindows            ; Init Window Manager
  156. X    _InitMenus            ; Init Menu Manager
  157. X    _TEInit                ; Init Text Edit
  158. X    clr.l    -(SP)            ; No restart procedure
  159. X    _InitDialogs            ; Init Dialog Manager
  160. X    _InitCursor            ; Turn on arrow cursor
  161. X
  162. X;------------------------------- Init Globals -----------------------------
  163. X    move.w    CurMap,OurMap(a5)    ; record our resource refnum
  164. X
  165. X    ; we need to discount bundles in our file and the system
  166. X    clr.w    -(sp)
  167. X    move.l    #'BNDL',-(sp)        ; How many bundles?
  168. X    _CountResources
  169. X    move.w    (sp)+,OtherBNDLs(a5)    ; save for later
  170. X
  171. X    clr.l    ParamZero(a5)        ; clear our param text pointers
  172. X    clr.l    ParamOne(a5)
  173. X    clr.l    ParamTwo(a5)
  174. X    clr.l    ParamThree(a5)
  175. X
  176. X;-------------------------------Desk Check---------------------------------
  177. X;    Just do a census of all files on all volumes, running them
  178. X;    through our bundle checker.
  179. X
  180. X    DoAlert    Greeting        ; say hello
  181. X    bne    SayByeBye        ; if not OK, split
  182. X    
  183. X    DebugPoint
  184. X
  185. X    jsr    CheckAllVols        ; else test all volumes
  186. X    DoAlert    FareWell        ; say goodbye
  187. XSayByeBye
  188. X    _ExitToShell
  189. X
  190. X
  191. X;    CheckAllVols: Check each mounted volume
  192. X
  193. XCAVinfo        equ    -ioVQElSize    ; a handy parm block
  194. XVolumeName    equ    CAVinfo-256    ; name of current volume
  195. XLastLocal    set    VolumeName
  196. X
  197. XCheckAllVols
  198. X    link    a6,#LastLocal
  199. X    lea    CAVinfo(a6),a0        ; a0 = parm block
  200. X    clr.l    ioCompletion(a0)    ; no completion routine
  201. X    lea    VolumeName(a6),a1    ; storage for volume name
  202. X    move.l    a1,ioFileName(a0)    ; set in parm block
  203. X    clr.w    ioVolIndex(a0)        ; clear index
  204. X@0    lea    CAVinfo(a6),a0        ; a0 = parm block
  205. X    clr.l    VolumeName(a6)        ; no volname yet
  206. X    add.w    #1,ioVolIndex(a0)    ; advance to next volume
  207. X    _GetVolInfo
  208. X    cmp.w    #nsvErr,d0        ; out of volumes?
  209. X    beq    @1            ; exit if so
  210. X    move.l    ioFileName(a0),ParamZero(a5)    ; set param text zero
  211. X    SetParamText
  212. X    DoAlert    DoVolumeAlert        ; should we do this one?
  213. X    bne    @0
  214. X    lea    CAVinfo(a6),a0        ; a0 = parm block
  215. X    jsr    CheckOneVol        ; else check this volume
  216. X    bra    @0            ; and loop back
  217. X@1    clr.l    ParamZero(a5)
  218. X    unlk    a6
  219. X    rts
  220. X    DName    CHECKALLVOLS
  221. X
  222. X;    CheckOneVol: Survey a single volume
  223. X;    Entry:    a0 = _GetVolInfo poop on the volume to check
  224. X
  225. XTheItemType    set    -2        ; Dialog item type
  226. XTheItem        set    TheItemType-4    ; Dialog item handle
  227. XTheBox        set    TheItem-8    ; Dialog item box
  228. XLastLocal    set    TheBox
  229. X
  230. XCheckOneVol
  231. X    link    a6,#LastLocal
  232. X    move.w    ioVRefNum(a0),-(sp)    ; save volume reference number
  233. X    move.l    ioFileName(a0),-(sp)    ; save volume name pointer
  234. X
  235. X    clr.l    -(sp)            ; space for result
  236. X    move.w    #CurrentFile,-(sp)    ; dialog number
  237. X    clr.l    -(sp)            ; take what we get
  238. X    move.l    #-1,-(sp)        ; put this window in front
  239. X    _GetNewDialog            ; Pop the question
  240. X    move.l    (sp),DialogPtr(a5)    ; save the dialog pointer
  241. X    _SetPort            ; make ours the current port
  242. X    move.l    DialogPtr(a5),-(sp)
  243. X    _DrawDialog            ; force complete dialog drawing
  244. X
  245. X    move.l    DialogPtr(a5),-(sp)
  246. X    move.w    #4,-(sp)        ; item number 4
  247. X    pea    TheItemType(a6)        ; storage for item type
  248. X    pea    TheItem(a6)        ; storage for item handle
  249. X    pea    TheBox(a6)        ; storage for item box
  250. X    _GetDItem
  251. X    move.l    (sp)+,a1        ; file name pointer
  252. X    move.l    TheItem(a6),-(sp)    ; item handle
  253. X    move.l    a1,-(sp)        ; point to file name
  254. X    _SetIText            ; set file name in dialog
  255. X
  256. X    move.l    #2,-(sp)        ; root directory
  257. X    pea    CheckOneFile        ; our file inspector
  258. X    jsr    FCensus            ; scan everything
  259. X
  260. X    move.l    DialogPtr(a5),-(sp)    ; push the dialog pointer
  261. X    _DisposDialog            ; and kill the dialog
  262. X
  263. X    unlk    a6
  264. X    rts
  265. X    DName    CHECKONEVOL
  266. X
  267. X;    CheckOneFile(ParamBlock:ParmBlkPtr; dirID:longint):boolean
  268. X;    Do the actual tests on a given file.
  269. X;    A6 offsets
  270. XOldA6        set    0
  271. XReturnAddr    set    OldA6+4
  272. XDirID        set    ReturnAddr+4    ; directory ID
  273. XFileInfo    set    DirID+4        ; param block from _GetFileInfo
  274. XReturnValue    set    FileInfo+4    ; return value (0 = continue)
  275. XArgsSz        set    ReturnValue-DirID
  276. X;
  277. XParmBlk        set    OldA6-ioHVQElSize    ; local parm block
  278. XErrString    set    ParmBlk-32    ; Str31 for error codes
  279. XTheItemType    set    ErrString-2    ; Dialog item type
  280. XTheItem        set    TheItemType-4    ; Dialog item handle
  281. XTheBox        set    TheItem-8    ; Dialog item box
  282. XLastLocal    set    TheBox
  283. X
  284. XCheckOneFile
  285. X    link    a6,#LastLocal
  286. X    clr.w    ReturnValue(a6)        ; always continue search
  287. X    
  288. X    move.l    DialogPtr(a5),-(sp)
  289. X    move.w    #2,-(sp)        ; item number 2
  290. X    pea    TheItemType(a6)        ; storage for item type
  291. X    pea    TheItem(a6)        ; storage for item handle
  292. X    pea    TheBox(a6)        ; storage for item box
  293. X    _GetDItem
  294. X    move.l    TheItem(a6),-(sp)    ; item handle
  295. X    move.l    FileInfo(a6),a1        ; point to GetFileInfo stuff
  296. X    move.l    ioFileName(a1),-(sp)    ; point to file name
  297. X    _SetIText            ; set file name in dialog
  298. X
  299. X    ; is there a resource fork?
  300. X    move.l    FileInfo(a6),a1        ; point to _GetFileInfo stuff
  301. X    tst.l    ioFlRLgLen(a1)        ; is there a resource fork?
  302. X    beq    @9            ; skip if not
  303. X
  304. X    lea    ParmBlk(a6),a0        ; point to parm block
  305. X    clr.l    ioCompletion(a0)
  306. X    clr.l    ioFileName(a0)
  307. X    move.w    ioVRefNum(a1),ioVRefNum(a0) ; volume from file info
  308. X    move.l    DirID(a6),ioWDDirID(a0)    ; directory ID from file info
  309. X    tst    FSFCBLen        ; HFS running?
  310. X    bmi    @0            ; branch if not
  311. X    _HSetVol            ; HFS, set volume and directory
  312. X    bra    @1
  313. X@0    _SetVol                ; MFS, just set volume
  314. X@1    move.w    ioResult(a0),d0        ; did it work?
  315. X    beq    @2            ; skip if vol ok
  316. X
  317. X    ext.l    d0
  318. X    lea    ErrString(a6),a0
  319. X    move.l    a0,ParamZero(a5)    ; move to param text ptrs
  320. X    _NumToString
  321. X    SetParamText
  322. X    DoAlert    SetVolFailed
  323. X    bra    @9
  324. X
  325. X@2    move.l    FileInfo(a6),a1        ; point to _GetFileInfo stuff
  326. X    clr.w    -(sp)            ; for _OpenResFile result
  327. X    move.l    ioFileName(a1),-(sp)    ; push given file name
  328. X    move.b    #0,ResLoad        ; don't load resources
  329. X    _OpenResFile            ; give it a shot
  330. X    move.b    #-1,ResLoad        ; do load resources
  331. X    move.w    (sp)+,d0        ; pop reference number
  332. X    bpl    @3            ; skip if reasonable number
  333. X
  334. X    move.w    ResErr,d0        ; get the error code
  335. X    ext.l    d0
  336. X    lea    ErrString(a6),a0
  337. X    move.l    a0,ParamZero(a5)    ; move to param text ptrs
  338. X    _NumToString
  339. X    SetParamText
  340. X    UseUs                ; do we need this?
  341. X    DoAlert    OpenResFailed
  342. X    bra    @9
  343. X
  344. X    ; While the other file is open, we have to bracket our
  345. X    ; alerts and stuff with 'UseUs' - 'UseThem'
  346. X
  347. X@3    cmp.w    SysMap,d0        ; did we just open the system?
  348. X    beq    @9            ; skip ahead if so
  349. X    cmp.w    OurMap(a5),d0        ; is it us?
  350. X    beq    @9            ; skip ahead if so
  351. X    move.w    d0,TheirMap(a5)        ; refnum of file under test
  352. X
  353. X    ; Here's where we actually examine the file contents...
  354. X
  355. X    ; Does this bozo have a bundle?
  356. X    clr.w    -(sp)
  357. X    move.l    #'BNDL',-(sp)        ; How many bundles?
  358. X    _CountResources
  359. X    move.w    (sp)+,d3        ; well?
  360. X    cmp.w    OtherBNDLs(a5),d3    ; discount other bundles
  361. X    beq    @5            ; skip if no more, close it up
  362. X
  363. X    move.l    FileInfo(a6),a1        ; point to _GetFileInfo stuff
  364. X    move.l    ioFlUsrWds+fdType(a1),FileType(a5)    ; save file type
  365. X    move.l    ioFlUsrWds+fdCreator(a1),FileCreator(a5) ; ditto creator
  366. X    clr.b    TypeMatch(a5)        ; no matches yet
  367. X    clr.b    CreatorMatch(a5)
  368. X
  369. X    move.w    ioFlUsrWds+fdFlags(a1),d0 ; d0 = file flags
  370. X    btst    #fHasBundle,d0        ; test bundle bit
  371. X    bne    @4            ; skip if set, that makes sense
  372. X
  373. X    move.w    D3,D0
  374. X    sub.w    OtherBNDLs(a5),D0
  375. X    ext.l    d0
  376. X    lea    ErrString(a6),a0
  377. X    move.l    a0,ParamZero(a5)    ; move to param text ptrs
  378. X    _NumToString
  379. X    SetParamText
  380. X    UseUs
  381. X    DoAlert    BundleBitClear
  382. X    UseThem
  383. X
  384. X@4    move.w    D3,D0            ; retrieve number of bundles
  385. X    jsr    TestBundles        ; else go test the bundles
  386. X    tst.b    TypeMatch(a5)        ; found FREF with our Type?
  387. X    bne    @6            ; skip if so
  388. X
  389. X    lea    ErrString+1(a6),a0    ; fudge alignment of string
  390. X    move.l    a0,ParamZero(a5)    ; it's param text zero
  391. X    move.b    #4,(a0)+        ; set string length
  392. X    move.l    FileType(a5),(a0)    ; and string contents
  393. X    SetParamText    
  394. X    UseUs
  395. X    DoAlert    OrphanType
  396. X    UseThem
  397. X@6    tst.b    CreatorMatch(a5)    ; found BNDL with our Creator?
  398. X    bne    @5            ; skip if so
  399. X
  400. X    lea    ErrString+1(a6),a0    ; fudge alignment of string
  401. X    move.l    a0,ParamZero(a5)    ; it's param text zero
  402. X    move.b    #4,(a0)+        ; set string length
  403. X    move.l    FileCreator(a5),(a0)    ; and string contents
  404. X    SetParamText    
  405. X    UseUs
  406. X    DoAlert    OrphanCreator
  407. X    UseThem
  408. X
  409. X    ; Here's where we close up the file
  410. X@5    move.w    TheirMap(a5),-(sp)    ; retrieve test file refnum
  411. X    _CloseResFile            ; and close it up
  412. X
  413. X    move.w    CurMap,d0        ; check the current map
  414. X    cmp.w    OurMap(a5),d0        ; is it us?
  415. X    beq    @9            ; skip if so, we're good
  416. X    DebugPoint
  417. X
  418. X    ; so much for this file.  Restore default volume
  419. X@9    UseUs                ; in case we opened the System...
  420. X    clr.l    ParamZero(a5)        ; the string storage is gone
  421. X    unlk    a6
  422. X    move.l    (sp)+,a0        ; a0 = return address
  423. X    lea    ArgsSz(sp),sp        ; pop arguments
  424. X    jmp    (a0)            ; return
  425. X    DName    CHECKONEFILE
  426. X
  427. X;    TestBundles: Test all the bundles of the current resource file
  428. X;    d0 = number of BNDL available
  429. X;    We only need to check ones native to the top map [TheirMap(a5)]
  430. X
  431. XOldA6        set    0
  432. XReturnAddr    set    OldA6+4
  433. X
  434. XResIndex    set    OldA6-2        ; current resource index
  435. XBNDLHandle    set    ResIndex-4    ; handle to current bundle
  436. XLastLocal    set    BNDLHandle
  437. X
  438. X
  439. XTestBundles
  440. X    link    a6,#LastLocal
  441. X    move.w    d0,ResIndex(a6)        ; resources to check
  442. X
  443. X@0    clr.l    -(sp)
  444. X    move.l    #'BNDL',-(sp)        ; resource type
  445. X    move.w    ResIndex(a6),-(sp)    ; resource index
  446. X    _GetIndResource            ; get the bundle
  447. X    move.l    (sp)+,BNDLHandle(a6)    ; save handle
  448. X    
  449. X    ; is it one that we want?
  450. X    clr.w    -(sp)
  451. X    move.l    BNDLHandle(a6),-(sp)    ; current bundle
  452. X    _HomeResFile
  453. X    move.w    (sp)+,d0
  454. X    cmp.w    TheirMap(a5),d0        ; is it theirs?
  455. X    bne    @1            ; skip if not
  456. X
  457. X    move.l    BNDLHandle(a6),a0    ; get the bundle handle
  458. X    _HNoPurge            ; make it unpurgeable
  459. X    move.l    BNDLHandle(a6),a0    ; get the bundle handle
  460. X    _HLock                ; lock it down
  461. X
  462. X    move.l    BNDLHandle(a6),a0    ; get the bundle handle
  463. X    jsr    TestOneBundle        ; and check it out
  464. X
  465. X@1    sub.w    #1,ResIndex(a6)        ; decrement resource index
  466. X    bne    @0            ; and try again
  467. X
  468. X    unlk    a6
  469. X    rts
  470. X    DName    TESTBUNDLES
  471. X
  472. X;    TestOneBundle: Examine one BNDL for validity, sanity, etc.
  473. X;    a0 = handle to the bundle
  474. X
  475. XOldA6        set    0
  476. XReturnAddr    set    OldA6+4
  477. X
  478. XBNDLHandle    set    OldA6-4        ; handle to current bundle
  479. XBundleIDStr    set    BNDLHandle-32    ; Str31 for resource ID
  480. XBundleSize    set    BundleIDStr-4    ; size of bundle
  481. XBundleID    set    BundleSize-2    ; bundle's resource ID
  482. XBundleType    set    BundleID-4    ; bundle's resource type
  483. XBundleName    set    BundleType-256    ; bundle's resource name
  484. XOtherString    set    BundleName-32    ; for other stuff
  485. XICNlist        set    OtherString-4    ; pointer to ICN# list
  486. XFREFlist    set    ICNlist-4    ; pointer to FREF list
  487. XLastLocal    set    FREFlist
  488. X
  489. XTestOneBundle
  490. X    link    a6,#LastLocal
  491. X    movem.l    d2-d5/a2-a4,-(sp)    ; save some registers
  492. X    clr.l    ICNlist(a6)        ; clear list pointers
  493. X    clr.l    FREFlist(a6)
  494. X
  495. X    move.l    a0,BNDLHandle(a6)    ; store bundle handle for later
  496. X    move.l    (a0),a4            ; a4 = bundle pointer
  497. X
  498. X    move.l    a0,-(sp)        ; push handle
  499. X    pea    BundleID(a6)        ; pointer to resource ID var
  500. X    pea    BundleType(a6)        ; pointer to resource type var
  501. X    pea    BundleName(a6)        ; pointer to resource name var
  502. X    _GetResInfo
  503. X
  504. X    lea    BundleIDStr(a6),a0    ; string for bundle's res ID
  505. X    move.l    a0,ParamZero(a5)    ; save for use in ParamText
  506. X    move.w    BundleID(a6),d0        ; get the resource ID
  507. X    ext.l    d0
  508. X    _NumToString
  509. X    SetParamText
  510. X
  511. X    ; Examine the bundle for size-wise sanity
  512. X    clr.l    -(sp)
  513. X    move.l    BNDLHandle(a6),-(sp)
  514. X    _SizeRsrc            ; how big is it?
  515. X    move.l    (sp)+,D4        ; save for later
  516. X    move.l    D4,BundleSize(a6)    ; might need original figure...
  517. X    sub.w    #8,D4            ; at least minimum length?
  518. X    bmi    @5            ; branch if not
  519. X    move.l    (a4),D0            ; D0 = signature type
  520. X    move.w    4(a4),d1        ; D1 = signature ID
  521. X    jsr    TestSignature        ; check it out!
  522. X
  523. X    move.w    6(a4),d3        ; D3 = # types - 1
  524. X    cmp.w    #1,D3            ; usual number?
  525. X    beq    @0            ; skip if so
  526. X    move.w    d3,d0
  527. X    add.w    #1,d0            ; actual number of types
  528. X    lea    OtherString(a6),a0    ; other string
  529. X    move.l    a0,ParamOne(a5)
  530. X    ext.l    d0
  531. X    _NumToString
  532. X    SetParamText
  533. X    UseUs
  534. X    DoAlert    NumberOfTypes
  535. X    UseThem
  536. X@0    lea    8(a4),a4        ; a4 = header of first resource list
  537. X
  538. X@1    sub.w    #6,D4            ; length of list header
  539. X    bmi    @5            ; skip out if too short
  540. X    cmpi.l    #'ICN#',(a4)        ; icons?
  541. X    bne    @6            ; skip if not, try something else
  542. X    move.l    a4,ICNlist(a6)        ; save ICN# list pointer
  543. X    bra    @2            ; and go check the list
  544. X@6    cmpi.l    #'FREF',(a4)        ; file references?
  545. X    bne    @7            ; skip if not, it's something weird
  546. X    move.l    a4,FREFlist(a6)        ; save FREF list pointer
  547. X    bra    @2            ; and go check the list
  548. X@7    lea    OtherString(a6),a0    ; point to other string
  549. X    move.w    #4,(a0)
  550. X    move.l    (a4),2(a0)        ; fill in resource type
  551. X    lea    1(a0),a0        ; use odd-aligned string
  552. X    move.l    a0,ParamOne(a5)
  553. X    SetParamText
  554. X    UseUs
  555. X    DoAlert    NovelType
  556. X    UseThem
  557. X@2    move.w    4(a4),d2        ; resources - 1 of this type
  558. X    lea    6(a4),a3        ; a3 = start of resource list
  559. X@3    sub.w    #4,d4            ; size of list item
  560. X    bmi    @5            ; skip out if too short
  561. X    move.l    (a4),D0            ; resource type
  562. X    move.w    2(a3),D1        ; resource ID
  563. X    jsr    TestOneResource        ; test it!
  564. X    lea    4(a3),a3        ; next item in list
  565. X    dbra    d2,@3            ; collect them all
  566. X    move.l    a3,a4            ; next list
  567. X    dbra    d3,@1            ; collect all of those, too
  568. X    tst.w    d4            ; All used up?
  569. X    beq    @4            ; skip if so, that's just right
  570. X    ; The bundle runs on longer than expected
  571. X    UseUs
  572. X    DoAlert    ExcessBundle
  573. X    UseThem
  574. X@4    move.l    ICNlist(a6),a0        ; pick up ICN# and FREF pointers
  575. X    move.l    FREFlist(a6),a1
  576. X    jsr    TestLocalIDs
  577. X
  578. X    clr.l    ParamZero(a5)
  579. X    clr.l    ParamOne(a5)
  580. X    movem.l    (sp)+,d2-d5/a2-a4    ; restore some registers
  581. X    unlk    a6
  582. X    rts
  583. X    DName    TESTONEBUNDLE
  584. X
  585. X@5    UseUs
  586. X    DoAlert    MissingBundle
  587. X    UseThem
  588. X    bra    @4
  589. X
  590. X
  591. X;    TestSignature: Does the 'signature' resource exist?
  592. X;    D0 = resource type
  593. X;    D1.w = resource ID
  594. X
  595. XOldA6        set    0
  596. XReturnAddr    set    OldA6+4
  597. X
  598. XSigType        set    OldA6-4        ; type of signature resource
  599. XTypeStr        set    SigType-1    ; for type string
  600. XFillerOne    set    TypeStr-1    ; restore alignment
  601. XSigID        set    FillerOne-2    ; resource ID for signature
  602. XIDString    set    SigID-32    ; Str31 for resource ID
  603. X
  604. XLastLocal    set    IDString
  605. X
  606. XTestSignature
  607. X    link    a6,#LastLocal
  608. X    move.l    d0,SigType(a6)        ; save signature's resource type
  609. X    move.w    d1,SigID(a6)        ; save resource ID
  610. X    cmp.l    FileCreator(a5),d0    ; FREF matches creator?
  611. X    seq    d0
  612. X    or.b    d0,CreatorMatch(a5)    ; set match flag if so
  613. X
  614. X    clr.l    -(sp)
  615. X    move.l    SigType(a6),-(sp)    ; resource type
  616. X    move.w    SigID(a6),-(sp)        ; resource ID
  617. X    _GetResource            ; Fetch!
  618. X    move.l    (sp)+,d0        ; pop the handle
  619. X    beq    @2            ; problem if NIL
  620. X    tst.w    ResErr            ; something wrong?
  621. X    bne    @2            ; skip if so
  622. X    clr.w    -(sp)            ; check home file of resource
  623. X    move.l    d0,-(sp)
  624. X    _HomeResFile
  625. X    move.w    (sp)+,d0        ; pop res file reference
  626. X    cmp.w    TheirMap(a5),d0        ; right file?
  627. X    beq    @0            ; branch if so, it's good
  628. X
  629. X@2    move.b    #4,TypeStr(a6)        ; set resource type string
  630. X    lea    TypeStr(a6),a0
  631. X    move.l    a0,ParamOne(a5)
  632. X    SetParamText
  633. X
  634. X    move.w    SigID(a6),d0        ; d0 = signature's res ID
  635. X    ext.l    d0
  636. X    lea    IDString(a6),a0
  637. X    move.l    a0,ParamTwo(a5)
  638. X    _NumToString
  639. X    SetParamText
  640. X
  641. X    UseUs
  642. X    DoAlert    NoSigResource
  643. X    UseThem
  644. X
  645. X@0    clr.l    ParamOne(a5)
  646. X    clr.l    ParamTwo(a5)
  647. X    unlk    a6
  648. X    rts
  649. X    DName    TESTSIGNATURE
  650. X
  651. X;    TestOneResource: Do a sanity check on one resource.
  652. X;        For all kinds, be sure it exists.
  653. X;        For ICN# and FREF, do some other stuff
  654. X;    D0 = resource type
  655. X;    D1.W = resource ID
  656. X
  657. XOldA6        set    0
  658. XReturnAddr    set    OldA6+4
  659. X
  660. XResHandle    set    OldA6-4        ; handle to current resource
  661. XResType        set    ResHandle-4    ; resource type
  662. XResTypeStr    set    ResType-1    ; for using above as string
  663. XFillerOne    set    ResTypeStr-1    ; restore alignment
  664. XResID        set    FillerOne-2    ; resource ID
  665. XResIDStr    set    ResID-32    ; Str31 for resource ID
  666. XResSize        set    ResIDStr-4    ; size of resource
  667. XSizeString    set    ResSize-32    ; Str31 for resource size
  668. XLastLocal    set    SizeString
  669. X
  670. XTestOneResource
  671. X    link    a6,#LastLocal
  672. X    movem.l    d2-d5/a2-a4,-(sp)    ; save some registers
  673. X
  674. X    move.l    d0,ResType(a6)
  675. X    move.w    d1,ResID(a6)
  676. X
  677. X    move.b    #4,ResTypeStr(a6)    ; build type string
  678. X    lea    ResTypeStr(a6),a0
  679. X    move.l    a0,ParamOne(a5)        ; set indirect pointer
  680. X
  681. X    move.w    ResID(a6),d0        ; resource ID
  682. X    lea    ResIDStr(a6),a0        ; ID string
  683. X    move.l    a0,ParamTwo(a5)
  684. X    ext.l    d0
  685. X    _NumToString
  686. X    SetParamText
  687. X
  688. X    clr.l    -(sp)
  689. X    move.l    ResType(a6),-(sp)    ; resource type
  690. X    move.w    ResID(a6),-(sp)        ; resource ID
  691. X    _GetResource            ; Fetch!
  692. X    move.l    (sp)+,ResHandle(a6)    ; save the handle
  693. X    tst.l    ResHandle(a6)        ; NIL handle?
  694. X    beq    @4            ; error if so, resource is missing
  695. X    tst.w    ResErr            ; something wrong?
  696. X    bne    @4            ; skip if so
  697. X    clr.w    -(sp)            ; else check home resource file
  698. X    move.l    ResHandle(a6),-(sp)
  699. X    _HomeResFile
  700. X    move.w    (sp)+,d0        ; pop res file ref
  701. X    cmp.w    TheirMap(a5),d0        ; right file?
  702. X    beq    @0            ; branch if so, we'll take it
  703. X
  704. X@4    UseUs
  705. X    DoAlert    MissingResource
  706. X    UseThem
  707. X    bra    @9
  708. X@0    clr.l    -(sp)
  709. X    move.l    ResHandle(a6),-(sp)
  710. X    _SizeRsrc            ; How big is this sucker?
  711. X    move.l    (sp)+,ResSize(a6)    ; save for later testing
  712. X
  713. X    move.l    ResSize(a6),d0        ; set up length string
  714. X    lea    SizeString(a6),a0
  715. X    move.l    a0,ParamThree(a5)
  716. X    _NumToString
  717. X    SetParamText
  718. X
  719. X    move.l    ResType(a6),d0        ; d0 = resource type
  720. X    cmpi.l    #'ICN#',d0        ; Icon list?
  721. X    bne    @2            ; skip if not
  722. X    
  723. X    move.l    ResSize(a6),d0        ; check resource size
  724. X    cmp.l    #256,d0            ; must be 256 bytes
  725. X    beq    @9            ; exit if so, it's good
  726. X    UseUs
  727. X    DoAlert    FunnyIcon
  728. X    UseThem
  729. X    bra    @9
  730. X@2    cmpi.l    #'FREF',d0        ; FREF?
  731. X    bne    @9            ; exit if not, we don't care
  732. X    move.l    ResSize(a6),d0        ; check resource size
  733. X    cmpi.l    #6,d0            ; reasonable size?
  734. X    bcc    @3            ; branch if minimum or more
  735. X    UseUs
  736. X    DoAlert    SmallFREF        ; the FREF is too small
  737. X    UseThem
  738. X    bra    @9
  739. X@3    cmpi.l    #263,d0            ; not too big?
  740. X    bcs    @9            ; branch if in bounds
  741. X    UseUs
  742. X    DoAlert    BigFREF
  743. X    UseThem
  744. X
  745. X@9    clr.l    ParamOne(a5)
  746. X    clr.l    ParamTwo(a5)
  747. X    clr.l    ParamThree(a5)
  748. X    movem.l    (sp)+,d2-d5/a2-a4    ; restore some registers
  749. X    unlk    a6
  750. X    rts
  751. X    DName    TESTONERESOURCE
  752. X
  753. X;    TestLocalIDs: See if the local IDs referred to by the FREFs are
  754. X;            resolved in the ICN# list.
  755. X;    a0 = ptr to ICN# list from bundle
  756. X;    a1 = ptr to FREF list from bundle
  757. X
  758. XFREFIDStr    set    -32        ; Str31 for FREF ID #
  759. XLocalIDStr    set    FREFIDStr-32    ; Str31 for local ID #
  760. XFREFHandle    set    LocalIDStr-4    ; handle of current FREF
  761. XLastLocal    set    FREFHandle
  762. X
  763. XTestLocalIDs
  764. X    link    a6,#LastLocal        ; some local storage
  765. X    movem.l    a2-a4/d2-d4,-(sp)    ; save some regs
  766. X    
  767. X    move.l    a0,d0            ; is there an ICN# list?
  768. X    bne    @0            ; skip if so
  769. X    UseUs
  770. X    DoAlert    NoIcons
  771. X    UseThem
  772. X    bra    @9
  773. X@0    move.l    a1,d0            ; is there an FREF list?
  774. X    bne    @1            ; skip if so
  775. X    UseUs
  776. X    DoAlert    NoFREFs
  777. X    UseThem
  778. X    bra    @9
  779. X@1    move.l    a0,a4            ; a4 = ICN# list pointer
  780. X    move.w    4(a1),d4        ; d4 = # FREFs - 1
  781. X    lea    6(a1),a3        ; a3 = first FREF item
  782. X@2    clr.l    -(sp)
  783. X    move.l    #'FREF',-(sp)
  784. X    move.w    2(a3),-(sp)
  785. X    _GetResource            ; get the FREF
  786. X    move.l    (sp)+,d0        ; pop the handle
  787. X    beq    @5            ; skip if NIL handle
  788. X    tst.w    ResErr
  789. X    bne    @5            ; skip if resource error
  790. X    move.l    d0,FREFHandle(a6)    ; save FREF handle
  791. X    clr.w    -(sp)            ; check home res file
  792. X    move.l    d0,-(sp)
  793. X    _HomeResFile
  794. X    move.w    (sp)+,d0        ; pop home res file
  795. X    cmp.w    TheirMap(a5),d0        ; from a good home?
  796. X    bne    @5            ; exit if not
  797. X
  798. X    move.l    FREFHandle(a6),a0    ; a0 = FREF handle
  799. X    move.l    (a0),a0            ; a0 = FREF pointer
  800. X
  801. X    move.l    (a0),d0            ; d0 = file type from FREF
  802. X    cmp.l    FileType(a5),d0        ; match our file type?
  803. X    seq    d0
  804. X    or.b    d0,TypeMatch(a5)    ; set type match flag if so
  805. X
  806. X    move.w    4(a0),d0        ; d0 = local ID from FREF
  807. X    move.w    4(a4),d3        ; d3 = # ICN#s - 1
  808. X    lea    6(a4),a2        ; a2 = first ICN# item
  809. X@3    cmp.w    (a2),d0            ; local IDs match?
  810. X    beq    @5            ; skip if so, test next FREF
  811. X    lea    4(a2),a2        ; else move to next ICN# item
  812. X    dbra    d3,@3            ; search through ICN# list
  813. X
  814. X    ; If we fall out, we have an unsatisfied local ID in d0
  815. X
  816. X    ext.l    d0
  817. X    lea    LocalIDStr(a6),a0    ; string for local resource ID
  818. X    move.l    a0,ParamTwo(a5)
  819. X    _NumToString
  820. X    move.w    2(a3),d0        ; FREF resource ID
  821. X    ext.l    d0
  822. X    lea    FREFIDStr(a6),a0    ; string for FREF resource ID
  823. X    move.l    a0,ParamOne(a5)
  824. X    _NumToString
  825. X    SetParamText
  826. X    UseUs
  827. X    DoAlert    BadLocalID
  828. X    UseThem
  829. X    clr.l    ParamOne(a5)
  830. X    clr.l    ParamTwo(a5)
  831. X@5    lea    4(a3),a3        ; next FREF item in list
  832. X    dbra    d4,@2            ; test entire FREF list
  833. X@9    movem.l    (sp)+,a2-a4/d2-d4    ; restore registers
  834. X    unlk    a6
  835. X    rts
  836. X    DName    TESTLOCALIDS
  837. X
  838. ________This_Is_The_END________
  839. if test `wc -l < DeskCheck.asm` -ne 806; then
  840.     echo 'shar: DeskCheck.asm was damaged during transit'
  841.   echo '      (should have been 806 bytes)'
  842. fi
  843. fi        ; : end of overwriting check
  844. echo 'Extracting FCensus.asm'
  845. if test -f FCensus.asm; then echo 'shar: will not overwrite FCensus.asm'; else
  846. sed 's/^X//' << '________This_Is_The_END________' > FCensus.asm
  847. X
  848. X;    FCensus: HFS/MSF file census routine from Feb '86 MacTutor
  849. X;    Provides info on each file on a volume, whether MFS or HFS.
  850. X
  851. X;    Proc FCensus(vRefNum:integer; DirID:longint; Inspector:ProcPtr);
  852. X
  853. X;    vRefNum: volume reference number (or drive number) of volume
  854. X
  855. X;    dirID: ID of directory to start.  Root dir = 2.
  856. X
  857. X;    Inspector: user-supplied function
  858. X;        MyInspector(ParamBlock:ParmBlkPtr; dirID:longint):boolean
  859. X;        ParamBlock is a GetFileInfo block
  860. X;        dirID is the ID of the file's directory
  861. X;        If returned value = True, search ends.
  862. X;        If returned value = False, search continues.
  863. X
  864. X    Include    Traps.D
  865. X    Include    SysEquX.D
  866. X    Include    FSEqu.D
  867. X    Include    SysErr.D
  868. X        
  869. X        .MACRO _TFSCORE
  870. X        IF '%1' <> ''
  871. X        LEA    %1,A0
  872. X        ENDIF
  873. X        IF '%3' = ''
  874. X        DC.W   $A200+%2
  875. X        ENDIF
  876. X        IF '%3' = 'REGS'
  877. X        DC.W   $A300+%2
  878. X        ENDIF
  879. X        IF '%3' = 'ASYNC'
  880. X        DC.W   $A600+%2
  881. X        ENDIF
  882. X        IF '%3' = 'SYS'
  883. X        DC.W   $A600+%2
  884. X        ENDIF
  885. X        IF '%3' = 'IMMED'
  886. X        DC.W   $A200+%2
  887. X        ENDIF
  888. X        .ENDM
  889. X
  890. X
  891. X        .MACRO _GetCatInfo 
  892. X        MOVEQ        #9,D0
  893. X        _TFSCore    %1,96,%2
  894. X        .ENDM
  895. X
  896. X
  897. X;    A6 offsets
  898. XOldA6        set    0
  899. XReturnAddr    set    OldA6+4
  900. XInspec        set    ReturnAddr+4
  901. XDirID        set    Inspec+4
  902. XvRefNum        set    DirID+4
  903. XArgsSz        set    vRefNum+2-Inspec
  904. X;
  905. XParmBlk        set    OldA6-ioHVQElSize    ; local parm block
  906. XNameStr        set    ParmBlk-256        ; Str255 buffer
  907. XIndex        set    NameStr-2        ; directory index
  908. X
  909. X    XRef    FCensus
  910. X
  911. XFCensus
  912. X    Link    a6,#Index
  913. X    clr.l    -(sp)            ; sentinel for end of DirID list
  914. XNextDir
  915. X    clr    Index(a6)        ; init index = 0
  916. XNextFile
  917. X    lea    ParmBlk(a6),a0        ; a0 = parm block pointer
  918. X    clr.l    ioCompletion(a0)
  919. X    clr.l    ioFileName(a0)
  920. X    move    vRefNum(a6),ioVRefNum(a0)    ; set volume
  921. X    move.l    dirID(a6),ioDirID(a0)    ; set directory ID
  922. X    lea    NameStr(a6),a1        ; a1 = name string buffer pointer
  923. X    move.l    a1,ioFileName(a0)    ; set file name pointer
  924. X    addq    #1,Index(a6)        ; advance index
  925. X    move    Index(a6),ioFDirIndex(a0)    ; set index
  926. X    tst    FSFCBLen        ; HFS running?
  927. X    bmi.s    @0            ; branch if not
  928. X    _GetCatInfo
  929. X    bra.s    @1
  930. X@0    _GetFileInfo            ; MFS, get partial story
  931. X@1    beq.s    NodeKind        ; no error, check things out
  932. X    cmp    #fnfErr,d0        ; end of directory?
  933. X    bne.s    FCExit            ; no, unexpected problem
  934. X    move.l    (sp)+,dirID(a6)        ; pop next directory off stack
  935. X    bne.s    NextDir            ; branch if there is one
  936. X    bra.s    FCExit            ; branch if there isn't one
  937. XNodeKind
  938. X    btst    #ioDirFlg,ioFlAttrib(a0)    ; directory?
  939. X    beq.s    CallInspec        ; a file, call Inspector
  940. X    move.l    ioDirID(a0),-(sp)    ; directory, push on stack
  941. X    bra.s    NextFile        ; look for next file
  942. XCallInspec
  943. X    clr    -(sp)            ; for returned value
  944. X    pea    ParmBlk(a6)        ; param block for inspector
  945. X    move.l    dirID(a6),-(sp)        ; pass dirID
  946. X    move.l    Inspec(a6),a0        ; address of user function
  947. X    jsr    (a0)            ; call inspector
  948. X    tst.b    (sp)+            ; time to quit?
  949. X    beq.s    NextFile        ; no, keep going
  950. XFCExit
  951. X    unlk    a6
  952. X    move.l    (sp)+,a0        ; a0 = return address
  953. X    lea    ArgsSz(sp),sp        ; pop arguments
  954. X    jmp    (a0)            ; return
  955. X    dc.b    'FCensus'
  956. X    .align    2
  957. ________This_Is_The_END________
  958. if test `wc -l < FCensus.asm` -ne 110; then
  959.     echo 'shar: FCensus.asm was damaged during transit'
  960.   echo '      (should have been 110 bytes)'
  961. fi
  962. fi        ; : end of overwriting check
  963. echo 'Extracting DeskCheck.r'
  964. if test -f DeskCheck.r; then echo 'shar: will not overwrite DeskCheck.r'; else
  965. sed 's/^X//' << '________This_Is_The_END________' > DeskCheck.r
  966. XDeskCheck.rsrc
  967. X\00\00\00\00\00\00\00\00
  968. X
  969. X* Decompiled 5/11/88 by Lee Choquette using Dismantle 0.4
  970. X
  971. X* -------------------- NewType:PICT
  972. XTYPE PICT=GNRL
  973. X
  974. X
  975. X,129 (32)
  976. X.H
  977. X0120005A 00450088 01621101 A00082A1 00960006 05000000 0200A100 9A000800
  978. X08000000 888000A0 00980100 0A000000 0002D002 40030003 0D00092B 4B693954
  979. X68697320 70726F67 72616D20 69732069 6E207468 65207075 626C6963 20646F6D
  980. X61696E2E 20205365 6E642064 69736B65 74746520 616E6420 A00099A1 009A0008
  981. XFFFC0000 00888000 A000982A 0C3B7365 6C662D61 64647265 73736564 2C207374
  982. X616D7065 6420656E 76656C6F 70652066 6F722063 6F6D706C 65746520 736F7572
  983. X63652063 6F64652E 0DA00099 A1009A00 08FFF000 00008880 00A00098 2A0C3745
  984. X2E4D2E56 6973686E 69616320 2F20502E 4F2E2042 6F782031 33353720 2F204561
  985. X73742041 726C696E 67746F6E 2C204D41 20303231 3734A000 99A00097 A00083FF
  986. X
  987. X
  988. X,128 (32)
  989. X.H
  990. X027B0032 004300AC 014A1101 A00082A1 00960006 05000000 0200A100 9A000800
  991. X2E000000 7D8000A0 00980100 0A000000 0002D002 40030003 0D00092B 49413544
  992. X65736B43 6865636B 20657861 6D696E65 73207468 65206669 6C657320 6F6E2061
  993. X6C6C206D 6F756E74 65642076 6F6C756D 65732C20 A00099A1 009A0008 00220000
  994. X007D8000 A000982A 0C386C6F 6F6B696E 6720666F 72206465 66656374 69766520
  995. X62756E64 6C65732E 20204261 64206275 6E646C65 7320636F 6E74616D 696E6174
  996. X6520A000 99A1009A 00080016 0000007D 8000A000 982A0C35 796F7572 20446573
  997. X6B746F70 2066696C 652C2063 61757369 6E672070 726F626C 656D7320 666F7220
  998. X74686520 46696E64 65722E20 20A00099 A1009A00 08000A00 00007D80 00A00098
  999. X2A0C3646 696E6465 7220352E 33206973 20666169 726C7920 676F6F64 20617420
  1000. X72657369 7374696E 67207375 63682070 726F626C 656D732C 20A00099 A1009A00
  1001. X08FFFE00 00007D80 00A00098 2A0C3762 75742065 61726C69 65722046 696E6465
  1002. X72732C20 65737065 6369616C 6C792046 696E6465 7220342E 312C2061 72652065
  1003. X6173696C 7920A000 99A1009A 0008FFF2 0000007D 8000A000 982A0C0A 636F6E66
  1004. X75736564 2E0DA000 99A1009A 0008FFE6 0000007D 8000A000 982A0C01 0DA00099
  1005. XA1009A00 08FFDA00 00007D80 00A00098 2A0C3344 65736B43 6865636B 206D616B
  1006. X6573206E 6F206174 74656D70 7420746F 20726570 61697220 616E7920 70726F62
  1007. X6C656D73 2E0DA000 99A1009A 0008FFCE 0000007D 8000A000 982A0C35 49742073
  1008. X696D706C 79206164 76697365 7320796F 75206F66 20616E79 20737472 616E6765
  1009. X20746869 6E677320 69742066 696E6473 2EA00099 A00097A0 0083FF
  1010. X
  1011. X
  1012. X* -------------------- NewType:DLOG
  1013. XTYPE DLOG=GNRL
  1014. X
  1015. X
  1016. X,150
  1017. Xx
  1018. X32 80 90 432
  1019. Xvisible GoAway
  1020. X1
  1021. X0
  1022. X150
  1023. X
  1024. X
  1025. X* -------------------- NewType:DITL
  1026. XTYPE DITL=GNRL
  1027. X
  1028. X
  1029. X,128
  1030. X6
  1031. X
  1032. XButton
  1033. X219 20 239 88
  1034. XOK
  1035. X
  1036. XButton
  1037. X219 228 239 296
  1038. XQuit
  1039. X
  1040. XStaticText disabled
  1041. X11 72 34 237
  1042. XWelcome to DeskCheck!
  1043. X
  1044. XStaticText disabled
  1045. X219 100 239 220
  1046. XJanuary 29, 1987
  1047. X
  1048. XpicItem disabled
  1049. X38 15 160 278
  1050. X128
  1051. X
  1052. XpicItem disabled
  1053. X159 13 205 298
  1054. X129
  1055. X
  1056. X
  1057. X
  1058. X,130
  1059. X2
  1060. X
  1061. XButton
  1062. X144 88 164 148
  1063. XOK
  1064. X
  1065. XStaticText disabled
  1066. X48 41 113 213
  1067. XSetVol Failed!\0D++
  1068. X\0D++
  1069. XError code = ^0.
  1070. X
  1071. X
  1072. X
  1073. X,129
  1074. X2
  1075. X
  1076. XButton
  1077. X144 83 164 159
  1078. XBye-bye!
  1079. X
  1080. XStaticText disabled
  1081. X56 88 80 151
  1082. XAll done.
  1083. X
  1084. X
  1085. X
  1086. X,131
  1087. X2
  1088. X
  1089. XButton
  1090. X144 88 164 148
  1091. XOK
  1092. X
  1093. XStaticText disabled
  1094. X56 41 115 200
  1095. XOpenResFile failed!\0D++
  1096. X\0D++
  1097. XError code = ^0.
  1098. X
  1099. X
  1100. X
  1101. X,150
  1102. X4
  1103. X
  1104. XStaticText disabled
  1105. X25 3 45 33
  1106. XFile: 
  1107. X
  1108. XStaticText disabled
  1109. X25 35 45 347
  1110. X
  1111. XStaticText disabled
  1112. X4 3 24 58
  1113. XVolume:
  1114. X
  1115. XStaticText disabled
  1116. X4 57 24 345
  1117. X
  1118. X
  1119. X
  1120. X,132
  1121. X2
  1122. X
  1123. XButton
  1124. X153 90 173 150
  1125. XOK
  1126. X
  1127. XStaticText disabled
  1128. X45 6 131 234
  1129. XThis file has one or more BNDLs, but the bundle bit is not set.\0D++
  1130. X\0D++
  1131. XNumber of BNDL resources = ^0.
  1132. X
  1133. X
  1134. X
  1135. X,133
  1136. X2
  1137. X
  1138. XButton
  1139. X147 91 167 151
  1140. XOK
  1141. X
  1142. XStaticText disabled
  1143. X48 13 116 231
  1144. XBNDL ^0 has ^1 resource types instead of the expected 2.
  1145. X
  1146. X
  1147. X
  1148. X,134
  1149. X2
  1150. X
  1151. XButton
  1152. X146 91 166 151
  1153. XOK
  1154. X
  1155. XStaticText disabled
  1156. X41 32 125 219
  1157. XThe signature resource listed in BNDL ^0, ^1 ^2, is missing.
  1158. X
  1159. X
  1160. X
  1161. X,135
  1162. X2
  1163. X
  1164. XButton
  1165. X151 93 171 153
  1166. XOK
  1167. X
  1168. XStaticText disabled
  1169. X38 14 112 230
  1170. XBNDL ^0 refers to resource type '^1'.  The usual types are 'FREF' and 'ICN#'.
  1171. X
  1172. X
  1173. X
  1174. X,136
  1175. X2
  1176. X
  1177. XButton
  1178. X150 92 170 152
  1179. XOK
  1180. X
  1181. XStaticText disabled
  1182. X68 20 117 215
  1183. XBNDL ^0 is too short!
  1184. X
  1185. X
  1186. X
  1187. X,137
  1188. X2
  1189. X
  1190. XButton
  1191. X147 91 167 151
  1192. XOK
  1193. X
  1194. XStaticText disabled
  1195. X65 29 107 212
  1196. XBNDL ^0 is longer than expected.
  1197. X
  1198. X
  1199. X
  1200. X,138
  1201. X2
  1202. X
  1203. XButton
  1204. X144 91 164 151
  1205. XOK
  1206. X
  1207. XStaticText disabled
  1208. X64 20 97 232
  1209. XICN# ^2 is ^3 bytes instead of the usual 256.
  1210. X
  1211. X
  1212. X
  1213. X,139
  1214. X2
  1215. X
  1216. XButton
  1217. X142 91 162 151
  1218. XOK
  1219. X
  1220. XStaticText disabled
  1221. X43 23 118 221
  1222. XFREF ^2 is only ^3 bytes, which is less than the minimum FREF size of six.
  1223. X
  1224. X
  1225. X
  1226. X,140
  1227. X2
  1228. X
  1229. XButton
  1230. X147 91 167 151
  1231. XOK
  1232. X
  1233. XStaticText disabled
  1234. X45 12 119 228
  1235. XFREF ^2 is ^3 bytes long, which exceeds the maximum FREF size of 262.
  1236. X
  1237. X
  1238. X
  1239. X,141
  1240. X2
  1241. X
  1242. XButton
  1243. X154 92 174 152
  1244. XOK
  1245. X
  1246. XStaticText disabled
  1247. X59 13 126 228
  1248. XBNDL ^0 refers to resource ^1 ^2, which is missing.
  1249. X
  1250. X
  1251. X
  1252. X,142
  1253. X3
  1254. X
  1255. XButton
  1256. X150 25 170 85
  1257. XDo it!
  1258. X
  1259. XButton
  1260. X150 152 170 212
  1261. XDon't!
  1262. X
  1263. XStaticText disabled
  1264. X42 20 99 211
  1265. XCheck contents of volume "^0"?
  1266. X
  1267. X
  1268. X
  1269. X,143
  1270. X2
  1271. X
  1272. XButton
  1273. X158 91 178 151
  1274. XOK
  1275. X
  1276. XStaticText disabled
  1277. X52 17 113 231
  1278. XBNDL ^0 does not contain the usual list of ICN# resources.
  1279. X
  1280. X
  1281. X
  1282. X,144
  1283. X2
  1284. X
  1285. XButton
  1286. X154 91 174 151
  1287. XOK
  1288. X
  1289. XStaticText disabled
  1290. X62 12 122 229
  1291. XBNDL ^0 does not contain the usual list of FREF resources.
  1292. X
  1293. X
  1294. X
  1295. X,145
  1296. X2
  1297. X
  1298. XButton
  1299. X166 91 186 151
  1300. XOK
  1301. X
  1302. XStaticText disabled
  1303. X23 5 154 236
  1304. XBNDL ^0 refers to FREF ^1, whose icon local ID is ^2.\0D++
  1305. X\0D++
  1306. XThis local ID is unresolved.  That is, it is not the local ID of any member of the ICN# resource list in the same bundle.
  1307. X
  1308. X
  1309. X
  1310. X,146
  1311. X2
  1312. X
  1313. XButton
  1314. X157 91 177 151
  1315. XOK
  1316. X
  1317. XStaticText disabled
  1318. X44 13 140 231
  1319. XThis file's bundle doesn't assign an icon to this file.\0D++
  1320. X\0D++
  1321. XThere's no FREF with a file type that matches this file's type, which is '^0'.
  1322. X
  1323. X
  1324. X
  1325. X,147
  1326. X2
  1327. X
  1328. XButton
  1329. X162 93 182 153
  1330. XOK
  1331. X
  1332. XStaticText disabled
  1333. X43 11 142 232
  1334. XThis file's bundle doesn't appear to be for this file.\0D++
  1335. X\0D++
  1336. XThe OwnerName in the bundle doesn't match the file's creator, which is '^0'.
  1337. X
  1338. X
  1339. X
  1340. X* -------------------- NewType:ALRT
  1341. XTYPE ALRT=GNRL
  1342. X
  1343. X
  1344. X,128
  1345. X.H
  1346. X00320064 012C019C 00804444
  1347. X
  1348. X
  1349. X,130
  1350. X.H
  1351. X006E0086 01360176 00824444
  1352. X
  1353. X
  1354. X,129
  1355. X.H
  1356. X0050008A 0118017A 00814444
  1357. X
  1358. X
  1359. X,131
  1360. X.H
  1361. X0080008A 0148017A 00834444
  1362. X
  1363. X
  1364. X,132
  1365. X.H
  1366. X00800086 01480176 00844444
  1367. X
  1368. X
  1369. X,133
  1370. X.H
  1371. X0080008E 0148017E 00854444
  1372. X
  1373. X
  1374. X,134
  1375. X.H
  1376. X0080008A 0148017A 00864444
  1377. X
  1378. X
  1379. X,135
  1380. X.H
  1381. X00800088 01480178 00874444
  1382. X
  1383. X
  1384. X,136
  1385. X.H
  1386. X00800084 01480174 00884444
  1387. X
  1388. X
  1389. X,137
  1390. X.H
  1391. X0080007E 0148016E 00894444
  1392. X
  1393. X
  1394. X,138
  1395. X.H
  1396. X00800086 01480176 008A4444
  1397. X
  1398. X
  1399. X,139
  1400. X.H
  1401. X00800084 01480174 008B4444
  1402. X
  1403. X
  1404. X,140
  1405. X.H
  1406. X00800086 01480176 008C4444
  1407. X
  1408. X
  1409. X,141
  1410. X.H
  1411. X00800084 01480174 008D4444
  1412. X
  1413. X
  1414. X,142
  1415. X.H
  1416. X0058008A 0120017A 008E4444
  1417. X
  1418. X
  1419. X,143
  1420. X.H
  1421. X00800088 01480178 008F4444
  1422. X
  1423. X
  1424. X,144
  1425. X.H
  1426. X00800082 01480172 00904444
  1427. X
  1428. X
  1429. X,145
  1430. X.H
  1431. X00800084 01480174 00914444
  1432. X
  1433. X
  1434. X,146
  1435. X.H
  1436. X007C008C 0144017C 00924444
  1437. X
  1438. X
  1439. X,147
  1440. X.H
  1441. X007A0088 01420178 00934444
  1442. X
  1443. X
  1444. ________This_Is_The_END________
  1445. if test `wc -l < DeskCheck.r` -ne 480; then
  1446.     echo 'shar: DeskCheck.r was damaged during transit'
  1447.   echo '      (should have been 480 bytes)'
  1448. fi
  1449. fi        ; : end of overwriting check
  1450. echo 'Extracting Alerts'
  1451. if test -f Alerts; then echo 'shar: will not overwrite Alerts'; else
  1452. sed 's/^X//' << '________This_Is_The_END________' > Alerts
  1453. X
  1454. XThis draft written February 4, 1987.
  1455. XE.Vishniac / P.O. Box 1357 / East Arlington, MA 02174
  1456. X
  1457. XFollowing are the alerts from DeskCheck, listed by ALRT number with a short
  1458. Xexplanation of each one's significance.  ^0, ^1, ^2, and ^3 indicate text which
  1459. Xis supplied at run-time.
  1460. X
  1461. X
  1462. X128: "Welcome to DeskCheck!"
  1463. X
  1464. XThis alert is normal.
  1465. X
  1466. X129: "All done."
  1467. X
  1468. XThis alert is normal.
  1469. X
  1470. X130: "SetVol Failed!  Error code = ^0."
  1471. X
  1472. XDeskCheck was unable to move to some directory in the course of its search.
  1473. XThis should never happen.
  1474. X
  1475. X131: "OpenResFile failed!  Error code = ^0."
  1476. X
  1477. XDeskCheck attempts to check every file that has a resource fork.  Some files
  1478. Xhave bogus resource forks, which cause errors when an attempt is made to open
  1479. Xthem as resource files.  In extreme cases, the Mac may bomb in OpenResFile.
  1480. X
  1481. X132: "This file has one or more BNDLs, but the bundle bit is not set.
  1482. X      Number of BNDL resources = ^0."
  1483. X
  1484. XIn the case of the Desktop file, this is normal.  For any other file, it
  1485. Xwarns that the Finder won't take any notice of the file's bundle because
  1486. Xthe bundle bit is off.
  1487. X
  1488. X133: "BNDL ^0 has ^1 resource types instead of the expected 2."
  1489. X
  1490. XBNDL resources normally have two lists of resources: one for ICN# resources
  1491. Xand one for FREF resources.  A different number of lists is unusual, but not
  1492. Xnecessarily an error.
  1493. X
  1494. X134: "The signature resource listed in BNDL ^0, ^1 ^2, is missing."
  1495. X
  1496. XAn application's "signature" is the unique identifier which connects it with
  1497. Xthe documents it creates or uses.  The signature resource is a resource whose
  1498. Xresource type is the same as the creator of files associated with the application.
  1499. XThe signature is listed in the application's bundle.
  1500. X
  1501. X135: "BNDL ^0 refers to resource type '^1'.  The usual types are 'FREF' and 'ICN#'."
  1502. X
  1503. XTypes other than ICN# and FREF in the bundle are unusual, but not necessarily
  1504. Xan error.
  1505. X
  1506. X136: "BNDL ^0 is too short!"
  1507. X
  1508. XDeskCheck parses each bundle to be sure that the actual resource length is
  1509. Xlong enough to contain the bundle's required fields and lists.  A bundle
  1510. Xresource that's too short is a severe error.
  1511. X
  1512. X137: "BNDL ^0 is longer than expected."
  1513. X
  1514. XDeskCheck parses each bundle to be sure that the actual resource length is
  1515. Xno longer than required to contain the bundle's required fields and lists.
  1516. XA bundle that's too long is unusual, but not necessarily a problem.
  1517. X
  1518. X138: "ICN# ^2 is ^3 bytes instead of the usual 256."
  1519. X
  1520. XICN# resources have a fixed format, with a length of exactly 256 bytes.
  1521. XA different length is a minor error.
  1522. X
  1523. X139: "FREF ^2 is only ^3 bytes, which is less than the minimum FREF size of six."
  1524. X
  1525. XAn FREF consists of a required signature (four bytes) and ICN# local ID (two bytes),
  1526. Xoptionally followed by a string (zero to 256 bytes).  So, an FREF could reasonably
  1527. Xbe any size from six to 256 bytes.  An FREF of less than six bytes is a severe error.
  1528. X
  1529. X140: "FREF ^2 is ^3 bytes long, which exceeds the maximum FREF size of 262."
  1530. X
  1531. XAn FREF which runs past the maximum length of 262 bytes is unusual, but not
  1532. Xnecessarily a problem.
  1533. X
  1534. X141: "BNDL ^0 refers to resource ^1 ^2, which is missing."
  1535. X
  1536. XDeskCheck verifies that all resources listed in the bundle are actually present
  1537. Xin the same file.  A missing resource is a severe error.
  1538. X
  1539. X142: "Check contents of volume "^0"?"
  1540. X
  1541. XThis inquiry is normal.
  1542. X
  1543. X143: "BNDL ^0 does not contain the usual list of ICN# resources."
  1544. X
  1545. XThis is not necessarily a problem, but means the bundle isn't much good.
  1546. X
  1547. X144: "BNDL ^0 does not contain the usual list of FREF resources."
  1548. X
  1549. XThis is not necessarily a problem, but means the bundle isn't much good.
  1550. X
  1551. X145: "BNDL ^0 refers to FREF ^1, whose icon local ID is ^2.
  1552. X      This local ID is unresolved.  That is, it is not the local ID of any member
  1553. X      of the ICN# resource list in the same bundle."
  1554. X
  1555. XEach FREF associates a file type with an ICN# resource.  The ICN# is identified
  1556. Xby a local ID, which is mapped to the ICN#'s real ID through the ICN# list in
  1557. Xthe bundle itself.  An unresolved local ID is a severe error.
  1558. X
  1559. X146: "This file's bundle doesn't assign an icon to this file.
  1560. X      There's no FREF with a file type that matches this file's type, which is '^0'."
  1561. X
  1562. XIn the case of the Desktop file, this alert is normal.  For any other file, it
  1563. Xsuggests that the bundle isn't complete.  This is not necessarily a problem, but
  1564. Xmeans that the file will appear with a default icon on the desktop.
  1565. X
  1566. X147: "This file's bundle doesn't appear to be for this file.
  1567. X      The OwnerName in the bundle doesn't match the file's creator, which is '^0'."
  1568. X
  1569. XIn the case of the Desktop file, this alert is normal.  For any other file, it
  1570. Xwarns that the file's bundle doesn't match information about the file itself.
  1571. ________This_Is_The_END________
  1572. if test `wc -l < Alerts` -ne 118; then
  1573.     echo 'shar: Alerts was damaged during transit'
  1574.   echo '      (should have been 118 bytes)'
  1575. fi
  1576. fi        ; : end of overwriting check
  1577. exit 0
  1578.